[Pkg-shadow-commits] r3271 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sat Aug 28 19:55:32 UTC 2010


Author: nekral-guest
Date: 2010-08-28 19:55:31 +0000 (Sat, 28 Aug 2010)
New Revision: 3271

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/su.c
Log:
	* src/su.c: Fix handling of environment variables when
	the environment is not changed. In particular, this makes su
	behave as documented regarding PATH and IFS (i.e. they are reset)
	when -p is provided.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2010-08-28 19:51:48 UTC (rev 3270)
+++ upstream/trunk/ChangeLog	2010-08-28 19:55:31 UTC (rev 3271)
@@ -1,5 +1,12 @@
 2010-08-28  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/su.c: Fix handling of environment variables when
+	the environment is not changed. In particular, this makes su
+	behave as documented regarding PATH and IFS (i.e. they are reset)
+	when -p is provided.
+
+2010-08-28  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* man/su.1.xml: Fix typo.
 
 2010-08-22  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2010-08-28 19:51:48 UTC (rev 3270)
+++ upstream/trunk/src/su.c	2010-08-28 19:55:31 UTC (rev 3271)
@@ -933,13 +933,13 @@
 		exit (1);
 	}
 
+	/* we need to setup the environment *after* pam_open_session(),
+	 * else the UID is changed before stuff like pam_xauth could
+	 * run, and we cannot access /etc/shadow and co
+	 */
+	environ = newenvp;	/* make new environment active */
+
 	if (change_environment) {
-		/* we need to setup the environment *after* pam_open_session(),
-		 * else the UID is changed before stuff like pam_xauth could
-		 * run, and we cannot access /etc/shadow and co
-		 */
-		environ = newenvp;	/* make new environment active */
-
 		/* update environment with all pam set variables */
 		envcp = pam_getenvlist (pamh);
 		if (NULL != envcp) {




More information about the Pkg-shadow-commits mailing list