[Pkg-shadow-commits] r3035 - in upstream/trunk: . libmisc src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Wed Jul 22 13:35:58 UTC 2009
Author: nekral-guest
Date: 2009-07-22 13:35:57 +0000 (Wed, 22 Jul 2009)
New Revision: 3035
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/shell.c
upstream/trunk/src/su.c
Log:
* libmisc/shell.c, src/su.c: Execute the scripts with "sh -"
rather than "sh".
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-07-22 13:30:06 UTC (rev 3034)
+++ upstream/trunk/ChangeLog 2009-07-22 13:35:57 UTC (rev 3035)
@@ -1,5 +1,10 @@
2009-07-22 Nicolas François <nicolas.francois at centraliens.net>
+ * libmisc/shell.c, src/su.c: Execute the scripts with "sh -"
+ rather than "sh".
+
+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.
Modified: upstream/trunk/libmisc/shell.c
===================================================================
--- upstream/trunk/libmisc/shell.c 2009-07-22 13:30:06 UTC (rev 3034)
+++ upstream/trunk/libmisc/shell.c 2009-07-22 13:35:57 UTC (rev 3035)
@@ -85,7 +85,7 @@
* Assume this is a shell script (with no shebang).
* Interpret it with /bin/sh
*/
- execle (SHELL, "sh", file, (char *)0, envp);
+ execle (SHELL, "sh", "-", file, (char *)0, envp);
err = errno;
}
Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c 2009-07-22 13:30:06 UTC (rev 3034)
+++ upstream/trunk/src/su.c 2009-07-22 13:35:57 UTC (rev 3035)
@@ -194,12 +194,13 @@
while (NULL != args[n_args]) {
n_args++;
}
- targs = (char **) xmalloc ((n_args + 2) * sizeof (args[0]));
+ targs = (char **) xmalloc ((n_args + 3) * sizeof (args[0]));
targs[0] = "sh";
- targs[1] = xstrdup (shellstr);
- targs[n_args+1] = NULL;
+ targs[1] = "-";
+ targs[2] = xstrdup (shellstr);
+ targs[n_args+2] = NULL;
while (1 != n_args) {
- targs[n_args] = args[n_args - 1];
+ targs[n_args+1] = args[n_args - 1];
n_args--;
}
More information about the Pkg-shadow-commits
mailing list