[Pkg-shadow-commits] r292 - in trunk/debian: . patches

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Wed, 22 Jun 2005 19:52:42 +0000


Author: nekral-guest
Date: 2005-06-22 19:52:41 +0000 (Wed, 22 Jun 2005)
New Revision: 292

Added:
   trunk/debian/patches/423_su_pass_args_without_concatenation
Removed:
   trunk/debian/patches/357_su_pass_args_without_concatenation
Modified:
   trunk/debian/changelog
   trunk/debian/patches/series
Log:
Move 357 to 423 because it is currently not applied upstream.


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-06-22 07:02:51 UTC (rev 291)
+++ trunk/debian/changelog	2005-06-22 19:52:41 UTC (rev 292)
@@ -58,7 +58,7 @@
       Document the system user range from 0 to 999 in Debian
       Closes: #286258
   * Upstream bugs not fixed in upstream releases or CVS:
-    - 357_su_pass_args_without_concatenation
+    - 423_su_pass_args_without_concatenation
       Thanks to Helmut Waitzmann.
       Closes: #276419
       * pass the argument to the shell or command without concatenation

Deleted: trunk/debian/patches/357_su_pass_args_without_concatenation
===================================================================
--- trunk/debian/patches/357_su_pass_args_without_concatenation	2005-06-22 07:02:51 UTC (rev 291)
+++ trunk/debian/patches/357_su_pass_args_without_concatenation	2005-06-22 19:52:41 UTC (rev 292)
@@ -1,108 +0,0 @@
-Goal: * pass the argument to the shell or command without concatenation
-        before the call to exec.
-        (su --shell=/bin/sh -c 'printf :%q:\\n ${1+"$@"}' "$USER" sh a "b\'c" d)
-      * If no command is provided, the arguments after the username are for the shell,
-        no -c has to be appended.
-        (su -- - "$LOGNAME" -x)
-      * The submitter also reported some changes I consider being only aesthetical (only
-        malloc the exact number of elements)
-      * He also proposed another patch that would change the return type of
-        "elements" to size_t instead of int. But I did not included this one.
-Fixes: #276419
-
-Status wrt upstream: Upstream should be checked. Only in regard to the
-                     second issue (run_shell in upstream is quite different
-                     and don't suffer from the first point and don't have
-                     "elements" function, which voids the last two points)
-
-Index: shadow-4.0.3/src/su.c
-===================================================================
---- shadow-4.0.3.orig/src/su.c	2005-06-20 23:28:48.000000000 +0200
-+++ shadow-4.0.3/src/su.c	2005-06-21 20:49:22.128723000 +0200
-@@ -172,8 +172,9 @@
- {
-   int n = 0;
- 
--  for (n = 0; *arr; ++arr)
--    ++n;
-+  if (arr)
-+    for (n = 0; *arr; ++arr)
-+      ++n;
-   return n;
- }
- 
-@@ -183,16 +184,25 @@
- {
-   const char **args;
-   int argno = 1;
--  char cmd[BUFSIZ];
--  int cmd_len_left = sizeof(cmd) - 1;
- 
--  cmd[0] = '\0';
--
--  if (additional_args)
--    args = (const char **) xmalloc (sizeof (char *)
--                                    * (10 + elements (additional_args)));
--  else
--    args = (const char **) xmalloc (sizeof (char *) * 10);
-+  /* Allocate 2 up to 4 more slots for the argument vector than there are
-+     additional args:
-+     1 for args[0],
-+     2 (optional) for a commandline, preceded with "-c",
-+     1 for the args[]-terminating NULL entry.
-+   */
-+  args = (const char **)
-+    xmalloc (
-+      sizeof (char *) *
-+      (
-+	1 /* args[0] */
-+	+
-+	(command ? 2 : 0) /* "-c" "commandline", if supplied */
-+	+
-+	elements (additional_args) /* number of additional args: */
-+	+
-+	1 /* the terminating NULL entry */
-+      ));
- 
-   if (login)
-     {
-@@ -210,30 +220,17 @@
-     }
-   else
-     args[0] = Basename(shell);
--  if (command || additional_args)
--    args[argno++] = "-c";
--  if (command) {
--    if (strlen(command) > cmd_len_left) {
--      fprintf(stderr, _("Command line args too long\n"));
--      exit(1);
-+  if (command)
-+    { /* A command option "-c" or "--command" has been supplied.  Insert
-+       * "-c" and its option argument, i.e. the commandline, into the
-+       * argument vector.
-+       */
-+      args[argno++] = "-c";
-+      args[argno++] = command;
-     }
--    strcat(cmd, command);
--    cmd_len_left -= strlen(command);
--  }
-   if (additional_args)
--    for (; *additional_args; ++additional_args) {
--      if ((strlen(*additional_args) + 1) > cmd_len_left) {
--	fprintf(stderr, _("Command line args too long\n"));
--	exit(1);
--      }
--      if (cmd[0]) {
--	strcat(cmd, " ");
--	cmd_len_left--;
--      }
--      strcat(cmd, *additional_args);
--      cmd_len_left -= strlen(*additional_args);
--    }
--  if (cmd[0]) args[argno++] = cmd;
-+    for (; *additional_args; ++additional_args)
-+      args[argno++] = *additional_args;
-   args[argno] = NULL;
-   execv (shell, (char **) args);
-   fprintf (stderr, _("No shell\n"));

Copied: trunk/debian/patches/423_su_pass_args_without_concatenation (from rev 286, trunk/debian/patches/357_su_pass_args_without_concatenation)

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-06-22 07:02:51 UTC (rev 291)
+++ trunk/debian/patches/series	2005-06-22 19:52:41 UTC (rev 292)
@@ -122,4 +122,4 @@
 422_getdate.c_generated_file
 010_more-i18ned-messages
 356_su-stop_cont-proxy
-357_su_pass_args_without_concatenation
+423_su_pass_args_without_concatenation