File gnome-session-pass-env-to-dbus.patch of Package gnome-session.2960

Index: gnome-session/main.c
===================================================================
--- gnome-session/main.c.orig	2013-10-05 10:29:25.000000000 +0800
+++ gnome-session/main.c	2014-04-23 19:20:16.003787384 +0800
@@ -290,6 +290,31 @@ check_gl (GError **error)
         return g_spawn_check_exit_status (status, error);
 }
 
+static void
+gsm_pass_env(void){
+        gchar** env_list = g_listenv();
+
+        gchar** penv_name = env_list;
+        const gchar* env_val = NULL;
+        while (*penv_name){
+                env_val = g_getenv(*penv_name);
+
+                if (g_strcmp0("_", *penv_name) == 0
+                    || env_val == NULL ){
+                        goto NEXT_NAME;
+                }
+
+                gsm_util_setenv(*penv_name, env_val);
+
+                /* g_printf("%s=%s\n", *penv_name, env_val); */
+
+        NEXT_NAME:
+                penv_name++;
+        }
+
+        g_strfreev(env_list);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -387,6 +412,9 @@ main (int argc, char **argv)
         gdm_log_init ();
         gdm_log_set_debug (debug);
 
+        /* Pass most current environments to DBus */
+        gsm_pass_env();
+
         /* Some third-party programs rely on GNOME_DESKTOP_SESSION_ID to
          * detect if GNOME is running. We keep this for compatibility reasons.
          */
openSUSE Build Service is sponsored by