|
|
99927fd |
From a30038e45158d37f380e680040a225c9d524c874 Mon Sep 17 00:00:00 2001
|
|
|
99927fd |
From: Brian Cameron <Brian.Cameron@sun.com>
|
|
|
99927fd |
Date: Wed, 13 Jan 2010 12:21:58 -0500
|
|
|
99927fd |
Subject: [PATCH 1/2] Run PostLogin script as normal user
|
|
|
99927fd |
|
|
|
99927fd |
1) In daemon/gdm-slave.c it now sets PATH to GDM_SESSION_DEFAULT_PATH so that
|
|
|
99927fd |
the scripts have the system normal PATH when run.
|
|
|
99927fd |
|
|
|
99927fd |
This is much better than hardcoding the PATH in the scripts themselves,
|
|
|
99927fd |
especially since the Init, PreSession, PostSession, and PostLogin scripts
|
|
|
99927fd |
are designed to run per-display and it makes things just complicated if
|
|
|
99927fd |
users need to add the common system path to any per-display script they
|
|
|
99927fd |
might want to use.
|
|
|
99927fd |
|
|
|
99927fd |
2) The Init and PreSession scripts are fixed to set the PATH to "@X_PATH:$PATH"
|
|
|
99927fd |
and not add "/bin:/usr/bin" since this isn't neeed since PATH is already
|
|
|
99927fd |
set to GDM_SESSION_DEFAULT_PATH before running the script.
|
|
|
99927fd |
|
|
|
99927fd |
See https://bugzilla.gnome.org/show_bug.cgi?id=602403
|
|
|
99927fd |
---
|
|
|
99927fd |
daemon/gdm-simple-slave.c | 5 ++++-
|
|
|
99927fd |
daemon/gdm-slave.c | 4 +---
|
|
|
99927fd |
data/Init.in | 2 +-
|
|
|
99927fd |
data/PreSession.in | 2 +-
|
|
|
99927fd |
4 files changed, 7 insertions(+), 6 deletions(-)
|
|
|
99927fd |
|
|
|
99927fd |
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
|
|
|
99927fd |
index 948886f..c95a954 100644
|
|
|
99927fd |
--- a/daemon/gdm-simple-slave.c
|
|
|
99927fd |
+++ b/daemon/gdm-simple-slave.c
|
|
|
99927fd |
@@ -334,6 +334,8 @@ try_migrate_session (GdmSimpleSlave *slave)
|
|
|
99927fd |
static void
|
|
|
99927fd |
stop_greeter (GdmSimpleSlave *slave)
|
|
|
99927fd |
{
|
|
|
99927fd |
+ char *username;
|
|
|
99927fd |
+
|
|
|
99927fd |
g_debug ("GdmSimpleSlave: Stopping greeter");
|
|
|
99927fd |
|
|
|
99927fd |
if (slave->priv->greeter == NULL) {
|
|
|
99927fd |
@@ -342,7 +344,8 @@ stop_greeter (GdmSimpleSlave *slave)
|
|
|
99927fd |
}
|
|
|
99927fd |
|
|
|
99927fd |
/* Run the PostLogin script. gdmslave suspends until script has terminated */
|
|
|
99927fd |
- gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", GDM_USERNAME);
|
|
|
99927fd |
+ username = gdm_session_direct_get_username (slave->priv->session);
|
|
|
99927fd |
+ gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
|
|
|
99927fd |
|
|
|
99927fd |
gdm_welcome_session_stop (GDM_WELCOME_SESSION (slave->priv->greeter));
|
|
|
99927fd |
gdm_greeter_server_stop (slave->priv->greeter_server);
|
|
|
99927fd |
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
|
|
|
99927fd |
index 477b42d..14f736d 100644
|
|
|
99927fd |
--- a/daemon/gdm-slave.c
|
|
|
99927fd |
+++ b/daemon/gdm-slave.c
|
|
|
99927fd |
@@ -225,9 +225,7 @@ get_script_environment (GdmSlave *slave,
|
|
|
99927fd |
/* Runs as root */
|
|
|
99927fd |
g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (slave->priv->display_x11_authority_file));
|
|
|
99927fd |
g_hash_table_insert (hash, g_strdup ("DISPLAY"), g_strdup (slave->priv->display_name));
|
|
|
99927fd |
-
|
|
|
99927fd |
- /*g_setenv ("PATH", gdm_daemon_config_get_value_string (GDM_KEY_ROOT_PATH), TRUE);*/
|
|
|
99927fd |
-
|
|
|
99927fd |
+ g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (GDM_SESSION_DEFAULT_PATH));
|
|
|
99927fd |
g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
|
|
|
99927fd |
|
|
|
99927fd |
g_hash_table_remove (hash, "MAIL");
|
|
|
99927fd |
diff --git a/data/Init.in b/data/Init.in
|
|
|
99927fd |
index 091f535..dca63a2 100644
|
|
|
99927fd |
--- a/data/Init.in
|
|
|
99927fd |
+++ b/data/Init.in
|
|
|
99927fd |
@@ -3,7 +3,7 @@
|
|
|
99927fd |
# Plus a lot of fun stuff added
|
|
|
99927fd |
# -George
|
|
|
99927fd |
|
|
|
99927fd |
-PATH=@X_PATH@:$PATH
|
|
|
99927fd |
+PATH="@X_PATH@:$PATH"
|
|
|
99927fd |
OLD_IFS=$IFS
|
|
|
99927fd |
|
|
|
99927fd |
gdmwhich () {
|
|
|
99927fd |
diff --git a/data/PreSession.in b/data/PreSession.in
|
|
|
99927fd |
index 6f31d3d..cfabee7 100755
|
|
|
99927fd |
--- a/data/PreSession.in
|
|
|
99927fd |
+++ b/data/PreSession.in
|
|
|
99927fd |
@@ -6,4 +6,4 @@
|
|
|
99927fd |
#
|
|
|
99927fd |
# Note that output goes into the .xsession-errors file for easy debugging
|
|
|
99927fd |
#
|
|
|
99927fd |
-PATH="@X_PATH@:$PATH:/bin:/usr/bin"
|
|
|
99927fd |
+PATH="@X_PATH@:$PATH"
|
|
|
99927fd |
--
|
|
|
99927fd |
1.7.0.1
|
|
|
99927fd |
|
|
|
99927fd |
|
|
|
99927fd |
From 1a838fea4af862fe27b68ea36f6251d2527c00d0 Mon Sep 17 00:00:00 2001
|
|
|
99927fd |
From: Ray Strode <rstrode@redhat.com>
|
|
|
99927fd |
Date: Wed, 13 Jan 2010 12:28:10 -0500
|
|
|
99927fd |
Subject: [PATCH 2/2] Only run PostLogin script post login
|
|
|
99927fd |
|
|
|
99927fd |
We don't want to run it when stopping the greeter for other reasons.
|
|
|
99927fd |
|
|
|
99927fd |
Spotted by Halton.
|
|
|
99927fd |
|
|
|
99927fd |
See https://bugzilla.gnome.org/show_bug.cgi?id=602403#c6
|
|
|
99927fd |
---
|
|
|
99927fd |
daemon/gdm-simple-slave.c | 5 ++++-
|
|
|
99927fd |
1 files changed, 4 insertions(+), 1 deletions(-)
|
|
|
99927fd |
|
|
|
99927fd |
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
|
|
|
99927fd |
index c95a954..8bdefa9 100644
|
|
|
99927fd |
--- a/daemon/gdm-simple-slave.c
|
|
|
99927fd |
+++ b/daemon/gdm-simple-slave.c
|
|
|
99927fd |
@@ -345,7 +345,10 @@ stop_greeter (GdmSimpleSlave *slave)
|
|
|
99927fd |
|
|
|
99927fd |
/* Run the PostLogin script. gdmslave suspends until script has terminated */
|
|
|
99927fd |
username = gdm_session_direct_get_username (slave->priv->session);
|
|
|
99927fd |
- gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
|
|
|
99927fd |
+
|
|
|
99927fd |
+ if (username != NULL) {
|
|
|
99927fd |
+ gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
|
|
|
99927fd |
+ }
|
|
|
99927fd |
|
|
|
99927fd |
gdm_welcome_session_stop (GDM_WELCOME_SESSION (slave->priv->greeter));
|
|
|
99927fd |
gdm_greeter_server_stop (slave->priv->greeter_server);
|
|
|
99927fd |
--
|
|
|
99927fd |
1.7.0.1
|
|
|
99927fd |
|