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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Wed Jul 22 13:30:08 UTC 2009


Author: nekral-guest
Date: 2009-07-22 13:30:06 +0000 (Wed, 22 Jul 2009)
New Revision: 3034

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/configure.in
   upstream/trunk/libmisc/setupenv.c
   upstream/trunk/libmisc/shell.c
   upstream/trunk/src/newgrp.c
   upstream/trunk/src/su.c
Log:
	* configure.in, libmisc/shell.c, libmisc/setupenv.c, src/newgrp.c,
	src/su.c: Let the system shell be configurable.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/ChangeLog	2009-07-22 13:30:06 UTC (rev 3034)
@@ -1,3 +1,8 @@
+2009-07-22  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* configure.in, libmisc/shell.c, libmisc/setupenv.c, src/newgrp.c,
+	src/su.c: Let the system shell be configurable.
+
 2009-07-20  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* NEWS, src/su.c, libmisc/shell.c: Added support for shells being a

Modified: upstream/trunk/configure.in
===================================================================
--- upstream/trunk/configure.in	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/configure.in	2009-07-22 13:30:06 UTC (rev 3034)
@@ -491,6 +491,8 @@
 	          [Define if utmpx should be used])
 fi
 
+AC_DEFINE_UNQUOTED(SHELL, [$SHELL], [The default shell.])
+
 AM_GNU_GETTEXT_VERSION(0.16)
 AM_GNU_GETTEXT([external], [need-ngettext])
 AM_CONDITIONAL(USE_NLS, test "x$USE_NLS" = "xyes")

Modified: upstream/trunk/libmisc/setupenv.c
===================================================================
--- upstream/trunk/libmisc/setupenv.c	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/libmisc/setupenv.c	2009-07-22 13:30:06 UTC (rev 3034)
@@ -242,7 +242,7 @@
 	 */
 
 	if ((NULL == info->pw_shell) || ('\0' == *info->pw_shell)) {
-		static char temp_pw_shell[] = "/bin/sh";
+		static char temp_pw_shell[] = SHELL;
 
 		info->pw_shell = temp_pw_shell;
 	}

Modified: upstream/trunk/libmisc/shell.c
===================================================================
--- upstream/trunk/libmisc/shell.c	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/libmisc/shell.c	2009-07-22 13:30:06 UTC (rev 3034)
@@ -85,7 +85,7 @@
 		 * Assume this is a shell script (with no shebang).
 		 * Interpret it with /bin/sh
 		 */
-		execle ("/bin/sh", "sh", file, (char *)0, envp);
+		execle (SHELL, "sh", file, (char *)0, envp);
 		err = errno;
 	}
 

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/src/newgrp.c	2009-07-22 13:30:06 UTC (rev 3034)
@@ -722,7 +722,7 @@
 	 */
 	if (cflag) {
 		closelog ();
-		execl ("/bin/sh", "sh", "-c", command, (char *) 0);
+		execl (SHELL, "sh", "-c", command, (char *) 0);
 #ifdef WITH_AUDIT
 		snprintf (audit_buf, sizeof(audit_buf),
 		          "changing new-gid=%lu", (unsigned long) gid);
@@ -730,7 +730,7 @@
 		              audit_buf, NULL,
 		              (unsigned int) getuid (), 0);
 #endif
-		perror ("/bin/sh");
+		perror (SHELL);
 		exit ((errno == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
 	}
 
@@ -757,7 +757,7 @@
 	} else if ((NULL != pwd->pw_shell) && ('\0' != pwd->pw_shell[0])) {
 		prog = pwd->pw_shell;
 	} else {
-		prog = "/bin/sh";
+		prog = SHELL;
 	}
 
 	/*

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-07-20 19:11:13 UTC (rev 3033)
+++ upstream/trunk/src/su.c	2009-07-22 13:30:06 UTC (rev 3034)
@@ -203,7 +203,7 @@
 			n_args--;
 		}
 
-		(void) execve ("/bin/sh", targs, envp);
+		(void) execve (SHELL, targs, envp);
 	} else {
 		errno = err;
 	}
@@ -724,7 +724,7 @@
 	 * Set the default shell.
 	 */
 	if ((NULL == shellstr) || ('\0' == shellstr[0])) {
-		shellstr = "/bin/sh";
+		shellstr = SHELL;
 	}
 
 	(void) signal (SIGINT, SIG_IGN);




More information about the Pkg-shadow-commits mailing list