This commit is contained in:
parent
1bca758919
commit
9d443e16ce
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3606dc28b1fa140c7d0191478097a89f7ef7a3183a811a1410a230052b71eb4
|
||||
size 918268
|
3
gvfs-1.1.5.tar.bz2
Normal file
3
gvfs-1.1.5.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34bd168c496a9a08a597ed4e7b85443f6bccebb0962bd4e22c8c79acc7d3b6a8
|
||||
size 979299
|
@ -1,213 +0,0 @@
|
||||
diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsbackendnds.c
|
||||
--- gvfs-1.0.2_old/daemon/gvfsbackendnds.c 2009-01-16 22:25:34.000000000 +0530
|
||||
+++ gvfs-1.0.2_new/daemon/gvfsbackendnds.c 2009-01-16 23:57:55.000000000 +0530
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
#include<dlfcn.h>
|
||||
+#include <sys/utsname.h>
|
||||
|
||||
#include "gvfsbackendnds.h"
|
||||
#include "gvfsjobmountmountable.h"
|
||||
@@ -49,8 +50,6 @@
|
||||
|
||||
|
||||
|
||||
-/* Function Pointer to /opt/novell/lib/libinterface.so */
|
||||
-int (*retrieve_children)(char *) = NULL;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
@@ -199,6 +198,9 @@ update_cache (GVfsBackendNds *backend,co
|
||||
int res;
|
||||
char *ptr=NULL;
|
||||
char *server_name=NULL;
|
||||
+ struct utsname utsbuf;
|
||||
+/* Function Pointer to /opt/novell/lib/libinterface.so */
|
||||
+int (*retrieve_children)(char *);
|
||||
|
||||
entries = NULL;
|
||||
entry_errno = 0;
|
||||
@@ -232,17 +234,42 @@ if(backend->server == NULL) //retrieve
|
||||
|
||||
else //retrieve object names
|
||||
{
|
||||
- handle = dlopen("/opt/novell/lib/libinterface.so",RTLD_NOW);
|
||||
+ uname(&utsbuf);
|
||||
+ if(!strcmp(utsbuf.machine,"x86_64"))
|
||||
+ handle = dlopen("/usr/lib64/libinterface.so",RTLD_NOW | RTLD_DEEPBIND);
|
||||
+ else
|
||||
+ handle = dlopen("/usr/lib/libinterface.so",RTLD_NOW | RTLD_DEEPBIND);
|
||||
|
||||
if(handle == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
*(void **)(&retrieve_children) = dlsym(handle,"retrieve_children");
|
||||
+
|
||||
+ unlink("/tmp/ndsobjects.txt");
|
||||
+
|
||||
if(retrieve_children != NULL)
|
||||
{
|
||||
res = (*retrieve_children)(server_name);
|
||||
- }
|
||||
+
|
||||
+ if(res == 0)
|
||||
+ {
|
||||
+ fptr = fopen("/tmp/ndsobjects.txt","r");
|
||||
+ if(fptr == NULL)
|
||||
+ {
|
||||
+ entry_errno = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ objectname = (char *)malloc(sizeof(char) * 400);
|
||||
+ while (fgets(objectname,400,fptr) != NULL)
|
||||
+ {
|
||||
+ objectlist = g_list_append(objectlist,g_strdup(objectname));
|
||||
+ memset(objectname,'\0',400);
|
||||
+ }
|
||||
+ fclose(fptr);
|
||||
+ free(objectname);
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
{
|
||||
return;
|
||||
@@ -265,6 +292,8 @@ for(object = objectlist;object != NULL;o
|
||||
entries = g_list_append (entries, entry);
|
||||
}
|
||||
|
||||
+//if(objectlist != NULL)
|
||||
+//g_list_free(objectlist);
|
||||
|
||||
out:
|
||||
|
||||
@@ -274,7 +303,7 @@ for(object = objectlist;object != NULL;o
|
||||
backend->entries = entries;
|
||||
g_mutex_unlock (backend->entries_lock);
|
||||
}
|
||||
- backend->entry_errno = entry_errno;
|
||||
+ backend->entry_errno = entry_errno;
|
||||
|
||||
}
|
||||
|
||||
@@ -376,15 +405,14 @@ do_mount (GVfsBackend *backend,
|
||||
display_name = g_strdup (_("NVVFS Top Directory"));
|
||||
browse_mount_spec = g_mount_spec_new ("nds");
|
||||
icon = "network-workgroup";
|
||||
-
|
||||
}
|
||||
else
|
||||
{
|
||||
display_name = g_strdup_printf (_("NVVFS Objects"));
|
||||
browse_mount_spec = g_mount_spec_new ("nds");
|
||||
+ //g_mount_spec_set (browse_mount_spec, "host", op_backend->mounted_server);
|
||||
g_mount_spec_set (browse_mount_spec, "host", op_backend->server);
|
||||
icon = "network-server";
|
||||
-
|
||||
}
|
||||
|
||||
g_vfs_backend_set_display_name (backend, display_name);
|
||||
@@ -424,6 +452,74 @@ try_mount (GVfsBackend *backend,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+static void
|
||||
+run_mount_mountable (GVfsBackendNds *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ BrowseEntry *entry;
|
||||
+ GError *error = NULL;
|
||||
+ GMountSpec *mount_spec;
|
||||
+
|
||||
+ g_mutex_lock (backend->entries_lock);
|
||||
+
|
||||
+backend->server = g_strdup(filename);
|
||||
+
|
||||
+ mount_spec = get_mount_spec_for_share (backend->server, filename);
|
||||
+ g_vfs_job_mount_mountable_set_target (job, mount_spec, "/", TRUE);
|
||||
+ g_mount_spec_unref (mount_spec);
|
||||
+ g_mutex_unlock (backend->entries_lock);
|
||||
+
|
||||
+ g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static gboolean
|
||||
+do_mount_mountable (GVfsBackend *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
+
|
||||
+update_cache (op_backend,filename);
|
||||
+
|
||||
+ run_mount_mountable (op_backend,
|
||||
+ job,
|
||||
+ filename,
|
||||
+ mount_source);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+try_mount_mountable (GVfsBackend *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
+
|
||||
+
|
||||
+ if (is_root (filename))
|
||||
+ {
|
||||
+ g_vfs_job_failed (G_VFS_JOB (job),
|
||||
+ G_IO_ERROR, G_IO_ERROR_NOT_MOUNTABLE_FILE,
|
||||
+ _("The file is not a mountable"));
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+update_cache (op_backend,filename);
|
||||
+
|
||||
+ run_mount_mountable (op_backend,
|
||||
+ job,
|
||||
+ filename,
|
||||
+ mount_source);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
#define SUB_DELIM_CHARS "!$&'()*+,;="
|
||||
|
||||
static gboolean
|
||||
@@ -482,7 +578,10 @@ get_file_info_from_entry (GVfsBackendNds
|
||||
g_file_info_set_edit_name (info, entry->name_utf8);
|
||||
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL, TRUE);
|
||||
|
||||
- icon = g_themed_icon_new ("network-server");
|
||||
+ if(backend->server == NULL) //NDS-Tree icon
|
||||
+ icon = g_themed_icon_new ("ncl-ndstree");
|
||||
+ else
|
||||
+ icon = g_themed_icon_new ("ncl-nwcontext");
|
||||
|
||||
if (icon)
|
||||
{
|
||||
@@ -634,7 +733,6 @@ try_enumerate (GVfsBackend *backend,
|
||||
{
|
||||
GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
|
||||
-
|
||||
update_cache (op_backend,filename);
|
||||
|
||||
run_enumerate (op_backend, job, filename, matcher);
|
||||
@@ -648,7 +746,6 @@ g_vfs_backend_nds_class_init (GVfsBacken
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS (klass);
|
||||
|
||||
-
|
||||
gobject_class->finalize = g_vfs_backend_nds_finalize;
|
||||
|
||||
backend_class->mount = do_mount;
|
@ -1,7 +1,8 @@
|
||||
diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsbackendnds.c
|
||||
--- gvfs-1.0.2_old/daemon/gvfsbackendnds.c 1970-01-01 05:30:00.000000000 +0530
|
||||
+++ gvfs-1.0.2_new/daemon/gvfsbackendnds.c 2009-01-15 10:43:07.000000000 +0530
|
||||
@@ -0,0 +1,666 @@
|
||||
Index: gvfs-1.1.3/daemon/gvfsbackendnds.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gvfs-1.1.3/daemon/gvfsbackendnds.c
|
||||
@@ -0,0 +1,763 @@
|
||||
+/* GIO - GLib Input, Output and Streaming Library
|
||||
+ *
|
||||
+ * Copyright (C) 2006-2007 Red Hat, Inc.
|
||||
@ -39,6 +40,7 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+#include <glib/gi18n.h>
|
||||
+#include <gio/gio.h>
|
||||
+#include<dlfcn.h>
|
||||
+#include <sys/utsname.h>
|
||||
+
|
||||
+#include "gvfsbackendnds.h"
|
||||
+#include "gvfsjobmountmountable.h"
|
||||
@ -53,8 +55,6 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+
|
||||
+
|
||||
+
|
||||
+/* Function Pointer to /opt/novell/lib/libinterface.so */
|
||||
+int (*retrieve_children)(char *) = NULL;
|
||||
+
|
||||
+typedef struct {
|
||||
+ char *name;
|
||||
@ -203,6 +203,9 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ int res;
|
||||
+ char *ptr=NULL;
|
||||
+ char *server_name=NULL;
|
||||
+ struct utsname utsbuf;
|
||||
+/* Function Pointer to /opt/novell/lib/libinterface.so */
|
||||
+int (*retrieve_children)(char *);
|
||||
+
|
||||
+ entries = NULL;
|
||||
+ entry_errno = 0;
|
||||
@ -236,17 +239,42 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+
|
||||
+else //retrieve object names
|
||||
+{
|
||||
+ handle = dlopen("/opt/novell/lib/libinterface.so",RTLD_NOW);
|
||||
+ uname(&utsbuf);
|
||||
+ if(!strcmp(utsbuf.machine,"x86_64"))
|
||||
+ handle = dlopen("/usr/lib64/libinterface.so",RTLD_NOW | RTLD_DEEPBIND);
|
||||
+ else
|
||||
+ handle = dlopen("/usr/lib/libinterface.so",RTLD_NOW | RTLD_DEEPBIND);
|
||||
+
|
||||
+ if(handle == NULL)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ *(void **)(&retrieve_children) = dlsym(handle,"retrieve_children");
|
||||
+
|
||||
+ unlink("/tmp/ndsobjects.txt");
|
||||
+
|
||||
+ if(retrieve_children != NULL)
|
||||
+ {
|
||||
+ res = (*retrieve_children)(server_name);
|
||||
+ }
|
||||
+
|
||||
+ if(res == 0)
|
||||
+ {
|
||||
+ fptr = fopen("/tmp/ndsobjects.txt","r");
|
||||
+ if(fptr == NULL)
|
||||
+ {
|
||||
+ entry_errno = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ objectname = (char *)malloc(sizeof(char) * 400);
|
||||
+ while (fgets(objectname,400,fptr) != NULL)
|
||||
+ {
|
||||
+ objectlist = g_list_append(objectlist,g_strdup(objectname));
|
||||
+ memset(objectname,'\0',400);
|
||||
+ }
|
||||
+ fclose(fptr);
|
||||
+ free(objectname);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return;
|
||||
@ -269,6 +297,8 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ entries = g_list_append (entries, entry);
|
||||
+}
|
||||
+
|
||||
+//if(objectlist != NULL)
|
||||
+//g_list_free(objectlist);
|
||||
+
|
||||
+ out:
|
||||
+
|
||||
@ -278,7 +308,7 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ backend->entries = entries;
|
||||
+ g_mutex_unlock (backend->entries_lock);
|
||||
+ }
|
||||
+ backend->entry_errno = entry_errno;
|
||||
+ backend->entry_errno = entry_errno;
|
||||
+
|
||||
+}
|
||||
+
|
||||
@ -380,15 +410,14 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ display_name = g_strdup (_("NVVFS Top Directory"));
|
||||
+ browse_mount_spec = g_mount_spec_new ("nds");
|
||||
+ icon = "network-workgroup";
|
||||
+
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ display_name = g_strdup_printf (_("NVVFS Objects"));
|
||||
+ browse_mount_spec = g_mount_spec_new ("nds");
|
||||
+ //g_mount_spec_set (browse_mount_spec, "host", op_backend->mounted_server);
|
||||
+ g_mount_spec_set (browse_mount_spec, "host", op_backend->server);
|
||||
+ icon = "network-server";
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ g_vfs_backend_set_display_name (backend, display_name);
|
||||
@ -428,6 +457,74 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+run_mount_mountable (GVfsBackendNds *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ BrowseEntry *entry;
|
||||
+ GError *error = NULL;
|
||||
+ GMountSpec *mount_spec;
|
||||
+
|
||||
+ g_mutex_lock (backend->entries_lock);
|
||||
+
|
||||
+backend->server = g_strdup(filename);
|
||||
+
|
||||
+ mount_spec = get_mount_spec_for_share (backend->server, filename);
|
||||
+ g_vfs_job_mount_mountable_set_target (job, mount_spec, "/", TRUE);
|
||||
+ g_mount_spec_unref (mount_spec);
|
||||
+ g_mutex_unlock (backend->entries_lock);
|
||||
+
|
||||
+ g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static gboolean
|
||||
+do_mount_mountable (GVfsBackend *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
+
|
||||
+update_cache (op_backend,filename);
|
||||
+
|
||||
+ run_mount_mountable (op_backend,
|
||||
+ job,
|
||||
+ filename,
|
||||
+ mount_source);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+try_mount_mountable (GVfsBackend *backend,
|
||||
+ GVfsJobMountMountable *job,
|
||||
+ const char *filename,
|
||||
+ GMountSource *mount_source)
|
||||
+{
|
||||
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
+
|
||||
+
|
||||
+ if (is_root (filename))
|
||||
+ {
|
||||
+ g_vfs_job_failed (G_VFS_JOB (job),
|
||||
+ G_IO_ERROR, G_IO_ERROR_NOT_MOUNTABLE_FILE,
|
||||
+ _("The file is not a mountable"));
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+update_cache (op_backend,filename);
|
||||
+
|
||||
+ run_mount_mountable (op_backend,
|
||||
+ job,
|
||||
+ filename,
|
||||
+ mount_source);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+#define SUB_DELIM_CHARS "!$&'()*+,;="
|
||||
+
|
||||
+static gboolean
|
||||
@ -486,7 +583,10 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ g_file_info_set_edit_name (info, entry->name_utf8);
|
||||
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL, TRUE);
|
||||
+
|
||||
+ icon = g_themed_icon_new ("network-server");
|
||||
+ if(backend->server == NULL) //NDS-Tree icon
|
||||
+ icon = g_themed_icon_new ("ncl-ndstree");
|
||||
+ else
|
||||
+ icon = g_themed_icon_new ("ncl-nwcontext");
|
||||
+
|
||||
+ if (icon)
|
||||
+ {
|
||||
@ -638,7 +738,6 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+{
|
||||
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
|
||||
+
|
||||
+
|
||||
+ update_cache (op_backend,filename);
|
||||
+
|
||||
+ run_enumerate (op_backend, job, filename, matcher);
|
||||
@ -652,7 +751,6 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
+ GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS (klass);
|
||||
+
|
||||
+
|
||||
+ gobject_class->finalize = g_vfs_backend_nds_finalize;
|
||||
+
|
||||
+ backend_class->mount = do_mount;
|
||||
@ -668,9 +766,10 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.c gvfs-1.0.2_new/daemon/gvfsback
|
||||
+{
|
||||
+ g_set_application_name (_("Displaying Embedded Objects"));
|
||||
+}
|
||||
diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.h gvfs-1.0.2_new/daemon/gvfsbackendnds.h
|
||||
--- gvfs-1.0.2_old/daemon/gvfsbackendnds.h 1970-01-01 05:30:00.000000000 +0530
|
||||
+++ gvfs-1.0.2_new/daemon/gvfsbackendnds.h 2009-01-14 14:40:44.000000000 +0530
|
||||
Index: gvfs-1.1.3/daemon/gvfsbackendnds.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gvfs-1.1.3/daemon/gvfsbackendnds.h
|
||||
@@ -0,0 +1,53 @@
|
||||
+/* GIO - GLib Input, Output and Streaming Library
|
||||
+ *
|
||||
@ -725,12 +824,13 @@ diff -Nurp gvfs-1.0.2_old/daemon/gvfsbackendnds.h gvfs-1.0.2_new/daemon/gvfsback
|
||||
+G_END_DECLS
|
||||
+
|
||||
+#endif /* __G_VFS_BACKEND_NDS_H__ */
|
||||
diff -Nurp gvfs-1.0.2_old/daemon/Makefile.am gvfs-1.0.2_new/daemon/Makefile.am
|
||||
--- gvfs-1.0.2_old/daemon/Makefile.am 2008-09-14 17:35:05.000000000 +0530
|
||||
+++ gvfs-1.0.2_new/daemon/Makefile.am 2009-01-14 14:33:49.000000000 +0530
|
||||
@@ -95,6 +95,10 @@ mount_DATA += archive.mount
|
||||
libexec_PROGRAMS += gvfsd-archive
|
||||
endif
|
||||
Index: gvfs-1.1.3/daemon/Makefile.am
|
||||
===================================================================
|
||||
--- gvfs-1.1.3.orig/daemon/Makefile.am
|
||||
+++ gvfs-1.1.3/daemon/Makefile.am
|
||||
@@ -105,6 +105,10 @@ mount_in_files += nvvfs.mount.in
|
||||
mount_DATA += nvvfs.mount
|
||||
libexec_PROGRAMS += gvfsd-nvvfs
|
||||
|
||||
+mount_in_files += nds.mount.in
|
||||
+mount_DATA += nds.mount
|
||||
@ -739,9 +839,9 @@ diff -Nurp gvfs-1.0.2_old/daemon/Makefile.am gvfs-1.0.2_new/daemon/Makefile.am
|
||||
EXTRA_DIST = gvfs-daemon.service.in $(mount_in_files) obexftp-marshal.list
|
||||
|
||||
DISTCLEANFILES = gvfs-daemon.service $(mount_DATA)
|
||||
@@ -395,3 +399,16 @@ gvfsd_dav_CPPFLAGS = \
|
||||
@@ -403,6 +407,19 @@ gvfsd_http_CPPFLAGS = \
|
||||
|
||||
gvfsd_dav_LDADD = $(libraries) $(HTTP_LIBS)
|
||||
gvfsd_http_LDADD = $(libraries) $(HTTP_LIBS)
|
||||
|
||||
+gvfsd_nds_SOURCES = \
|
||||
+ gvfsbackendnds.c gvfsbackendnds.h \
|
||||
@ -756,9 +856,13 @@ diff -Nurp gvfs-1.0.2_old/daemon/Makefile.am gvfs-1.0.2_new/daemon/Makefile.am
|
||||
+
|
||||
+gvfsd_nds_LDADD = $(libraries) -ldl
|
||||
+
|
||||
diff -Nurp gvfs-1.0.2_old/daemon/nds.mount.in gvfs-1.0.2_new/daemon/nds.mount.in
|
||||
--- gvfs-1.0.2_old/daemon/nds.mount.in 1970-01-01 05:30:00.000000000 +0530
|
||||
+++ gvfs-1.0.2_new/daemon/nds.mount.in 2009-01-14 14:41:15.000000000 +0530
|
||||
gvfsd_nvvfs_SOURCES = \
|
||||
gvfsbackendnvvfs.c gvfsbackendnvvfs.h \
|
||||
daemon-main.c daemon-main.h \
|
||||
Index: gvfs-1.1.3/daemon/nds.mount.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gvfs-1.1.3/daemon/nds.mount.in
|
||||
@@ -0,0 +1,5 @@
|
||||
+[Mount]
|
||||
+Type=nds
|
@ -1,453 +0,0 @@
|
||||
Index: daemon/obexftp-marshal.list
|
||||
===================================================================
|
||||
--- daemon/obexftp-marshal.list (revision 2022)
|
||||
+++ daemon/obexftp-marshal.list (working copy)
|
||||
@@ -1,2 +1,4 @@
|
||||
+VOID:STRING
|
||||
VOID:STRING,STRING
|
||||
+VOID:STRING,STRING,STRING
|
||||
VOID:STRING,STRING,UINT64
|
||||
Index: daemon/gvfsbackendobexftp.c
|
||||
===================================================================
|
||||
--- daemon/gvfsbackendobexftp.c (revision 2022)
|
||||
+++ daemon/gvfsbackendobexftp.c (working copy)
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
char *display_name;
|
||||
char *bdaddr;
|
||||
- guint type;
|
||||
+ char *icon_name;
|
||||
|
||||
DBusGConnection *connection;
|
||||
DBusGProxy *manager_proxy;
|
||||
@@ -96,177 +96,106 @@
|
||||
|
||||
G_DEFINE_TYPE (GVfsBackendObexftp, g_vfs_backend_obexftp, G_VFS_TYPE_BACKEND);
|
||||
|
||||
-/* This should all live in bluez-gnome, and we
|
||||
- * should depend on it */
|
||||
-enum {
|
||||
- BLUETOOTH_TYPE_ANY = 1,
|
||||
- BLUETOOTH_TYPE_PHONE = 1 << 1,
|
||||
- BLUETOOTH_TYPE_MODEM = 1 << 2,
|
||||
- BLUETOOTH_TYPE_COMPUTER = 1 << 3,
|
||||
- BLUETOOTH_TYPE_NETWORK = 1 << 4,
|
||||
- BLUETOOTH_TYPE_HEADSET = 1 << 5,
|
||||
- BLUETOOTH_TYPE_KEYBOARD = 1 << 6,
|
||||
- BLUETOOTH_TYPE_MOUSE = 1 << 7,
|
||||
- BLUETOOTH_TYPE_CAMERA = 1 << 8,
|
||||
- BLUETOOTH_TYPE_PRINTER = 1 << 9
|
||||
-};
|
||||
+static void session_connect_error_cb (DBusGProxy *proxy,
|
||||
+ const char *session_object,
|
||||
+ const gchar *error_name,
|
||||
+ const gchar *error_message,
|
||||
+ gpointer user_data);
|
||||
+static void session_connected_cb (DBusGProxy *proxy,
|
||||
+ const char *session_object,
|
||||
+ gpointer user_data);
|
||||
|
||||
-static const char *
|
||||
-_get_icon_from_type (guint type)
|
||||
+/* Used to detect broken listings from
|
||||
+ * old Nokia 3650s */
|
||||
+static gboolean
|
||||
+_is_nokia_3650 (const char *bdaddr)
|
||||
{
|
||||
- switch (type)
|
||||
- {
|
||||
- case BLUETOOTH_TYPE_PHONE:
|
||||
- return "phone";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_MODEM:
|
||||
- return "modem";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_COMPUTER:
|
||||
- return "network-server";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_NETWORK:
|
||||
- return "network-wireless";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_HEADSET:
|
||||
- return "stock_headphones";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_KEYBOARD:
|
||||
- return "input-keyboard";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_MOUSE:
|
||||
- return "input-mouse";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_CAMERA:
|
||||
- return "camera-photo";
|
||||
- break;
|
||||
- case BLUETOOTH_TYPE_PRINTER:
|
||||
- return "printer";
|
||||
- break;
|
||||
- default:
|
||||
- return "bluetooth";
|
||||
- break;
|
||||
- }
|
||||
+ /* Don't ask, Nokia seem to use a Bluetooth
|
||||
+ * HCI from Murata */
|
||||
+ return g_str_has_prefix(bdaddr, "00:60:57");
|
||||
}
|
||||
|
||||
-static int
|
||||
-_get_type_from_class (guint class)
|
||||
+static char *
|
||||
+get_name_and_icon (DBusGProxy *device, char **icon_name)
|
||||
{
|
||||
- switch ((class & 0x1f00) >> 8)
|
||||
+ GHashTable *hash;
|
||||
+
|
||||
+ if (dbus_g_proxy_call (device, "GetProperties", NULL,
|
||||
+ G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE),
|
||||
+ &hash, G_TYPE_INVALID) != FALSE)
|
||||
{
|
||||
- case 0x01:
|
||||
- return BLUETOOTH_TYPE_COMPUTER;
|
||||
- case 0x02:
|
||||
- switch ((class & 0xfc) >> 2)
|
||||
+ GValue *value;
|
||||
+ char *name;
|
||||
+
|
||||
+ value = g_hash_table_lookup (hash, "Name");
|
||||
+ name = value ? g_value_dup_string(value) : NULL;
|
||||
+
|
||||
+ value = g_hash_table_lookup (hash, "Icon");
|
||||
+ if (value)
|
||||
{
|
||||
- case 0x01:
|
||||
- case 0x02:
|
||||
- case 0x03:
|
||||
- case 0x05:
|
||||
- return BLUETOOTH_TYPE_PHONE;
|
||||
- case 0x04:
|
||||
- return BLUETOOTH_TYPE_MODEM;
|
||||
+ *icon_name = g_value_dup_string (value);
|
||||
}
|
||||
- break;
|
||||
- case 0x03:
|
||||
- return BLUETOOTH_TYPE_NETWORK;
|
||||
- case 0x04:
|
||||
- switch ((class & 0xfc) >> 2)
|
||||
+ else
|
||||
{
|
||||
- case 0x01:
|
||||
- return BLUETOOTH_TYPE_HEADSET;
|
||||
+ *icon_name = g_strdup ("bluetooth");
|
||||
}
|
||||
- break;
|
||||
- case 0x05:
|
||||
- switch ((class & 0xc0) >> 6)
|
||||
- {
|
||||
- case 0x01:
|
||||
- return BLUETOOTH_TYPE_KEYBOARD;
|
||||
- case 0x02:
|
||||
- return BLUETOOTH_TYPE_MOUSE;
|
||||
- }
|
||||
- break;
|
||||
- case 0x06:
|
||||
- if (class & 0x80)
|
||||
- return BLUETOOTH_TYPE_PRINTER;
|
||||
- if (class & 0x20)
|
||||
- return BLUETOOTH_TYPE_CAMERA;
|
||||
- break;
|
||||
+ g_hash_table_destroy (hash);
|
||||
+ return name;
|
||||
}
|
||||
|
||||
- return BLUETOOTH_TYPE_ANY;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
-/* Used to detect broken listings from
|
||||
- * old Nokia 3650s */
|
||||
-static gboolean
|
||||
-_is_nokia_3650 (const char *bdaddr)
|
||||
-{
|
||||
- /* Don't ask, Nokia seem to use a Bluetooth
|
||||
- * HCI from Murata */
|
||||
- return g_str_has_prefix(bdaddr, "00:60:57");
|
||||
-}
|
||||
-
|
||||
static gchar *
|
||||
-_get_device_properties (const char *bdaddr, guint32 *type)
|
||||
+_get_device_properties (const char *bdaddr, char **icon_name)
|
||||
{
|
||||
DBusGConnection *connection;
|
||||
DBusGProxy *manager;
|
||||
- gchar *name, **adapters;
|
||||
+ GPtrArray *adapters;
|
||||
+ gchar *name;
|
||||
guint i;
|
||||
|
||||
name = NULL;
|
||||
|
||||
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
|
||||
if (connection == NULL)
|
||||
- return NULL;
|
||||
+ return name;
|
||||
|
||||
manager = dbus_g_proxy_new_for_name (connection, "org.bluez",
|
||||
- "/org/bluez", "org.bluez.Manager");
|
||||
+ "/", "org.bluez.Manager");
|
||||
if (manager == NULL)
|
||||
{
|
||||
dbus_g_connection_unref (connection);
|
||||
- return NULL;
|
||||
+ return name;
|
||||
}
|
||||
|
||||
- if (dbus_g_proxy_call (manager, "ListAdapters", NULL, G_TYPE_INVALID, G_TYPE_STRV, &adapters, G_TYPE_INVALID) == FALSE)
|
||||
+ if (dbus_g_proxy_call (manager, "ListAdapters", NULL, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &adapters, G_TYPE_INVALID) == FALSE)
|
||||
{
|
||||
g_object_unref (manager);
|
||||
dbus_g_connection_unref (connection);
|
||||
- return NULL;
|
||||
+ return name;
|
||||
}
|
||||
|
||||
- for (i = 0; adapters[i] != NULL; i++)
|
||||
+ for (i = 0; i < adapters->len && name == NULL; i++)
|
||||
{
|
||||
DBusGProxy *adapter;
|
||||
+ char *device_path;
|
||||
|
||||
adapter = dbus_g_proxy_new_for_name (connection, "org.bluez",
|
||||
- adapters[i], "org.bluez.Adapter");
|
||||
- if (dbus_g_proxy_call (adapter, "GetRemoteName", NULL,
|
||||
+ g_ptr_array_index (adapters, i), "org.bluez.Adapter");
|
||||
+ if (dbus_g_proxy_call (adapter, "FindDevice", NULL,
|
||||
G_TYPE_STRING, bdaddr, G_TYPE_INVALID,
|
||||
- G_TYPE_STRING, &name, G_TYPE_INVALID) != FALSE)
|
||||
+ DBUS_TYPE_G_OBJECT_PATH, &device_path, G_TYPE_INVALID) != FALSE)
|
||||
{
|
||||
- if (name != NULL && name[0] != '\0')
|
||||
- {
|
||||
- guint32 class;
|
||||
-
|
||||
- if (dbus_g_proxy_call(adapter, "GetRemoteClass", NULL,
|
||||
- G_TYPE_STRING, bdaddr, G_TYPE_INVALID,
|
||||
- G_TYPE_UINT, &class, G_TYPE_INVALID) != FALSE)
|
||||
- {
|
||||
- *type = _get_type_from_class (class);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- *type = BLUETOOTH_TYPE_ANY;
|
||||
- }
|
||||
- g_object_unref (adapter);
|
||||
- break;
|
||||
- }
|
||||
+ DBusGProxy *device;
|
||||
+ device = dbus_g_proxy_new_for_name (connection, "org.bluez", device_path, "org.bluez.Device");
|
||||
+ name = get_name_and_icon (device, icon_name);
|
||||
+ g_object_unref (device);
|
||||
}
|
||||
g_object_unref (adapter);
|
||||
}
|
||||
|
||||
+ g_ptr_array_free (adapters, TRUE);
|
||||
g_object_unref (manager);
|
||||
dbus_g_connection_unref (connection);
|
||||
|
||||
@@ -282,6 +211,7 @@
|
||||
|
||||
g_free (backend->display_name);
|
||||
g_free (backend->bdaddr);
|
||||
+ g_free (backend->icon_name);
|
||||
g_free (backend->files_listing);
|
||||
g_free (backend->directory);
|
||||
|
||||
@@ -312,6 +242,15 @@
|
||||
"org.openobex",
|
||||
"/org/openobex",
|
||||
"org.openobex.Manager");
|
||||
+
|
||||
+ dbus_g_proxy_add_signal(backend->manager_proxy, "SessionConnectError",
|
||||
+ DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
|
||||
+ dbus_g_proxy_connect_signal(backend->manager_proxy, "SessionConnectError",
|
||||
+ G_CALLBACK(session_connect_error_cb), backend, NULL);
|
||||
+ dbus_g_proxy_add_signal(backend->manager_proxy, "SessionConnected",
|
||||
+ DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
|
||||
+ dbus_g_proxy_connect_signal(backend->manager_proxy, "SessionConnected",
|
||||
+ G_CALLBACK(session_connected_cb), backend, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -437,8 +376,7 @@
|
||||
g_file_info_set_file_type (info, G_FILE_TYPE_DIRECTORY);
|
||||
g_file_info_set_content_type (info, "inode/directory");
|
||||
g_file_info_set_name (info, "/");
|
||||
- g_vfs_backend_set_icon_name (backend,
|
||||
- _get_icon_from_type (op_backend->type));
|
||||
+ g_vfs_backend_set_icon_name (backend, op_backend->icon_name);
|
||||
display = g_strdup_printf (_("%s on %s"), "/", op_backend->display_name);
|
||||
g_file_info_set_display_name (info, display);
|
||||
g_free (display);
|
||||
@@ -531,6 +469,37 @@
|
||||
}
|
||||
|
||||
static void
|
||||
+session_connect_error_cb (DBusGProxy *proxy,
|
||||
+ const char *session_object,
|
||||
+ const gchar *error_name,
|
||||
+ const gchar *error_message,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ GVfsBackendObexftp *op_backend = G_VFS_BACKEND_OBEXFTP (user_data);
|
||||
+
|
||||
+ g_mutex_lock (op_backend->mutex);
|
||||
+ op_backend->status = ASYNC_ERROR;
|
||||
+ op_backend->error = g_error_new_literal (DBUS_GERROR,
|
||||
+ DBUS_GERROR_REMOTE_EXCEPTION,
|
||||
+ error_message);
|
||||
+ g_cond_signal (op_backend->cond);
|
||||
+ g_mutex_unlock (op_backend->mutex);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+session_connected_cb (DBusGProxy *proxy,
|
||||
+ const char *session_object,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ GVfsBackendObexftp *op_backend = G_VFS_BACKEND_OBEXFTP (user_data);
|
||||
+
|
||||
+ g_mutex_lock (op_backend->mutex);
|
||||
+ op_backend->status = ASYNC_SUCCESS;
|
||||
+ g_cond_signal (op_backend->cond);
|
||||
+ g_mutex_unlock (op_backend->mutex);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
cancelled_cb (DBusGProxy *proxy, gpointer user_data)
|
||||
{
|
||||
GVfsBackendObexftp *op_backend = G_VFS_BACKEND_OBEXFTP (user_data);
|
||||
@@ -559,24 +528,6 @@
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
-static int
|
||||
-is_connected (DBusGProxy *session_proxy, GVfsJob *job)
|
||||
-{
|
||||
- GError *error = NULL;
|
||||
- gboolean connected;
|
||||
-
|
||||
- if (dbus_g_proxy_call (session_proxy, "IsConnected", &error,
|
||||
- G_TYPE_INVALID,
|
||||
- G_TYPE_BOOLEAN, &connected, G_TYPE_INVALID) == FALSE)
|
||||
- {
|
||||
- g_vfs_job_failed_from_error (job, error);
|
||||
- g_error_free (error);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- return connected;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
do_mount (GVfsBackend *backend,
|
||||
GVfsJobMount *job,
|
||||
@@ -590,7 +541,7 @@
|
||||
const gchar *path = NULL;
|
||||
char *server;
|
||||
GMountSpec *obexftp_mount_spec;
|
||||
- gboolean connected;
|
||||
+ guint count;
|
||||
|
||||
g_print ("+ do_mount\n");
|
||||
|
||||
@@ -616,10 +567,11 @@
|
||||
}
|
||||
|
||||
/* FIXME, Have a way for the mount to be cancelled, see:
|
||||
- * http://bugs.muiline.com/view.php?id=51 */
|
||||
+ * Use CancelSessionConnect */
|
||||
+ op_backend->status = ASYNC_PENDING;
|
||||
|
||||
if (dbus_g_proxy_call (op_backend->manager_proxy, "CreateBluetoothSession", &error,
|
||||
- G_TYPE_STRING, op_backend->bdaddr, G_TYPE_STRING, "ftp", G_TYPE_INVALID,
|
||||
+ G_TYPE_STRING, op_backend->bdaddr, G_TYPE_STRING, "00:00:00:00:00:00", G_TYPE_STRING, "ftp", G_TYPE_INVALID,
|
||||
DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID) == FALSE)
|
||||
{
|
||||
g_free (op_backend->bdaddr);
|
||||
@@ -636,14 +588,13 @@
|
||||
path,
|
||||
"org.openobex.Session");
|
||||
|
||||
- op_backend->display_name = _get_device_properties (op_backend->bdaddr, &op_backend->type);
|
||||
+ op_backend->display_name = _get_device_properties (op_backend->bdaddr, &op_backend->icon_name);
|
||||
if (!op_backend->display_name)
|
||||
op_backend->display_name = g_strdup (op_backend->bdaddr);
|
||||
|
||||
g_vfs_backend_set_display_name (G_VFS_BACKEND (op_backend),
|
||||
op_backend->display_name);
|
||||
- g_vfs_backend_set_icon_name (G_VFS_BACKEND (op_backend),
|
||||
- _get_icon_from_type (op_backend->type));
|
||||
+ g_vfs_backend_set_icon_name (G_VFS_BACKEND (op_backend), op_backend->icon_name);
|
||||
|
||||
obexftp_mount_spec = g_mount_spec_new ("obex");
|
||||
server = g_strdup_printf ("[%s]", op_backend->bdaddr);
|
||||
@@ -676,14 +627,20 @@
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_INVALID);
|
||||
|
||||
/* Now wait until the device is connected */
|
||||
- connected = is_connected (op_backend->session_proxy, G_VFS_JOB (job));
|
||||
- while (connected == FALSE)
|
||||
- {
|
||||
- g_usleep (G_USEC_PER_SEC / 100);
|
||||
- connected = is_connected (op_backend->session_proxy, G_VFS_JOB (job));
|
||||
- }
|
||||
+ count = 0;
|
||||
+ g_mutex_lock (op_backend->mutex);
|
||||
|
||||
- if (connected < 0)
|
||||
+ while (op_backend->status == ASYNC_PENDING && count < 100) {
|
||||
+ GTimeVal val;
|
||||
+ g_get_current_time (&val);
|
||||
+ g_time_val_add (&val, 100000);
|
||||
+ count++;
|
||||
+ if (g_cond_timed_wait (op_backend->cond, op_backend->mutex, &val) != FALSE)
|
||||
+ break;
|
||||
+ }
|
||||
+ g_mutex_unlock (op_backend->mutex);
|
||||
+
|
||||
+ if (op_backend->status == ASYNC_ERROR || op_backend->status == ASYNC_PENDING)
|
||||
{
|
||||
g_message ("mount failed, didn't connect");
|
||||
|
||||
@@ -694,12 +651,17 @@
|
||||
g_object_unref (op_backend->session_proxy);
|
||||
op_backend->session_proxy = NULL;
|
||||
|
||||
- g_vfs_job_failed (G_VFS_JOB (job),
|
||||
- G_IO_ERROR, G_IO_ERROR_BUSY,
|
||||
- _("Connection to the device lost"));
|
||||
+ if (op_backend->status != ASYNC_PENDING)
|
||||
+ g_vfs_job_failed_from_error (G_VFS_JOB (job), op_backend->error);
|
||||
+ else
|
||||
+ g_vfs_job_failed (G_VFS_JOB (job),
|
||||
+ G_IO_ERROR, G_IO_ERROR_BUSY,
|
||||
+ _("Connection to the device lost"));
|
||||
return;
|
||||
}
|
||||
|
||||
+ op_backend->status = ASYNC_PENDING;
|
||||
+
|
||||
g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
|
||||
g_print ("- do_mount\n");
|
||||
@@ -1482,6 +1444,12 @@
|
||||
/* TransferStarted */
|
||||
dbus_g_object_register_marshaller(obexftp_marshal_VOID__STRING_STRING_UINT64,
|
||||
G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_INVALID);
|
||||
+ /* SessionConnected */
|
||||
+ dbus_g_object_register_marshaller(obexftp_marshal_VOID__STRING,
|
||||
+ G_TYPE_NONE, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
|
||||
+ /* SessionConnectError */
|
||||
+ dbus_g_object_register_marshaller (obexftp_marshal_VOID__STRING_STRING_STRING,
|
||||
+ G_TYPE_NONE, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
|
||||
}
|
||||
|
||||
/*
|
@ -1,670 +0,0 @@
|
||||
Index: daemon/gvfsbackendnetwork.c
|
||||
===================================================================
|
||||
--- daemon/gvfsbackendnetwork.c (revision 2118)
|
||||
+++ daemon/gvfsbackendnetwork.c (working copy)
|
||||
@@ -76,6 +76,8 @@
|
||||
gboolean have_smb;
|
||||
char *current_workgroup;
|
||||
GFileMonitor *smb_monitor;
|
||||
+ GMutex *smb_mount_lock;
|
||||
+ GVfsJobMount *mount_job;
|
||||
|
||||
/* DNS-SD Stuff */
|
||||
gboolean have_dnssd;
|
||||
@@ -270,7 +272,7 @@
|
||||
files = g_list_prepend (files, file);
|
||||
|
||||
if (backend->current_workgroup == NULL ||
|
||||
- backend->current_workgroup[0] == 0)
|
||||
+ backend->current_workgroup[0] == 0)
|
||||
workgroup = g_strconcat ("smb://", DEFAULT_WORKGROUP_NAME, "/", NULL);
|
||||
else
|
||||
workgroup = g_strconcat ("smb://", backend->current_workgroup, "/", NULL);
|
||||
@@ -292,10 +294,9 @@
|
||||
{
|
||||
char *uri = g_file_get_uri (server_file);
|
||||
g_warning ("Couldn't create directory monitor on %s. Error: %s",
|
||||
- uri, error->message);
|
||||
+ uri, error->message);
|
||||
g_free (uri);
|
||||
- g_error_free (error);
|
||||
- error = NULL;
|
||||
+ g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +304,8 @@
|
||||
enumer = g_file_enumerate_children (server_file,
|
||||
NETWORK_FILE_ATTRIBUTES,
|
||||
G_FILE_QUERY_INFO_NONE,
|
||||
- NULL, NULL);
|
||||
+ NULL, &error);
|
||||
+
|
||||
if (enumer != NULL)
|
||||
{
|
||||
info = g_file_enumerator_next_file (enumer, NULL, NULL);
|
||||
@@ -322,10 +324,13 @@
|
||||
g_object_unref (info);
|
||||
info = g_file_enumerator_next_file (enumer, NULL, NULL);
|
||||
}
|
||||
+ g_file_enumerator_close (enumer, NULL, NULL);
|
||||
+ g_object_unref (enumer);
|
||||
}
|
||||
+
|
||||
+ if (error)
|
||||
+ g_error_free (error);
|
||||
|
||||
- g_file_enumerator_close (enumer, NULL, NULL);
|
||||
- g_object_unref (enumer);
|
||||
g_object_unref (server_file);
|
||||
|
||||
g_free (workgroup);
|
||||
@@ -434,10 +439,61 @@
|
||||
}
|
||||
|
||||
static void
|
||||
+mount_smb_done_cb (GObject *object,
|
||||
+ GAsyncResult *res,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ GVfsBackendNetwork *backend = G_VFS_BACKEND_NETWORK(user_data);
|
||||
+ GError *error = NULL;
|
||||
+
|
||||
+ g_file_mount_enclosing_volume_finish (G_FILE (object), res, &error);
|
||||
+
|
||||
+ if (error)
|
||||
+ g_error_free (error);
|
||||
+
|
||||
+ recompute_files (backend);
|
||||
+
|
||||
+ /* We've been spawned from try_mount */
|
||||
+ if (backend->mount_job)
|
||||
+ {
|
||||
+ g_vfs_job_succeeded (G_VFS_JOB (backend->mount_job));
|
||||
+ g_object_unref (backend->mount_job);
|
||||
+ }
|
||||
+ g_mutex_unlock (backend->smb_mount_lock);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+remount_smb (GVfsBackendNetwork *backend, GVfsJobMount *job)
|
||||
+{
|
||||
+ GFile *file;
|
||||
+ char *workgroup;
|
||||
+
|
||||
+ if (! g_mutex_trylock (backend->smb_mount_lock))
|
||||
+ /* Do nothing when the mount operation is already active */
|
||||
+ return;
|
||||
+
|
||||
+ backend->mount_job = job ? g_object_ref (job) : NULL;
|
||||
+
|
||||
+ if (backend->current_workgroup == NULL ||
|
||||
+ backend->current_workgroup[0] == 0)
|
||||
+ workgroup = g_strconcat ("smb://", DEFAULT_WORKGROUP_NAME, "/", NULL);
|
||||
+ else
|
||||
+ workgroup = g_strconcat ("smb://", backend->current_workgroup, "/", NULL);
|
||||
+
|
||||
+ file = g_file_new_for_uri (workgroup);
|
||||
+
|
||||
+ g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE,
|
||||
+ NULL, NULL, mount_smb_done_cb, backend);
|
||||
+ g_free (workgroup);
|
||||
+ g_object_unref (file);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
notify_smb_files_changed (GFileMonitor *monitor, GFile *file, GFile *other_file,
|
||||
GFileMonitorEvent event_type, gpointer user_data)
|
||||
{
|
||||
GVfsBackendNetwork *backend = G_VFS_BACKEND_NETWORK(user_data);
|
||||
+
|
||||
switch (event_type)
|
||||
{
|
||||
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
|
||||
@@ -453,9 +509,12 @@
|
||||
backend->idle_tag = g_idle_add ((GSourceFunc)idle_add_recompute, backend);
|
||||
|
||||
/* stop monitoring as the backend's gone. */
|
||||
- g_file_monitor_cancel (backend->smb_monitor);
|
||||
- g_object_unref (backend->smb_monitor);
|
||||
- backend->smb_monitor = NULL;
|
||||
+ if (backend->smb_monitor)
|
||||
+ {
|
||||
+ g_file_monitor_cancel (backend->smb_monitor);
|
||||
+ g_object_unref (backend->smb_monitor);
|
||||
+ backend->smb_monitor = NULL;
|
||||
+ }
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -545,16 +604,17 @@
|
||||
backend->current_workgroup = current_workgroup;
|
||||
|
||||
/* cancel the smb monitor */
|
||||
- g_signal_handlers_disconnect_by_func (backend->smb_monitor,
|
||||
- notify_smb_files_changed,
|
||||
- backend->smb_monitor);
|
||||
- g_file_monitor_cancel (backend->smb_monitor);
|
||||
- g_object_unref (backend->smb_monitor);
|
||||
- backend->smb_monitor = NULL;
|
||||
+ if (backend->smb_monitor)
|
||||
+ {
|
||||
+ g_signal_handlers_disconnect_by_func (backend->smb_monitor,
|
||||
+ notify_smb_files_changed,
|
||||
+ backend->smb_monitor);
|
||||
+ g_file_monitor_cancel (backend->smb_monitor);
|
||||
+ g_object_unref (backend->smb_monitor);
|
||||
+ backend->smb_monitor = NULL;
|
||||
+ }
|
||||
|
||||
- /* don't re-issue recomputes if we've already queued one. */
|
||||
- if (backend->idle_tag == 0)
|
||||
- backend->idle_tag = g_idle_add ((GSourceFunc)idle_add_recompute, backend);
|
||||
+ remount_smb (backend, NULL);
|
||||
}
|
||||
|
||||
static NetworkFile *
|
||||
@@ -692,6 +752,7 @@
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+
|
||||
static gboolean
|
||||
try_mount (GVfsBackend *backend,
|
||||
GVfsJobMount *job,
|
||||
@@ -700,10 +761,19 @@
|
||||
gboolean is_automount)
|
||||
{
|
||||
GVfsBackendNetwork *network_backend = G_VFS_BACKEND_NETWORK (backend);
|
||||
+
|
||||
network_backend->root_monitor = g_vfs_monitor_new (backend);
|
||||
- recompute_files (network_backend);
|
||||
- g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
|
||||
+ if (network_backend->have_smb)
|
||||
+ {
|
||||
+ remount_smb (network_backend, job);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ recompute_files (network_backend);
|
||||
+ g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
+ }
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -749,6 +819,8 @@
|
||||
const char * const* supported_vfs;
|
||||
int i;
|
||||
|
||||
+ network_backend->smb_mount_lock = g_mutex_new ();
|
||||
+
|
||||
supported_vfs = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
|
||||
|
||||
network_backend->have_smb = FALSE;
|
||||
@@ -830,6 +902,7 @@
|
||||
GVfsBackendNetwork *backend;
|
||||
backend = G_VFS_BACKEND_NETWORK (object);
|
||||
|
||||
+ g_mutex_free (backend->smb_mount_lock);
|
||||
g_mount_spec_unref (backend->mount_spec);
|
||||
g_object_unref (backend->root_monitor);
|
||||
g_object_unref (backend->workgroup_icon);
|
||||
Index: daemon/smb-browse.mount.in
|
||||
===================================================================
|
||||
--- daemon/smb-browse.mount.in (revision 2118)
|
||||
+++ daemon/smb-browse.mount.in (working copy)
|
||||
@@ -2,5 +2,5 @@
|
||||
Type=smb-network;smb-server
|
||||
Exec=@libexecdir@/gvfsd-smb-browse
|
||||
DBusName=org.gtk.vfs.mountpoint.smb_browse
|
||||
-AutoMount=true
|
||||
+AutoMount=false
|
||||
Scheme=smb
|
||||
Index: daemon/gvfsbackendsmbbrowse.c
|
||||
===================================================================
|
||||
--- daemon/gvfsbackendsmbbrowse.c (revision 2118)
|
||||
+++ daemon/gvfsbackendsmbbrowse.c (working copy)
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#include <glib/gstdio.h>
|
||||
#include <glib/gi18n.h>
|
||||
@@ -41,6 +42,7 @@
|
||||
#include "gvfsjobqueryinfo.h"
|
||||
#include "gvfsjobenumerate.h"
|
||||
#include "gvfsdaemonprotocol.h"
|
||||
+#include "gvfskeyring.h"
|
||||
#include "gmounttracker.h"
|
||||
|
||||
#include <libsmbclient.h>
|
||||
@@ -56,6 +58,10 @@
|
||||
/* The magic "default workgroup" hostname */
|
||||
#define DEFAULT_WORKGROUP_NAME "X-GNOME-DEFAULT-WORKGROUP"
|
||||
|
||||
+/* Time in seconds before we mark dirents cache outdated */
|
||||
+#define DEFAULT_CACHE_EXPIRATION_TIME 10
|
||||
+
|
||||
+
|
||||
typedef struct {
|
||||
unsigned int smbc_type;
|
||||
char *name;
|
||||
@@ -74,7 +80,20 @@
|
||||
char *mounted_server; /* server or DEFAULT_WORKGROUP_NAME */
|
||||
SMBCCTX *smb_context;
|
||||
|
||||
+ char *last_user;
|
||||
+ char *last_domain;
|
||||
+ char *last_password;
|
||||
+
|
||||
+ GMountSource *mount_source;
|
||||
+ int mount_try;
|
||||
+ gboolean mount_try_again;
|
||||
+ gboolean mount_cancelled;
|
||||
+
|
||||
+ gboolean password_in_keyring;
|
||||
+ GPasswordSave password_save;
|
||||
+
|
||||
GMutex *entries_lock;
|
||||
+ GMutex *update_cache_lock;
|
||||
time_t last_entry_update;
|
||||
GList *entries;
|
||||
int entry_errno;
|
||||
@@ -206,6 +225,7 @@
|
||||
g_free (backend->server);
|
||||
|
||||
g_mutex_free (backend->entries_lock);
|
||||
+ g_mutex_free (backend->update_cache_lock);
|
||||
|
||||
smbc_free_context (backend->smb_context, TRUE);
|
||||
|
||||
@@ -220,6 +240,7 @@
|
||||
g_vfs_backend_smb_browse_init (GVfsBackendSmbBrowse *backend)
|
||||
{
|
||||
backend->entries_lock = g_mutex_new ();
|
||||
+ backend->update_cache_lock = g_mutex_new ();
|
||||
|
||||
if (mount_tracker == NULL)
|
||||
mount_tracker = g_mount_tracker_new (NULL);
|
||||
@@ -256,14 +277,121 @@
|
||||
char *password_out, int pwmaxlen)
|
||||
{
|
||||
GVfsBackendSmbBrowse *backend;
|
||||
+ char *ask_password, *ask_user, *ask_domain;
|
||||
+ gboolean handled, abort;
|
||||
|
||||
backend = smbc_getOptionUserData (context);
|
||||
|
||||
+ strncpy (password_out, "", pwmaxlen);
|
||||
+
|
||||
if (backend->domain)
|
||||
strncpy (domain_out, backend->domain, domainmaxlen);
|
||||
if (backend->user)
|
||||
strncpy (username_out, backend->user, unmaxlen);
|
||||
- strncpy (password_out, "", pwmaxlen);
|
||||
+
|
||||
+ if (backend->mount_cancelled)
|
||||
+ {
|
||||
+ /* Don't prompt for credentials, let smbclient finish the mount loop */
|
||||
+ strncpy (username_out, "ABORT", unmaxlen);
|
||||
+ strncpy (password_out, "", pwmaxlen);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (backend->mount_source == NULL)
|
||||
+ {
|
||||
+ /* Not during mount, use last password */
|
||||
+ if (backend->last_user)
|
||||
+ strncpy (username_out, backend->last_user, unmaxlen);
|
||||
+ if (backend->last_domain)
|
||||
+ strncpy (domain_out, backend->last_domain, domainmaxlen);
|
||||
+ if (backend->last_password)
|
||||
+ strncpy (password_out, backend->last_password, pwmaxlen);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (backend->mount_try == 0 &&
|
||||
+ backend->user == NULL &&
|
||||
+ backend->domain == NULL)
|
||||
+ {
|
||||
+ /* Try again if kerberos login + anonymous fallback fails */
|
||||
+ backend->mount_try_again = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gboolean in_keyring = FALSE;
|
||||
+
|
||||
+ if (!backend->password_in_keyring)
|
||||
+ {
|
||||
+ in_keyring = g_vfs_keyring_lookup_password (backend->user,
|
||||
+ backend->server,
|
||||
+ backend->domain,
|
||||
+ "smb",
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ 0,
|
||||
+ &ask_user,
|
||||
+ &ask_domain,
|
||||
+ &ask_password);
|
||||
+ backend->password_in_keyring = in_keyring;
|
||||
+ }
|
||||
+
|
||||
+ if (!in_keyring)
|
||||
+ {
|
||||
+ GAskPasswordFlags flags = G_ASK_PASSWORD_NEED_PASSWORD;
|
||||
+ char *message;
|
||||
+
|
||||
+ if (g_vfs_keyring_is_available ())
|
||||
+ flags |= G_ASK_PASSWORD_SAVING_SUPPORTED;
|
||||
+ if (backend->domain == NULL)
|
||||
+ flags |= G_ASK_PASSWORD_NEED_DOMAIN;
|
||||
+ if (backend->user == NULL)
|
||||
+ flags |= G_ASK_PASSWORD_NEED_USERNAME;
|
||||
+
|
||||
+ /* translators: %s is a server name */
|
||||
+ message = g_strdup_printf (_("Password required for %s"),
|
||||
+ server_name);
|
||||
+ handled = g_mount_source_ask_password (backend->mount_source,
|
||||
+ message,
|
||||
+ username_out,
|
||||
+ domain_out,
|
||||
+ flags,
|
||||
+ &abort,
|
||||
+ &ask_password,
|
||||
+ &ask_user,
|
||||
+ &ask_domain,
|
||||
+ NULL,
|
||||
+ &(backend->password_save));
|
||||
+ g_free (message);
|
||||
+ if (!handled)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (abort)
|
||||
+ {
|
||||
+ strncpy (username_out, "ABORT", unmaxlen);
|
||||
+ strncpy (password_out, "", pwmaxlen);
|
||||
+ backend->mount_cancelled = TRUE;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Try again if this fails */
|
||||
+ backend->mount_try_again = TRUE;
|
||||
+
|
||||
+ strncpy (password_out, ask_password, pwmaxlen);
|
||||
+ if (ask_user && *ask_user)
|
||||
+ strncpy (username_out, ask_user, unmaxlen);
|
||||
+ if (ask_domain && *ask_domain)
|
||||
+ strncpy (domain_out, ask_domain, domainmaxlen);
|
||||
+
|
||||
+ out:
|
||||
+ g_free (ask_password);
|
||||
+ g_free (ask_user);
|
||||
+ g_free (ask_domain);
|
||||
+ }
|
||||
+
|
||||
+ backend->last_user = g_strdup (username_out);
|
||||
+ backend->last_domain = g_strdup (domain_out);
|
||||
+ backend->last_password = g_strdup (password_out);
|
||||
}
|
||||
|
||||
/* Add a server to the cache system
|
||||
@@ -419,8 +547,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
-static void
|
||||
-update_cache (GVfsBackendSmbBrowse *backend)
|
||||
+static gboolean
|
||||
+update_cache (GVfsBackendSmbBrowse *backend, SMBCFILE *supplied_dir)
|
||||
{
|
||||
GString *uri;
|
||||
char dirents[1024*4];
|
||||
@@ -436,6 +564,9 @@
|
||||
|
||||
entries = NULL;
|
||||
entry_errno = 0;
|
||||
+ res = -1;
|
||||
+
|
||||
+ g_mutex_lock (backend->update_cache_lock);
|
||||
|
||||
/* Update Cache */
|
||||
uri = g_string_new ("smb://");
|
||||
@@ -450,7 +581,7 @@
|
||||
smbc_getdents = smbc_getFunctionGetdents (backend->smb_context);
|
||||
smbc_closedir = smbc_getFunctionClosedir (backend->smb_context);
|
||||
|
||||
- dir = smbc_opendir (backend->smb_context, uri->str);
|
||||
+ dir = supplied_dir ? supplied_dir : smbc_opendir (backend->smb_context, uri->str);
|
||||
g_string_free (uri, TRUE);
|
||||
if (dir == NULL)
|
||||
{
|
||||
@@ -494,10 +625,11 @@
|
||||
|
||||
entries = g_list_reverse (entries);
|
||||
}
|
||||
-
|
||||
- smbc_closedir (backend->smb_context, dir);
|
||||
|
||||
+ if (! supplied_dir)
|
||||
+ smbc_closedir (backend->smb_context, dir);
|
||||
|
||||
+
|
||||
out:
|
||||
|
||||
g_mutex_lock (backend->entries_lock);
|
||||
@@ -510,7 +642,9 @@
|
||||
backend->last_entry_update = time (NULL);
|
||||
|
||||
g_mutex_unlock (backend->entries_lock);
|
||||
-
|
||||
+ g_mutex_unlock (backend->update_cache_lock);
|
||||
+
|
||||
+ return (res >= 0);
|
||||
}
|
||||
|
||||
static BrowseEntry *
|
||||
@@ -620,10 +754,17 @@
|
||||
static gboolean
|
||||
cache_needs_updating (GVfsBackendSmbBrowse *backend)
|
||||
{
|
||||
- time_t now = time (NULL);
|
||||
+ time_t now;
|
||||
+ gboolean res;
|
||||
+
|
||||
+ /* If there's already cache update in progress, lock and wait until update is finished, then recheck */
|
||||
+ g_mutex_lock (backend->update_cache_lock);
|
||||
+ now = time (NULL);
|
||||
+ res = now < backend->last_entry_update ||
|
||||
+ (now - backend->last_entry_update) > DEFAULT_CACHE_EXPIRATION_TIME;
|
||||
+ g_mutex_unlock (backend->update_cache_lock);
|
||||
|
||||
- return now < backend->last_entry_update ||
|
||||
- (now - backend->last_entry_update) > 10;
|
||||
+ return res;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -635,10 +776,17 @@
|
||||
{
|
||||
GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend);
|
||||
SMBCCTX *smb_context;
|
||||
+ SMBCFILE *dir;
|
||||
char *display_name;
|
||||
+ const char *debug;
|
||||
+ int debug_val;
|
||||
char *icon;
|
||||
+ GString *uri;
|
||||
+ gboolean res;
|
||||
GMountSpec *browse_mount_spec;
|
||||
-
|
||||
+ smbc_opendir_fn smbc_opendir;
|
||||
+ smbc_closedir_fn smbc_closedir;
|
||||
+
|
||||
smb_context = smbc_new_context ();
|
||||
if (smb_context == NULL)
|
||||
{
|
||||
@@ -650,7 +798,13 @@
|
||||
|
||||
smbc_setOptionUserData (smb_context, backend);
|
||||
|
||||
- smbc_setDebug (smb_context, 0);
|
||||
+ debug = g_getenv ("GVFS_SMB_DEBUG");
|
||||
+ if (debug)
|
||||
+ debug_val = atoi (debug);
|
||||
+ else
|
||||
+ debug_val = 0;
|
||||
+
|
||||
+ smbc_setDebug (smb_context, debug_val);
|
||||
smbc_setFunctionAuthDataWithContext (smb_context, auth_callback);
|
||||
|
||||
smbc_setFunctionAddCachedServer (smb_context, add_cached_server);
|
||||
@@ -666,10 +820,13 @@
|
||||
smb_context->flags = 0;
|
||||
#endif
|
||||
|
||||
+ /* Initial settings:
|
||||
+ * - use Kerberos (always)
|
||||
+ * - in case of no username specified, try anonymous login
|
||||
+ */
|
||||
smbc_setOptionUseKerberos (smb_context, 1);
|
||||
- smbc_setOptionFallbackAfterKerberos (smb_context, 1);
|
||||
- //smbc_setOptionNoAutoAnonymousLogin (smb_context, 1);
|
||||
-
|
||||
+ smbc_setOptionFallbackAfterKerberos (smb_context, op_backend->user != NULL);
|
||||
+ smbc_setOptionNoAutoAnonymousLogin (smb_context, op_backend->user != NULL);
|
||||
|
||||
#if 0
|
||||
smbc_setOptionDebugToStderr (smb_context, 1);
|
||||
@@ -723,6 +880,88 @@
|
||||
g_vfs_backend_set_mount_spec (backend, browse_mount_spec);
|
||||
g_mount_spec_unref (browse_mount_spec);
|
||||
|
||||
+ op_backend->mount_source = mount_source;
|
||||
+ op_backend->mount_try = 0;
|
||||
+ op_backend->password_save = G_PASSWORD_SAVE_NEVER;
|
||||
+
|
||||
+ smbc_opendir = smbc_getFunctionOpendir (smb_context);
|
||||
+ smbc_closedir = smbc_getFunctionClosedir (smb_context);
|
||||
+
|
||||
+ uri = g_string_new ("smb://");
|
||||
+
|
||||
+ if (op_backend->server)
|
||||
+ {
|
||||
+ g_string_append_encoded (uri, op_backend->server, NULL, NULL);
|
||||
+ g_string_append_c (uri, '/');
|
||||
+ }
|
||||
+
|
||||
+ do
|
||||
+ {
|
||||
+ op_backend->mount_try_again = FALSE;
|
||||
+ op_backend->mount_cancelled = FALSE;
|
||||
+
|
||||
+ dir = smbc_opendir (smb_context, uri->str);
|
||||
+
|
||||
+ if (dir == NULL &&
|
||||
+ (op_backend->mount_cancelled || (errno != EPERM && errno != EACCES)))
|
||||
+ break;
|
||||
+
|
||||
+ if (dir != NULL)
|
||||
+ {
|
||||
+ /* Let update_cache() do enumeration, check for the smbc_getdents() result */
|
||||
+ res = update_cache (op_backend, dir);
|
||||
+ smbc_closedir (smb_context, dir);
|
||||
+ if (res)
|
||||
+ break;
|
||||
+ }
|
||||
+ else {
|
||||
+ /* Purge the cache, we need to have clean playground for next auth try */
|
||||
+ purge_cached (smb_context);
|
||||
+ }
|
||||
+
|
||||
+ /* The first round is Kerberos-only. Only if this fails do we enable
|
||||
+ * NTLMSSP fallback (turning off anonymous fallback, which we've
|
||||
+ * already tried and failed with).
|
||||
+ */
|
||||
+ if (op_backend->mount_try == 0)
|
||||
+ {
|
||||
+ smbc_setOptionFallbackAfterKerberos (op_backend->smb_context, 1);
|
||||
+ smbc_setOptionNoAutoAnonymousLogin (op_backend->smb_context, 1);
|
||||
+ }
|
||||
+ op_backend->mount_try++;
|
||||
+ }
|
||||
+ while (op_backend->mount_try_again);
|
||||
+
|
||||
+ g_string_free (uri, TRUE);
|
||||
+
|
||||
+ op_backend->mount_source = NULL;
|
||||
+
|
||||
+ if (dir == NULL)
|
||||
+ {
|
||||
+ if (op_backend->mount_cancelled)
|
||||
+ g_vfs_job_failed (G_VFS_JOB (job),
|
||||
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
|
||||
+ _("Password dialog cancelled"));
|
||||
+ else
|
||||
+ /* TODO: Error from errno? */
|
||||
+ g_vfs_job_failed (G_VFS_JOB (job),
|
||||
+ G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
+ /* translators: We tried to mount a windows (samba) share, but failed */
|
||||
+ _("Failed to retrieve share list from server"));
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ g_vfs_keyring_save_password (op_backend->last_user,
|
||||
+ op_backend->server,
|
||||
+ op_backend->last_domain,
|
||||
+ "smb",
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ 0,
|
||||
+ op_backend->last_password,
|
||||
+ op_backend->password_save);
|
||||
+
|
||||
g_vfs_job_succeeded (G_VFS_JOB (job));
|
||||
}
|
||||
|
||||
@@ -822,7 +1061,7 @@
|
||||
{
|
||||
GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend);
|
||||
|
||||
- update_cache (op_backend);
|
||||
+ update_cache (op_backend, NULL);
|
||||
|
||||
run_mount_mountable (op_backend,
|
||||
job,
|
||||
@@ -878,7 +1117,7 @@
|
||||
{
|
||||
GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend);
|
||||
|
||||
- update_cache (op_backend);
|
||||
+ update_cache (op_backend, NULL);
|
||||
|
||||
run_open_for_read (op_backend, job, filename);
|
||||
}
|
||||
@@ -1052,7 +1291,7 @@
|
||||
{
|
||||
GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend);
|
||||
|
||||
- update_cache (op_backend);
|
||||
+ update_cache (op_backend, NULL);
|
||||
|
||||
run_query_info (op_backend, job, filename, info, matcher);
|
||||
}
|
||||
@@ -1145,9 +1384,9 @@
|
||||
GFileQueryInfoFlags flags)
|
||||
{
|
||||
GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend);
|
||||
-
|
||||
- update_cache (op_backend);
|
||||
|
||||
+ update_cache (op_backend, NULL);
|
||||
+
|
||||
run_enumerate (op_backend, job, filename, matcher);
|
||||
}
|
||||
|
87
gvfs.changes
87
gvfs.changes
@ -1,3 +1,35 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 3 08:24:38 EST 2009 - mboman@suse.de
|
||||
|
||||
- Update to version 1.1.5:
|
||||
+ network: Pick up SMB shares from zeroconf
|
||||
+ obexftp: Write support for
|
||||
+ obexftp: Support obexftp over usb
|
||||
+ trash: Don't follow symlinks on delete
|
||||
+ fix crashes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 1 19:47:13 EST 2009 - mboman@suse.de
|
||||
|
||||
- Update to version 1.1.4:
|
||||
+ Trash performance fixes
|
||||
+ Fuse performance fixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 29 12:59:36 CET 2009 - vuntz@novell.com
|
||||
|
||||
- Disable gvfs-nds.patch for now, since it needs to be reworked to
|
||||
actually compile.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 23 10:19:55 CET 2009 - vuntz@novell.com
|
||||
|
||||
- Merge packages from GNOME:Factory:Next and openSUSE:Factory.
|
||||
- Rename gvfs-novell-nautilus-plugin-filesystem.patch to
|
||||
gvfs-nvvfs.patch
|
||||
- Integrate gvfs-nds-no-vfs-init.patch in gvfsd-nds.patch, and
|
||||
rename gvfsd-nds.patch to gvfs-nds.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 16 20:09:06 CET 2009 - ksamrat@novell.com
|
||||
|
||||
@ -11,11 +43,66 @@ Thu Jan 15 07:55:22 CET 2009 - ksamrat@novell.com
|
||||
- Provide the Nautilus backend for NDS and Novell File system browsing
|
||||
- Solves bugs bnc#420155 , bnc#449396
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 09 01:04:01 CET 2009 - mboman@suse.de
|
||||
|
||||
- Remove gvfs-smb-browse-auth.patch. Fixed upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 8 01:04:01 CET 2009 - hpj@novell.com
|
||||
|
||||
- Added gvfs-429959-handle-blank-schemas.patch (bnc#429959).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 7 11:57:20 EST 2009 - mboman@suse.de
|
||||
|
||||
- Update to version 1.1.3:
|
||||
+ ftp: fix limited number of connections causes commands to fail
|
||||
(bgo#565504)
|
||||
+ trash: fix parallel build doesn't work (bgo#562955)
|
||||
+ trash: add trash::orig-path and trash::deletion-date info
|
||||
+ trash: set files to mode 700 before deleting to deal with users
|
||||
trashing read-only directories
|
||||
+ smb-browse: browsing authentication support (bgo#524485)
|
||||
+ smb-browse: make backend not automounted anymore
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Dec 20 11:14:02 EST 2008 - mboman@suse.de
|
||||
|
||||
- Update to version 1.1.2:
|
||||
+ New trash backend
|
||||
+ Use the new shadow mount facility in gio
|
||||
+ gphoto2: Use shadow mounts
|
||||
+ obex: Fix icon for root directory
|
||||
+ http: Fix major memory leak
|
||||
+ http: Support proxies
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Dec 14 19:04:33 EST 2008 - mboman@suse.de
|
||||
|
||||
- Update to version 1.1.1:
|
||||
+ Reverse map FUSE pathnames to gvfs locations
|
||||
+ Fix crashes
|
||||
+ Show better icon info in gvfs-info
|
||||
+ Support custom icons for gvfs backends
|
||||
+ dav: support uris (dav+sd://) which specify dns-sd services instead of
|
||||
resolved ip+port
|
||||
+ ftp: Fix time parsing
|
||||
+ ftp: Show username in auth dialog if specified in uri
|
||||
+ ftp: Support UTF8 server feature
|
||||
+ ftp: Use LIST -a instead of LIST on unix servers
|
||||
+ fuse: Fix major race in that caused crashes
|
||||
+ fuse: Set st_blocks so that e.g. the "du" command works
|
||||
+ gphoto: use custom icons for faster thumbnails
|
||||
+ obexftp: Port to bluez 4 API
|
||||
+ sftp: If name specified in mount, use in name too so that fuse paths
|
||||
are unique
|
||||
+ sftp: Support /etc/favicon.png
|
||||
+ smb: Don't ask for password twice if cancelled
|
||||
+ smb: support setting timestamp
|
||||
- Remove gvfs-obexftp-updated-apis-3.patch. Fixed upstream
|
||||
- Add gvfs-enable-deprecated.patch (bgo#564464)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 4 20:12:13 CST 2008 - hpj@novell.com
|
||||
|
||||
|
129
gvfs.spec
129
gvfs.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package gvfs (Version 1.0.2)
|
||||
# spec file for package gvfs (Version 1.1.5)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
Name: gvfs
|
||||
BuildRequires: bluez-devel
|
||||
BuildRequires: dbus-1-glib-devel
|
||||
BuildRequires: fuse-devel
|
||||
BuildRequires: gconf2-devel
|
||||
BuildRequires: glib2-devel
|
||||
@ -30,22 +31,13 @@ BuildRequires: libarchive-devel
|
||||
BuildRequires: libavahi-glib-devel
|
||||
BuildRequires: libcdio-devel
|
||||
BuildRequires: libexpat-devel
|
||||
BuildRequires: libgphoto2-devel
|
||||
BuildRequires: libsmbclient-devel
|
||||
BuildRequires: libsoup-devel
|
||||
BuildRequires: pkg-config
|
||||
%if %suse_version > 1010
|
||||
BuildRequires: libgphoto2-devel
|
||||
%else
|
||||
BuildRequires: libgphoto2
|
||||
%endif
|
||||
%if %suse_version <= 1020
|
||||
%define _prefix /opt/gnome
|
||||
%define _sysconfdir /etc/%_prefix
|
||||
BuildRequires: extra-rpm-macros
|
||||
%endif
|
||||
Summary: VFS functionality for GLib
|
||||
Version: 1.0.2
|
||||
Release: 5
|
||||
Version: 1.1.5
|
||||
Release: 1
|
||||
License: LGPL v2.0 or later
|
||||
Group: Development/Libraries/C and C++
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
@ -53,18 +45,12 @@ Source0: %{name}-%{version}.tar.bz2
|
||||
Patch0: gvfs-no-shebang.patch
|
||||
# PATCH-FEATURE-OPENSUSE gvfs-dice-backend.patch hpj@suse.de -- Implements Novell IceDesktop backend. Should be upstreamed eventually.
|
||||
Patch1: gvfs-dice-backend.patch
|
||||
# PATCH-FIX-UPSTREAM gvfs-obexftp-update-apis-3.patch jpr@suse.de - Support for bluez 4.x from Fedora
|
||||
Patch2: gvfs-obexftp-updated-apis-3.patch
|
||||
# PATCH-FIX-UPSTREAM gvfs-smb-browse-auth.patch bgo524485 bnc437780 hpj@suse.de -- Support AD browsing correctly.
|
||||
Patch3: gvfs-smb-browse-auth.patch
|
||||
# PATCH-FIX-UPSTREAM gvfs-429959-handle-blank-schemas.patch bnc429959 hpj@suse.de -- Fix URI handler lookup with blank schemas.
|
||||
Patch4: gvfs-429959-handle-blank-schemas.patch
|
||||
# PATCH-FEATURE-OPENSUSE gvfs-novell-nautilus-plugin-filesystem.patch ksamrat@novell.com -- Provides gvfs backend for novell nautilus plugin
|
||||
Patch5: gvfs-novell-nautilus-plugin-filesystem.patch
|
||||
# PATCH-FEATURE-OPENSUSE gvfsd-nds.patch ksamrat@novell.com -- Provides NDS browsing for nautilus
|
||||
Patch6: gvfsd-nds.patch
|
||||
# PATCH-FEATURE-OPENSUSE gvfs-nds-no-vfs-init.patch ksamrat@novell.com -- Avoid vfs initialize issues
|
||||
Patch7: gvfs-nds-no-vfs-init.patch
|
||||
# PATCH-FEATURE-OPENSUSE gvfs-nvvfs.patch ksamrat@novell.com -- Provides gvfs backend for novell nautilus plugin
|
||||
Patch5: gvfs-nvvfs.patch
|
||||
# PATCH-NEEDS-REBASE gvfs-nds.patch ksamrat@novell.com -- Provides NDS browsing for nautilus (was PATCH-FEATURE-OPENSUSE)
|
||||
Patch6: gvfs-nds.patch
|
||||
Url: http://www.gnome.org
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
AutoReqProv: on
|
||||
@ -151,19 +137,17 @@ Authors:
|
||||
%setup -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2
|
||||
%patch3 -p0
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
#%patch6 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
|
||||
autoreconf -f
|
||||
libtoolize -c -f
|
||||
%configure \
|
||||
--libexecdir=%{_libdir}/%{name}
|
||||
--libexecdir=%{_libdir}/%{name} \
|
||||
--disable-static
|
||||
%__make
|
||||
|
||||
%install
|
||||
@ -219,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/%{name}/gvfsd-smb-browse
|
||||
%{_libdir}/%{name}/gvfsd-trash
|
||||
%{_libdir}/%{name}/gvfsd-nvvfs
|
||||
%{_libdir}/%{name}/gvfsd-nds
|
||||
#%{_libdir}/%{name}/gvfsd-nds
|
||||
|
||||
%files -n libgvfscommon0
|
||||
%defattr(-, root, root)
|
||||
@ -233,6 +217,26 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files lang -f %{name}.lang
|
||||
|
||||
%changelog
|
||||
* Tue Feb 03 2009 mboman@suse.de
|
||||
- Update to version 1.1.5:
|
||||
+ network: Pick up SMB shares from zeroconf
|
||||
+ obexftp: Write support for
|
||||
+ obexftp: Support obexftp over usb
|
||||
+ trash: Don't follow symlinks on delete
|
||||
+ fix crashes
|
||||
* Sun Feb 01 2009 mboman@suse.de
|
||||
- Update to version 1.1.4:
|
||||
+ Trash performance fixes
|
||||
+ Fuse performance fixes
|
||||
* Thu Jan 29 2009 vuntz@novell.com
|
||||
- Disable gvfs-nds.patch for now, since it needs to be reworked to
|
||||
actually compile.
|
||||
* Fri Jan 23 2009 vuntz@novell.com
|
||||
- Merge packages from GNOME:Factory:Next and openSUSE:Factory.
|
||||
- Rename gvfs-novell-nautilus-plugin-filesystem.patch to
|
||||
gvfs-nvvfs.patch
|
||||
- Integrate gvfs-nds-no-vfs-init.patch in gvfsd-nds.patch, and
|
||||
rename gvfsd-nds.patch to gvfs-nds.patch
|
||||
* Fri Jan 16 2009 ksamrat@novell.com
|
||||
- gvfs-nds-no-vfs-init.patch - Avoid issues with vfs initialization
|
||||
* Thu Jan 15 2009 ksamrat@novell.com
|
||||
@ -240,26 +244,69 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- gvfs-novell-nautilus-plugin-filesystem.patch
|
||||
- Provide the Nautilus backend for NDS and Novell File system browsing
|
||||
- Solves bugs bnc#420155 , bnc#449396
|
||||
* Thu Jan 08 2009 hpj@novell.com
|
||||
* Thu Jan 08 2009 mboman@suse.de
|
||||
- Remove gvfs-smb-browse-auth.patch. Fixed upstream
|
||||
* Wed Jan 07 2009 hpj@novell.com
|
||||
- Added gvfs-429959-handle-blank-schemas.patch (bnc#429959).
|
||||
* Fri Dec 05 2008 hpj@novell.com
|
||||
* Wed Jan 07 2009 mboman@suse.de
|
||||
- Update to version 1.1.3:
|
||||
+ ftp: fix limited number of connections causes commands to fail
|
||||
(bgo#565504)
|
||||
+ trash: fix parallel build doesn't work (bgo#562955)
|
||||
+ trash: add trash::orig-path and trash::deletion-date info
|
||||
+ trash: set files to mode 700 before deleting to deal with users
|
||||
trashing read-only directories
|
||||
+ smb-browse: browsing authentication support (bgo#524485)
|
||||
+ smb-browse: make backend not automounted anymore
|
||||
* Sat Dec 20 2008 mboman@suse.de
|
||||
- Update to version 1.1.2:
|
||||
+ New trash backend
|
||||
+ Use the new shadow mount facility in gio
|
||||
+ gphoto2: Use shadow mounts
|
||||
+ obex: Fix icon for root directory
|
||||
+ http: Fix major memory leak
|
||||
+ http: Support proxies
|
||||
* Sun Dec 14 2008 mboman@suse.de
|
||||
- Update to version 1.1.1:
|
||||
+ Reverse map FUSE pathnames to gvfs locations
|
||||
+ Fix crashes
|
||||
+ Show better icon info in gvfs-info
|
||||
+ Support custom icons for gvfs backends
|
||||
+ dav: support uris (dav+sd://) which specify dns-sd services instead of
|
||||
resolved ip+port
|
||||
+ ftp: Fix time parsing
|
||||
+ ftp: Show username in auth dialog if specified in uri
|
||||
+ ftp: Support UTF8 server feature
|
||||
+ ftp: Use LIST -a instead of LIST on unix servers
|
||||
+ fuse: Fix major race in that caused crashes
|
||||
+ fuse: Set st_blocks so that e.g. the "du" command works
|
||||
+ gphoto: use custom icons for faster thumbnails
|
||||
+ obexftp: Port to bluez 4 API
|
||||
+ sftp: If name specified in mount, use in name too so that fuse paths
|
||||
are unique
|
||||
+ sftp: Support /etc/favicon.png
|
||||
+ smb: Don't ask for password twice if cancelled
|
||||
+ smb: support setting timestamp
|
||||
- Remove gvfs-obexftp-updated-apis-3.patch. Fixed upstream
|
||||
- Add gvfs-enable-deprecated.patch (bgo#564464)
|
||||
* Thu Dec 04 2008 hpj@novell.com
|
||||
- Added gvfs-smb-browse-auth.patch (bnc#437780).
|
||||
* Tue Nov 11 2008 maw@suse.de
|
||||
- Apply gvfs-dice-backend.patch correctly.
|
||||
* Sat Nov 08 2008 banderso@novell.com
|
||||
* Fri Nov 07 2008 banderso@novell.com
|
||||
- updated gvfs-dice-backend.patch - feature complete for Beta 5
|
||||
* Mon Oct 27 2008 jpr@novell.com
|
||||
- Use bluez-devel not bluez in the BuildRequires (bnc#436950)
|
||||
- List each backend individually so we know when one breaks
|
||||
- Add gvfs-obexftp-update-apis-3.patch for bluez 4.x
|
||||
* Wed Oct 22 2008 mboman@suse.de
|
||||
* Tue Oct 21 2008 mboman@suse.de
|
||||
- Update to version 1.0.2:
|
||||
+ Make sure mount-added is always emitted when a mount operation is
|
||||
completed
|
||||
+ Crash fixes
|
||||
+ Set st_blocks to make du and ls -s work
|
||||
+ Stability fix with concurrent close and reads (made amarok2 crash)
|
||||
* Fri Oct 03 2008 mboman@suse.de
|
||||
* Thu Oct 02 2008 mboman@suse.de
|
||||
- Update to version 1.0.1:
|
||||
+ bgo#547568 - gvfsd-trash crash due to race condition
|
||||
* Wed Sep 24 2008 hpj@suse.de
|
||||
@ -287,13 +334,13 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Mon Sep 08 2008 kukuk@suse.de
|
||||
- Make obex-data-server really a recommends as requested initialy
|
||||
in bugzilla.
|
||||
* Tue Sep 02 2008 mboman@novell.com
|
||||
* Mon Sep 01 2008 mboman@novell.com
|
||||
- Update to version 0.99.6:
|
||||
+ Better cross-backend copy/move logic.
|
||||
+ Bugs fixed: bgo#548841, bgo#547133, bgo#538573, bgo#549253,
|
||||
bgo#549553, bgo#550100, bgo#529971, rh#460223
|
||||
+ Translation updates
|
||||
* Mon Sep 01 2008 ro@suse.de
|
||||
* Sun Aug 31 2008 ro@suse.de
|
||||
- add libexpat-devel to buildrequires so that obex backend
|
||||
is built
|
||||
* Thu Aug 28 2008 maw@suse.de
|
||||
@ -330,7 +377,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
+ Many smaller bug fixes
|
||||
+ Updated translations
|
||||
- Remove upstreamed patch: gvfs-bnc368628-fuse-robustness.patch.
|
||||
* Sat May 24 2008 hpj@suse.de
|
||||
* Fri May 23 2008 hpj@suse.de
|
||||
- Merge gvfs-bgo531516-fuse-cleanup-when-killed.patch into
|
||||
gvfs-bnc368628-fuse-robustness.patch so as to avoid overlapping
|
||||
patches.
|
||||
@ -369,7 +416,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* sftp: Kerberos support
|
||||
* smb: Port to new samba 3.2.0 API (backwards compat)
|
||||
* sftp: Handle overwrites correctly (was silent overwrite)
|
||||
* Wed Mar 26 2008 maw@suse.de
|
||||
* Tue Mar 25 2008 maw@suse.de
|
||||
- gvfs now recommends gvfs-backends (bnc#373477).
|
||||
* Wed Mar 19 2008 maw@suse.de
|
||||
- Reduce build requirements
|
||||
@ -389,7 +436,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Enviroment variable to disable fuse backend at runtime
|
||||
* Mon Mar 17 2008 jpr@suse.de
|
||||
- Add recommends for obex-data-server (bnc #368776)
|
||||
* Fri Mar 14 2008 maw@suse.de
|
||||
* Thu Mar 13 2008 maw@suse.de
|
||||
- Update to version 0.2.0.1:
|
||||
+ Fix crashes
|
||||
+ Build and portability fixes
|
||||
@ -401,7 +448,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
+ obex: Give better error message on broken phones
|
||||
+ sftp: Allow setting permissions
|
||||
+ dav: Correct mount name, file icons and file types.
|
||||
* Wed Mar 05 2008 jpr@suse.de
|
||||
* Tue Mar 04 2008 jpr@suse.de
|
||||
- Update to version 0.1.11
|
||||
* Correctly free mounts
|
||||
* Disable debug log
|
||||
@ -435,7 +482,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Add bash completion support for command line apps
|
||||
* Fix handling of blank cds and audio cds
|
||||
* Support port in sftp uris
|
||||
* Fri Feb 29 2008 jpr@suse.de
|
||||
* Thu Feb 28 2008 jpr@suse.de
|
||||
- Move the gio modules into the main package (#358748)
|
||||
- Enable gconf backend
|
||||
* Mon Feb 18 2008 maw@suse.de
|
||||
|
Loading…
x
Reference in New Issue
Block a user