[Pkg-shadow-devel] Bug#317264: login: Current su breaks pbuilder

Aurelien Jarno Aurelien Jarno <aurelien@aurel32.net>, 317264@bugs.debian.org
Thu, 7 Jul 2005 17:18:19 +0200


--huq684BweRXVnRxX
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

On Thu, Jul 07, 2005 at 12:37:17PM +0200, Nicolas François wrote:
> Hello Daniel,
> 
> This was introduced by the patch for #276419, which I still approve.
> Here is a fix for pbuilder.
It doesn't work.

> (I'm CCing the pbuilder maintainer to have his opinion, before reassigning
> this bug to pbuilder)
> 
> Note: This may require a versioned dependancy.
> 
> ("su <user> -- arg1 arg2" used to run "<shell> -c arg1 arg2" and it now
> launch "<shell> arg1 arg2", so a pbuilder with this patch and an old su
> will run "<shell> -c -c arg1 arg2", which is not an issue for bash, but
> may be annoying for another shell)

Actually 'su <user> -- arg1 arg2' used to run '<shell> -c "arg1 arg2"'
(ie arg1 and arg2 are grouped as one argument) and now it runs '<shell>
arg1 arg2' and '<shell> -c arg1 arg2' with your patch.

That's why your patch doesn't work as arg2 is ignored.

Please find attached a new patch that works with both the old and new
version of su (it is not possible to have a versioned dependency as it
is the su from inside the chroot which is called).

Bye,
Aurelien

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--huq684BweRXVnRxX
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: attachment; filename="pbuilder-buildpackage.patch"

--- pbuilder-buildpackage.orig	2005-07-02 08:33:47.000000000 +0200
+++ pbuilder-buildpackage	2005-07-07 17:11:10.190515660 +0200
@@ -32,7 +32,7 @@
 fi;
 
 if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
-    SUTOUSER="su -p $BUILDUSERNAME -- "
+    SUTOUSER="su -p $BUILDUSERNAME -c "
     DEBBUILDOPTS="$DEBBUILDOPTS -rfakeroot"
     EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
     echo "I: using fakeroot in build."
@@ -81,7 +81,7 @@
 copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
 
 echo "Extracting source"
-if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME ../buildd *; $SUTOUSER /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then
+if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME ../buildd *; $SUTOUSER \"/usr/bin/dpkg-source -x $(basename $PACKAGENAME) \")"; then
     echo "pbuilder: Failed extracting the source" >&2 
     exit 1;
 fi

--huq684BweRXVnRxX--