[Pkg-shadow-commits] r880 - trunk/debian/patches
Nicolas FRANCOIS
nekral-guest at costa.debian.org
Mon Feb 27 21:44:38 UTC 2006
Author: nekral-guest
Date: 2006-02-27 21:44:37 +0000 (Mon, 27 Feb 2006)
New Revision: 880
Added:
trunk/debian/patches/423_su_arguments_are_no_more_concatenated_by_default
Log:
Do not concatenate the additional arguments, and support an environment variable to revert to the old Debian's su behavior.
Added: trunk/debian/patches/423_su_arguments_are_no_more_concatenated_by_default
===================================================================
--- trunk/debian/patches/423_su_arguments_are_no_more_concatenated_by_default 2006-02-27 20:34:29 UTC (rev 879)
+++ trunk/debian/patches/423_su_arguments_are_no_more_concatenated_by_default 2006-02-27 21:44:37 UTC (rev 880)
@@ -0,0 +1,52 @@
+Goal: Do not concatenate the additional arguments, and support an
+ environment variable to revert to the old Debian's su behavior.
+
+This patch needs the su_arguments_are_concatenated patch.
+
+This patch, and su_arguments_are_concatenated should be dropped after
+Etch.
+
+Status wrt upstream: This patch is Debian specific.
+
+Index: shadow-4.0.14/src/su.c
+===================================================================
+--- shadow-4.0.14.orig/src/su.c 2006-02-27 20:44:34.000000000 +0100
++++ shadow-4.0.14/src/su.c 2006-02-27 21:15:39.000000000 +0100
+@@ -76,6 +76,19 @@
+ /* If nonzero, change some environment vars to indicate the user su'd to. */
+ static int change_environment;
+
++/*
++ * If nonzero, keep the old Debian behavior:
++ * * concatenate all the arguments and provide them to the -c option of
++ * the shell
++ * * If there are some additional arguments, but no -c, add a -c
++ * argument anyway
++ * Drawbacks:
++ * * you can't provide options to the shell (other than -c)
++ * * you can't rely on the argument count
++ * See http://bugs.debian.org/276419
++ */
++static int old_debian_behavior;
++
+ #ifdef USE_PAM
+ static pam_handle_t *pamh = NULL;
+ static int caught = 0;
+@@ -319,6 +332,8 @@
+ #endif
+ #endif /* !USE_PAM */
+
++ old_debian_behavior = (getenv("SU_NO_SHELL_ARGS") != NULL);
++
+ /* sanitize_env (); */
+
+ setlocale (LC_ALL, "");
+@@ -871,7 +886,7 @@
+ * resulted string is always given to the shell with its
+ * -c option.
+ */
+- {
++ if (old_debian_behavior) {
+ char **parg;
+ unsigned int cmd_len = 0;
+ char *cmd = NULL;
More information about the Pkg-shadow-commits
mailing list