summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cameron <Brian.Cameron@sun.com>2010-01-13 17:21:58 (GMT)
committerRay Strode <rstrode@redhat.com>2010-01-13 17:21:58 (GMT)
commite33ee9d9b23c103ac25b6fdb53fe8c074de0de53 (patch)
treeb5606f80ec2ff93e252a611fa7d5fa2b5461ca7a
parentc249a06a8ca772051c17cef7c9c115e027146bea (diff)
downloadgdm-e33ee9d9b23c103ac25b6fdb53fe8c074de0de53.zip
gdm-e33ee9d9b23c103ac25b6fdb53fe8c074de0de53.tar.xz
Run PostLogin script as normal user
1) In daemon/gdm-slave.c it now sets PATH to GDM_SESSION_DEFAULT_PATH so that the scripts have the system normal PATH when run. This is much better than hardcoding the PATH in the scripts themselves, especially since the Init, PreSession, PostSession, and PostLogin scripts are designed to run per-display and it makes things just complicated if users need to add the common system path to any per-display script they might want to use. 2) The Init and PreSession scripts are fixed to set the PATH to "@X_PATH:$PATH" and not add "/bin:/usr/bin" since this isn't neeed since PATH is already set to GDM_SESSION_DEFAULT_PATH before running the script. See https://bugzilla.gnome.org/show_bug.cgi?id=602403
-rw-r--r--daemon/gdm-simple-slave.c5
-rw-r--r--daemon/gdm-slave.c4
-rw-r--r--data/Init.in2
-rwxr-xr-xdata/PreSession.in2
4 files changed, 7 insertions, 6 deletions
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 463b2b3..bd855fb 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -339,6 +339,8 @@ try_migrate_session (GdmSimpleSlave *slave)
static void
stop_greeter (GdmSimpleSlave *slave)
{
+ char *username;
+
g_debug ("GdmSimpleSlave: Stopping greeter");
if (slave->priv->greeter == NULL) {
@@ -347,7 +349,8 @@ stop_greeter (GdmSimpleSlave *slave)
}
/* Run the PostLogin script. gdmslave suspends until script has terminated */
- gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", GDM_USERNAME);
+ username = gdm_session_direct_get_username (slave->priv->session);
+ gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
gdm_welcome_session_stop (GDM_WELCOME_SESSION (slave->priv->greeter));
gdm_greeter_server_stop (slave->priv->greeter_server);
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index e11e16c..5021157 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -233,9 +233,7 @@ get_script_environment (GdmSlave *slave,
/* Runs as root */
g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (slave->priv->display_x11_authority_file));
g_hash_table_insert (hash, g_strdup ("DISPLAY"), g_strdup (slave->priv->display_name));
-
- /*g_setenv ("PATH", gdm_daemon_config_get_value_string (GDM_KEY_ROOT_PATH), TRUE);*/
-
+ g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (GDM_SESSION_DEFAULT_PATH));
g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
g_hash_table_remove (hash, "MAIL");
diff --git a/data/Init.in b/data/Init.in
index 091f535..dca63a2 100644
--- a/data/Init.in
+++ b/data/Init.in
@@ -3,7 +3,7 @@
# Plus a lot of fun stuff added
# -George
-PATH=@X_PATH@:$PATH
+PATH="@X_PATH@:$PATH"
OLD_IFS=$IFS
gdmwhich () {
diff --git a/data/PreSession.in b/data/PreSession.in
index 6f31d3d..cfabee7 100755
--- a/data/PreSession.in
+++ b/data/PreSession.in
@@ -6,4 +6,4 @@
#
# Note that output goes into the .xsession-errors file for easy debugging
#
-PATH="@X_PATH@:$PATH:/bin:/usr/bin"
+PATH="@X_PATH@:$PATH"