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

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Sun, 22 May 2005 23:48:28 +0000


Author: nekral-guest
Date: 2005-05-22 23:48:27 +0000 (Sun, 22 May 2005)
New Revision: 172

Added:
   trunk/debian/patches/008_su_GNU_origin
Modified:
   trunk/debian/patches/008_src.dpatch
   trunk/debian/patches/series
Log:
Move some bits from 008_src.dpatch to 008_su_GNU_origin.


Modified: trunk/debian/patches/008_src.dpatch
===================================================================
--- trunk/debian/patches/008_src.dpatch	2005-05-22 23:40:47 UTC (rev 171)
+++ trunk/debian/patches/008_src.dpatch	2005-05-22 23:48:27 UTC (rev 172)
@@ -315,34 +315,9 @@
  	if (is_rad_login) {
 Index: shadow-4.0.3/src/su.c
 ===================================================================
---- shadow-4.0.3.orig/src/su.c	2005-05-23 00:40:16.187167000 +0200
-+++ shadow-4.0.3/src/su.c	2005-05-23 00:40:50.307167000 +0200
-@@ -26,6 +26,24 @@
-  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-  * SUCH DAMAGE.
-  */
-+/* Some parts substantially derived from an ancestor of: */
-+/* su for GNU.  Run a shell with substitute user and group IDs.
-+   Copyright (C) 1992-2003 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software Foundation,
-+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+
- 
- #include <config.h>
- 
-@@ -49,6 +67,7 @@
+--- shadow-4.0.3.orig/src/su.c	2005-05-23 01:32:45.977167000 +0200
++++ shadow-4.0.3/src/su.c	2005-05-23 01:44:23.797167000 +0200
+@@ -49,6 +49,7 @@
  #include <grp.h>
  #include <signal.h>
  #include <pwd.h>
@@ -350,7 +325,7 @@
  #include "pwauth.h"
  #include "getdef.h"
  
-@@ -79,6 +98,18 @@
+@@ -79,6 +80,18 @@
  
  /* local function prototypes */
  
@@ -369,7 +344,7 @@
  #ifndef USE_PAM
  
  static RETSIGTYPE die (int);
-@@ -118,6 +149,96 @@
+@@ -118,6 +131,96 @@
  }
  #endif				/* !USE_PAM */
  
@@ -466,7 +441,7 @@
  
  static void su_failure (const char *tty)
  {
-@@ -125,7 +246,7 @@
+@@ -125,7 +228,7 @@
  #ifdef USE_SYSLOG
  	if (getdef_bool ("SYSLOG_SU_ENAB"))
  		SYSLOG ((pwent.pw_uid ? LOG_INFO : LOG_NOTICE,
@@ -475,7 +450,7 @@
  			 oldname[0] ? oldname : "???",
  			 name[0] ? name : "???"));
  	closelog ();
-@@ -153,13 +274,14 @@
+@@ -153,13 +256,14 @@
  {
  	char *cp;
  	const char *tty = 0;	/* Name of tty SU is run from        */
@@ -492,7 +467,7 @@
  #ifdef USE_PAM
  	int ret;
  #else				/* !USE_PAM */
-@@ -174,12 +296,14 @@
+@@ -174,12 +278,14 @@
  #endif
  #endif				/* !USE_PAM */
  
@@ -508,7 +483,7 @@
  	/*
  	 * Get the program name. The program name is used as a prefix to
  	 * most error messages.
-@@ -224,15 +348,67 @@
+@@ -224,14 +330,66 @@
  	 * Process the command line arguments. 
  	 */
  
@@ -551,8 +526,8 @@
 -		argc--;
 -		argv++;		/* shift ... */
 +		++optind;
- 	}
- 
++	}
++
 +	if (optind < argc)
 +		strncpy(name, argv[optind++], sizeof(name) - 1);
 +	else {
@@ -576,13 +551,12 @@
 +	if (!pw) {
 +		SYSLOG((LOG_CRIT, "Unknown UID: %d\n", (int) my_uid));
 +		su_failure(tty);
-+	}
+ 	}
 +	STRFCPY(oldname, pw->pw_name);
-+
+ 
  	/*
  	 * If a new login is being set up, the old environment will be
- 	 * ignored and a new one created later on.
-@@ -257,35 +433,6 @@
+@@ -257,35 +415,6 @@
  			addenv (*envp++, NULL);
  	}
  
@@ -618,7 +592,7 @@
  #ifndef USE_PAM
  #ifdef SU_ACCESS
  	/*
-@@ -399,9 +546,17 @@
+@@ -399,9 +528,17 @@
  	 * Set the default shell.
  	 */
  
@@ -626,19 +600,19 @@
 -		pwent.pw_shell = "/bin/sh";	/* XXX warning: const */
 +	if (pwent.pw_shell == NULL || pwent.pw_shell[0] == '\0')
 +		pwent.pw_shell = (char *) "/bin/sh";
-+
+ 
 +	if (shell == 0 && change_environment == 0)
 +		shell = getenv ("SHELL");
 +	if (shell != 0 && getuid () && restricted_shell (pwent.pw_shell))
 +		shell = 0;
 +	if (shell == 0)
 +	shell = (char *) strdup (pwent.pw_shell);
- 
++
 +	signal(SIGINT, SIG_IGN);
  #ifdef USE_PAM
  	ret = pam_authenticate (pamh, 0);
  	if (ret != PAM_SUCCESS) {
-@@ -427,6 +582,14 @@
+@@ -427,6 +564,14 @@
  			su_failure (tty);
  		}
  	}
@@ -653,7 +627,7 @@
  #else				/* !USE_PAM */
  	/*
  	 * Set up a signal handler in case the user types QUIT.
-@@ -507,10 +670,14 @@
+@@ -507,10 +652,14 @@
  	}
  #endif
  
@@ -672,7 +646,7 @@
  
  	if (pwent.pw_shell[0] == '*') {	/* subsystem root required */
  		pwent.pw_shell++;	/* skip the '*' */
-@@ -529,7 +696,7 @@
+@@ -529,7 +678,7 @@
  #endif
  #ifdef USE_SYSLOG
  	if (getdef_bool ("SYSLOG_SU_ENAB"))
@@ -681,7 +655,7 @@
  			 oldname[0] ? oldname : "???",
  			 name[0] ? name : "???"));
  #endif
-@@ -554,17 +721,56 @@
+@@ -554,17 +703,56 @@
  		pam_end (pamh, ret);
  		exit (1);
  	}
@@ -741,7 +715,7 @@
  #else				/* !USE_PAM */
  	if (!amroot)		/* no limits if su from root */
  		setup_limits (&pwent);
-@@ -573,11 +779,14 @@
+@@ -573,11 +761,14 @@
  		exit (1);
  #endif				/* !USE_PAM */
  
@@ -760,7 +734,7 @@
  #endif
  
  	/*
-@@ -589,46 +798,6 @@
+@@ -589,46 +780,6 @@
  	 */
  	closelog ();
  

Added: trunk/debian/patches/008_su_GNU_origin
===================================================================
--- trunk/debian/patches/008_su_GNU_origin	2005-05-22 23:40:47 UTC (rev 171)
+++ trunk/debian/patches/008_su_GNU_origin	2005-05-22 23:48:27 UTC (rev 172)
@@ -0,0 +1,35 @@
+Goal: Be up front on the origin of our su.
+Fixes: #244297
+
+Status wrt upstream: It must be forwarded upstream.
+                     Upstream also uses some bits from the GNU shellutils.
+
+Index: shadow-4.0.3/src/su.c
+===================================================================
+--- shadow-4.0.3.orig/src/su.c	2005-05-23 00:34:54.617167000 +0200
++++ shadow-4.0.3/src/su.c	2005-05-23 00:36:04.067167000 +0200
+@@ -26,6 +26,24 @@
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
++/* Some parts substantially derived from an ancestor of: */
++/* su for GNU.  Run a shell with substitute user and group IDs.
++   Copyright (C) 1992-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software Foundation,
++   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
+ 
+ #include <config.h>
+ 

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-05-22 23:40:47 UTC (rev 171)
+++ trunk/debian/patches/series	2005-05-22 23:48:27 UTC (rev 172)
@@ -11,6 +11,7 @@
 008_usermod_warn_old_home_not_removed
 008_userdel_remove_group_from_gshadow
 008_newgrp_preserve_env
+008_su_GNU_origin
 009_etc.dpatch
 010_chpasswd-md5.dpatch
 100_LINGUAS.dpatch