[Pkg-xfce-commits] r5848 - goodies/trunk/lightdm/debian/patches
Yves-Alexis Perez
corsac at alioth.debian.org
Tue Jul 5 10:40:54 UTC 2011
Author: corsac
Date: 2011-07-05 10:40:53 +0000 (Tue, 05 Jul 2011)
New Revision: 5848
Added:
goodies/trunk/lightdm/debian/patches/01_set-default-path.patch
Modified:
goodies/trunk/lightdm/debian/patches/series
Log:
add patch to set default PATH if none is set
Added: goodies/trunk/lightdm/debian/patches/01_set-default-path.patch
===================================================================
--- goodies/trunk/lightdm/debian/patches/01_set-default-path.patch (rev 0)
+++ goodies/trunk/lightdm/debian/patches/01_set-default-path.patch 2011-07-05 10:40:53 UTC (rev 5848)
@@ -0,0 +1,45 @@
+diff --git a/src/session.c b/src/session.c
+index 61267f0..c4b1971 100644
+--- a/src/session.c
++++ b/src/session.c
+@@ -104,6 +104,7 @@ session_start (Session *session, gboolean create_pipe)
+ //gint session_stdin, session_stdout, session_stderr;
+ gboolean result;
+ GError *error = NULL;
++ gchar *env_path = NULL;
+
+ g_return_val_if_fail (session != NULL, FALSE);
+ g_return_val_if_fail (session->priv->user != NULL, FALSE);
+@@ -114,6 +115,18 @@ session_start (Session *session, gboolean create_pipe)
+ child_process_set_env (CHILD_PROCESS (session), "HOME", user_get_home_directory (session->priv->user));
+ child_process_set_env (CHILD_PROCESS (session), "SHELL", user_get_shell (session->priv->user));
+
++ env_path = g_hash_table_lookup (session->priv->env, "PATH");
++ if (env_path == NULL)
++ {
++ if (user_get_uid (session->priv->user) == 0)
++ env_path = g_strdup (DEF_ROOTPATH);
++ else
++ env_path = g_strdup (DEF_PATH);
++
++ child_process_set_env(CHILD_PROCESS (session), "PATH", env_path);
++ }
++ g_free(env_path);
++
+ if (session->priv->authorization)
+ {
+ g_debug ("Writing session authority to %s", session->priv->authorization_path);
+diff --git a/src/session.h b/src/session.h
+index 7383e74..e819932 100644
+--- a/src/session.h
++++ b/src/session.h
+@@ -21,6 +21,9 @@ G_BEGIN_DECLS
+ #define SESSION_TYPE (session_get_type())
+ #define SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SESSION_TYPE, Session))
+
++#define DEF_PATH "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
++#define DEF_ROOTPATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
++
+ typedef struct SessionPrivate SessionPrivate;
+
+ typedef struct
Modified: goodies/trunk/lightdm/debian/patches/series
===================================================================
--- goodies/trunk/lightdm/debian/patches/series 2011-07-05 07:45:45 UTC (rev 5847)
+++ goodies/trunk/lightdm/debian/patches/series 2011-07-05 10:40:53 UTC (rev 5848)
@@ -1,3 +1,4 @@
+01_set-default-path.patch
02_default-config.patch
03_quit-plymouth.patch
04_fix_xauthority-path.patch
More information about the Pkg-xfce-commits
mailing list