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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Jun 11 20:01:21 UTC 2009


Author: nekral-guest
Date: 2009-06-11 20:01:21 +0000 (Thu, 11 Jun 2009)
New Revision: 3018

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/man/su.1.xml
   upstream/trunk/src/su.c
Log:
	* src/su.c, man/su.1.xml: The default behavior (without -p or
	--login) is to copy most of the environment variables. Revert a
	previous change and update the documentation.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-06-06 11:21:15 UTC (rev 3017)
+++ upstream/trunk/ChangeLog	2009-06-11 20:01:21 UTC (rev 3018)
@@ -1,5 +1,11 @@
 2009-06-06  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/su.c, man/su.1.xml: The default behavior (without -p or
+	--login) is to copy most of the environment variables. Revert a
+	previous change and update the documentation.
+
+2009-06-06  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* man/passwd.5.xml, man/shadow.5.xml: Document the passwd- and
 	shadow- files.
 

Modified: upstream/trunk/man/su.1.xml
===================================================================
--- upstream/trunk/man/su.1.xml	2009-06-06 11:21:15 UTC (rev 3017)
+++ upstream/trunk/man/su.1.xml	2009-06-11 20:01:21 UTC (rev 3018)
@@ -249,11 +249,18 @@
 	      </varlistentry>
 	      <varlistentry><term></term><listitem>
 		  <para>
+		    If <option>--login</option> is not used, the
+		    environment is copied, except for the variables above.
+		  </para>
+		</listitem>
+	      </varlistentry>
+	      <varlistentry><term></term><listitem>
+		  <para>
 		    If <option>--login</option> is used, the
 		    <envar>$TERM</envar>, <envar>$COLORTERM</envar>,
 		    <envar>$DISPLAY</envar>, and
 		    <envar>$XAUTHORITY</envar> environment variables are
-		    kept if they were set.
+		    copied if they were set.
 		  </para>
 		</listitem>
 	      </varlistentry>
@@ -270,16 +277,20 @@
 		  </para>
 		</listitem>
 	      </varlistentry>
-	      <varlistentry><term></term><listitem>
+	      <varlistentry condition="no_pam"><term></term><listitem>
 		  <para>
-		    Other environment variables are deleted, but might be
-		    set by <phrase condition="no_pam">the
-		    <option>ENVIRON_FILE</option> file (see
-		    below)</phrase><phrase condition="pam">PAM
-		    modules</phrase>.
+		    If <option>--login</option> is used, other environment
+		    variables might be set by the
+		    <option>ENVIRON_FILE</option> file (see below).
 		  </para>
 		</listitem>
 	      </varlistentry>
+	      <varlistentry condition="pam"><term></term><listitem>
+		  <para>
+		    Other environment might be set by PAM modules.
+		  </para>
+		</listitem>
+	      </varlistentry>
 	    </variablelist>
 	  </para>
 	</listitem>

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-06-06 11:21:15 UTC (rev 3017)
+++ upstream/trunk/src/su.c	2009-06-11 20:01:21 UTC (rev 3018)
@@ -559,8 +559,7 @@
 	 * (note: in the case of a subsystem, the shell will be restricted,
 	 *        and this won't be executed on the first pass)
 	 */
-	if (change_environment) {
-		if (fakelogin) {
+	if (change_environment && fakelogin) {
 		/*
 		 * The terminal type will be left alone if it is present in
 		 * the environment already.
@@ -610,7 +609,6 @@
 		if (NULL != cp) {
 			addenv ("XAUTHORITY", cp);
 		}
-		}
 	} else {
 		while (NULL != *envp) {
 			addenv (*envp, NULL);




More information about the Pkg-shadow-commits mailing list