diff options
Diffstat (limited to 'debian/patches/523_su_arguments_are_concatenated')
-rw-r--r-- | debian/patches/523_su_arguments_are_concatenated | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/debian/patches/523_su_arguments_are_concatenated b/debian/patches/523_su_arguments_are_concatenated deleted file mode 100644 index 0abc4c5f..00000000 --- a/debian/patches/523_su_arguments_are_concatenated +++ /dev/null @@ -1,48 +0,0 @@ -Goal: Concatenate the non-su arguments and provide them to the shell with - the -c option -Fixes: #317264 - see also #276419 - -Status wrt upstream: This is a Debian specific patch. - -Note: the fix of the man page is still missing. - (to be taken from the trunk) - ---- a/src/su.c -+++ b/src/su.c -@@ -1150,6 +1150,35 @@ - argv[0] = "-c"; - argv[1] = command; - } -+ /* On Debian, the arguments are concatenated and the -+ * resulting string is always given to the shell with its -+ * -c option. -+ */ -+ { -+ char **parg; -+ unsigned int cmd_len = 0; -+ char *cmd = NULL; -+ if (strcmp(argv[0], "-c") != 0) { -+ argv--; -+ argv[0] = "-c"; -+ } -+ /* Now argv[0] is always -c, and other arguments -+ * can be concatenated -+ */ -+ cmd_len = 1; /* finale '\0' */ -+ for (parg = &argv[1]; *parg; parg++) { -+ cmd_len += strlen (*parg) + 1; -+ } -+ cmd = (char *) xmalloc (sizeof (char) * cmd_len); -+ cmd[0] = '\0'; -+ for (parg = &argv[1]; *parg; parg++) { -+ strcat (cmd, " "); -+ strcat (cmd, *parg); -+ } -+ cmd[cmd_len - 1] = '\0'; -+ argv[1] = &cmd[1]; /* do not take first space */ -+ argv[2] = NULL; -+ } - /* - * Use the shell and create an argv - * with the rest of the command line included. |