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

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Sat, 09 Jul 2005 23:56:02 +0000


Author: nekral-guest
Date: 2005-07-09 23:56:02 +0000 (Sat, 09 Jul 2005)
New Revision: 363

Added:
   trunk/debian/patches/423_su_arguments_are_concatenated
Modified:
   trunk/debian/changelog
   trunk/debian/patches/series
Log:
Revert patch for #276419 and document Debian's su behavior.


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-07-09 23:05:21 UTC (rev 362)
+++ trunk/debian/changelog	2005-07-09 23:56:02 UTC (rev 363)
@@ -27,6 +27,11 @@
       Closes: #317012
     - grpck/pwck: fix segmentation faults
       Closes: #317366
+    - revert the patch done for #276419, because it breaks pbuilder and other
+      packages.  Also document the Debian su behavior.
+      su behave differently from FreeBSD or SUN; this issue will have to be
+      handled latter (re-open #276419).
+      Closes: #317264
 
  -- Christian Perrier <bubulle@debian.org>  Wed,  6 Jul 2005 03:13:37 +0300
 

Added: trunk/debian/patches/423_su_arguments_are_concatenated
===================================================================
--- trunk/debian/patches/423_su_arguments_are_concatenated	2005-07-09 23:05:21 UTC (rev 362)
+++ trunk/debian/patches/423_su_arguments_are_concatenated	2005-07-09 23:56:02 UTC (rev 363)
@@ -0,0 +1,61 @@
+Goal: document in the source and man pages why the arguments are
+      concatenated and why they are always provided to the shell with the
+      -c option of that shell.
+Fixes: #317264
+       see also #276419
+
+Status wrt upstream: This is a Debian specific patch
+
+Index: shadow-4.0.3/src/su.c
+===================================================================
+--- shadow-4.0.3.orig/src/su.c	2005-07-10 01:50:31.000000000 +0300
++++ shadow-4.0.3/src/su.c	2005-07-10 02:42:48.000000000 +0300
+@@ -210,6 +210,15 @@
+     }
+   else
+     args[0] = Basename(shell);
++  /**
++   * If some arguments are provided (even without a -c), we use the -c
++   * option of the shell.
++   *
++   * This differs from FreeBSD's or SUN's su.
++   *
++   * If you want to supply arguments to the shell, you will need to put
++   * the shell with its arguments in the command.
++   */
+   if (command || additional_args)
+     args[argno++] = "-c";
+   if (command) {
+@@ -220,6 +229,15 @@
+     strcat(cmd, command);
+     cmd_len_left -= strlen(command);
+   }
++  /**
++   * Arguments are concatenated because the the shell requires the command
++   * to be specified in one argument following -c.
++   *
++   * This differs from at least FreeBSD's or SUN's su.
++   *
++   * If you need to supply separated arguments to the shell, then put
++   * the shell and its arguments in the command line.
++   */
+   if (additional_args)
+     for (; *additional_args; ++additional_args) {
+       if ((strlen(*additional_args) + 1) > cmd_len_left) {
+Index: shadow-4.0.3/man/su.1
+===================================================================
+--- shadow-4.0.3.orig/man/su.1	2005-07-10 02:31:34.000000000 +0300
++++ shadow-4.0.3/man/su.1	2005-07-10 02:42:24.000000000 +0300
+@@ -48,8 +48,10 @@
+ An optional command can be executed. This is done by the shell specified
+ in \fI/etc/passwd\fR for the target user unless the \fB-s\fR or \fB-m\fR
+ options are used.  Any arguments supplied after the \fBusername\fR will be
+-passed to the invoked shell (shell must support the -c command line
+-option in order for a command to be passed to it).
++concatenated in a single command and passed to the invoked shell with the
++\fB\-c\fR option of that shell.
++If you want to provide separated arguments to the shell, you can supply
++\fBexec <shell> <arguments>\fR as the command.
+ .PP
+ Unless the \fB-m\fR or \fB-p\fR options are used, the current environment is
+ passed to the new shell with alterations.  The value of \fB$PATH\fR is

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-07-09 23:05:21 UTC (rev 362)
+++ trunk/debian/patches/series	2005-07-09 23:56:02 UTC (rev 363)
@@ -121,7 +121,9 @@
 422_getdate.c_generated_file
 010_more-i18ned-messages
 356_su-stop_cont-proxy
-423_su_pass_args_without_concatenation
+# NOTE: you must use only one of these 423
+423_su_arguments_are_concatenated
+# 423_su_pass_args_without_concatenation
 424_pwck.8_quiet_option
 425_lastlog_8_sparse
 357_newgrp-stop_cont-proxy