[gnome-session] Make sure we use the local gio vfs in gnome-settings



commit 6b8d94ae13b2bec1db1bcff4ab4cc67bf63fda9f
Author: Giovanni Campagna <gcampagn cs stanford edu>
Date:   Fri Oct 9 14:54:42 2015 -0700

    Make sure we use the local gio vfs in gnome-settings
    
    So that we don't accidentally start gvfsd too early
    
    Patch slightly modified by Ray Strode to preserve
    original glib environment variable values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756324

 gnome-session/main.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 1c17698..074f53e 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -236,6 +236,34 @@ maybe_push_env_var (const char* name)
                 gsm_util_setenv (name, value);
 }
 
+static void
+initialize_gio (void)
+{
+        char *disable_fuse = NULL;
+        char *use_vfs = NULL;
+
+        disable_fuse = g_strdup (g_getenv ("GVFS_DISABLE_FUSE"));
+        use_vfs = g_strdup (g_getenv ("GVFS_USE_VFS"));
+
+        g_setenv ("GVFS_DISABLE_FUSE", "1", TRUE);
+        g_setenv ("GIO_USE_VFS", "local", TRUE);
+        g_vfs_get_default ();
+
+        if (use_vfs) {
+                g_setenv ("GIO_USE_VFS", use_vfs, TRUE);
+                g_free (use_vfs);
+        } else {
+                g_unsetenv ("GIO_USE_VFS");
+        }
+
+        if (disable_fuse) {
+                g_setenv ("GIO_DISABLE_FUSE", use_vfs, TRUE);
+                g_free (disable_fuse);
+        } else {
+                g_unsetenv ("GVFS_DISABLE_FUSE");
+        }
+}
+
 int
 main (int argc, char **argv)
 {
@@ -263,6 +291,9 @@ main (int argc, char **argv)
                 gsm_util_init_error (TRUE, "%s", error->message);
         }
 
+        /* Make sure we initialize gio in a way that does not autostart any daemon */
+        initialize_gio ();
+
         bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
         textdomain (GETTEXT_PACKAGE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]