[Pkg-shadow-commits] r183 - trunk/debian/patches

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Sun, 29 May 2005 23:34:38 +0000


Author: nekral-guest
Date: 2005-05-29 23:34:38 +0000 (Sun, 29 May 2005)
New Revision: 183

Added:
   trunk/debian/patches/008_su_addenv_HOME_and_SHELL
Modified:
   trunk/debian/patches/008_src.dpatch
   trunk/debian/patches/series
Log:
Another patch for src/su.c that can be extracted from 008_src.dpatch.


Modified: trunk/debian/patches/008_src.dpatch
===================================================================
--- trunk/debian/patches/008_src.dpatch	2005-05-29 22:46:50 UTC (rev 182)
+++ trunk/debian/patches/008_src.dpatch	2005-05-29 23:34:38 UTC (rev 183)
@@ -26,8 +26,8 @@
 
 Index: shadow-4.0.3/src/su.c
 ===================================================================
---- shadow-4.0.3.orig/src/su.c	2005-05-29 17:41:32.531112000 +0200
-+++ shadow-4.0.3/src/su.c	2005-05-30 00:18:20.757531000 +0200
+--- shadow-4.0.3.orig/src/su.c	2005-05-30 01:18:47.957531000 +0200
++++ shadow-4.0.3/src/su.c	2005-05-30 01:18:48.007531000 +0200
 @@ -49,6 +49,7 @@
  #include <grp.h>
  #include <signal.h>
@@ -303,7 +303,7 @@
  
  	if (pwent.pw_shell[0] == '*') {	/* subsystem root required */
  		pwent.pw_shell++;	/* skip the '*' */
-@@ -573,11 +714,14 @@
+@@ -573,13 +714,13 @@
  		exit (1);
  #endif				/* !USE_PAM */
  
@@ -312,17 +312,18 @@
 +	if (fakelogin && (change_environment || restricted_shell(pwent.pw_shell)))
 +		setup_env(&pwent);
  #if 1				/* Suggested by Joey Hess. XXX - is this right?  */
--	else
+-	else {
 -		addenv ("HOME", pwent.pw_dir);
+-		addenv ("USER", pwent.pw_name);
+-		addenv ("SHELL", pwent.pw_shell);
 +	else if (change_environment || restricted_shell(pwent.pw_shell)) {
 +		addenv("HOME", pwent.pw_dir);
 +		addenv("USER", pwent.pw_name);
 +		addenv("SHELL", shell);
-+	}
+ 	}
  #endif
  
- 	/*
-@@ -589,46 +733,6 @@
+@@ -592,46 +733,6 @@
  	 */
  	closelog ();
  

Added: trunk/debian/patches/008_su_addenv_HOME_and_SHELL
===================================================================
--- trunk/debian/patches/008_su_addenv_HOME_and_SHELL	2005-05-29 22:46:50 UTC (rev 182)
+++ trunk/debian/patches/008_su_addenv_HOME_and_SHELL	2005-05-29 23:34:38 UTC (rev 183)
@@ -0,0 +1,22 @@
+Goal: Export USER and SHELL as well as HOME.
+Fixes: maybe #11003 and #11189
+
+Status wrt upstream: It should be proposed to upstream.
+
+Index: shadow-4.0.3/src/su.c
+===================================================================
+--- shadow-4.0.3.orig/src/su.c	2005-05-30 00:48:15.997531000 +0200
++++ shadow-4.0.3/src/su.c	2005-05-30 00:53:34.157531000 +0200
+@@ -576,8 +576,11 @@
+ 	if (fakelogin)
+ 		setup_env (&pwent);
+ #if 1				/* Suggested by Joey Hess. XXX - is this right?  */
+-	else
++	else {
+ 		addenv ("HOME", pwent.pw_dir);
++		addenv ("USER", pwent.pw_name);
++		addenv ("SHELL", pwent.pw_shell);
++	}
+ #endif
+ 
+ 	/*

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-05-29 22:46:50 UTC (rev 182)
+++ trunk/debian/patches/series	2005-05-29 23:34:38 UTC (rev 183)
@@ -4,6 +4,7 @@
 004_configure.in.dpatch
 005_manpages.dpatch
 006_libmisc.dpatch
+008_su_addenv_HOME_and_SHELL
 008_src.dpatch
 008_su_check_user_earlier
 008_su_no_sanitize_env