rpms/gdm/F-11 fix-post-login-script-execution.patch, NONE, 1.1 gdm.spec, 1.476, 1.477
Ray Strode
rstrode at fedoraproject.org
Fri Mar 12 19:36:36 UTC 2010
Author: rstrode
Update of /cvs/pkgs/rpms/gdm/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29205
Modified Files:
gdm.spec
Added Files:
fix-post-login-script-execution.patch
Log Message:
- set LOGNAME correctly when running PostLogin script
fix-post-login-script-execution.patch:
b/daemon/gdm-simple-slave.c | 5 ++++-
b/daemon/gdm-slave.c | 4 +---
b/data/Init.in | 2 +-
b/data/PreSession.in | 3 +--
daemon/gdm-simple-slave.c | 6 ++++--
5 files changed, 11 insertions(+), 9 deletions(-)
--- NEW FILE fix-post-login-script-execution.patch ---
>From a30038e45158d37f380e680040a225c9d524c874 Mon Sep 17 00:00:00 2001
From: Brian Cameron <Brian.Cameron at sun.com>
Date: Wed, 13 Jan 2010 12:21:58 -0500
Subject: [PATCH 1/2] 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
---
daemon/gdm-simple-slave.c | 5 ++++-
daemon/gdm-slave.c | 4 +---
data/Init.in | 2 +-
data/PreSession.in | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 948886f..c95a954 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -334,6 +334,8 @@ try_migrate_session (GdmSimpleSlave *slave)
static void
stop_greeter (GdmSimpleSlave *slave)
{
+ char *username;
+
g_debug ("GdmSimpleSlave: Stopping greeter");
if (slave->priv->greeter == NULL) {
@@ -342,7 +344,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 477b42d..14f736d 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -225,9 +225,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"
--
1.7.0.1
>From 1a838fea4af862fe27b68ea36f6251d2527c00d0 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode at redhat.com>
Date: Wed, 13 Jan 2010 12:28:10 -0500
Subject: [PATCH 2/2] Only run PostLogin script post login
We don't want to run it when stopping the greeter for other reasons.
Spotted by Halton.
See https://bugzilla.gnome.org/show_bug.cgi?id=602403#c6
---
daemon/gdm-simple-slave.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index c95a954..8bdefa9 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -345,7 +345,10 @@ stop_greeter (GdmSimpleSlave *slave)
/* Run the PostLogin script. gdmslave suspends until script has terminated */
username = gdm_session_direct_get_username (slave->priv->session);
- gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
+
+ if (username != NULL) {
+ 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);
--
1.7.0.1
Index: gdm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdm/F-11/gdm.spec,v
retrieving revision 1.476
retrieving revision 1.477
diff -u -p -r1.476 -r1.477
--- gdm.spec 30 Oct 2009 21:16:32 -0000 1.476
+++ gdm.spec 12 Mar 2010 19:36:35 -0000 1.477
@@ -16,7 +16,7 @@
Summary: The GNOME Display Manager
Name: gdm
Version: 2.26.1
-Release: 14%{?dist}
+Release: 15%{?dist}
Epoch: 1
License: GPLv2+
Group: User Interface/X
@@ -109,6 +109,9 @@ Patch22: gdm-2.26.0-fix-lang-regex.patch
# http://bugzilla.redhat.com/512944
Patch23: fix-double-free.patch
+# http://bugzilla.redhat.com/449675
+Patch24: fix-post-login-script-execution.patch
+
# Fedora-specific
Patch99: gdm-2.23.1-fedora-logo.patch
@@ -156,6 +159,7 @@ The GDM fingerprint plugin provides func
%patch21 -p1 -b .xdmcp-use-after-free
%patch22 -p1 -b .fix-lang-regex
%patch23 -p1 -b .fix-double-free
+%patch24 -p1 -b .fix-post-login-script-execution
%patch99 -p1 -b .fedora-logo
@@ -397,6 +401,9 @@ fi
%{_libdir}/gdm/simple-greeter/plugins/fingerprint.so
%changelog
+* Fri Mar 12 2010 Ray Strode <rstrode at redhat.com> 2.26.1-15
+- set LOGNAME correctly when running PostLogin script
+
* Fri Oct 30 2009 Ray Strode <rstrode at redhat.com> 2.26.1-14
- Fix double free (bug 512944)
More information about the scm-commits
mailing list