diff options
author | dancer <dancer> | 2005-07-13 22:02:20 +0000 |
---|---|---|
committer | dancer <dancer> | 2005-07-13 22:02:20 +0000 |
commit | 417fe5eb1c122390ca9e9ed41fc3aa2786b24248 (patch) | |
tree | 27c92d09cba50450a90e9c57f45f6bbbe18500e3 /pbuilder-buildpackage | |
parent | 529189bf4f365be70fc15ba369440855f80a5cce (diff) | |
download | pbuilder-417fe5eb1c122390ca9e9ed41fc3aa2786b24248.tar pbuilder-417fe5eb1c122390ca9e9ed41fc3aa2786b24248.tar.gz |
* pbuilder-buildpackage: change the use of su, to
allow su design change. Bug: 317264
Diffstat (limited to 'pbuilder-buildpackage')
-rwxr-xr-x | pbuilder-buildpackage | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 2d6a7b2..71c2c91 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -31,14 +31,15 @@ if [ ! -f "$PACKAGENAME" ]; then exit 1; fi; +# due to if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then - SUTOUSER="su -p $BUILDUSERNAME -- " + SUTOUSER="su -p $BUILDUSERNAME" DEBBUILDOPTS="$DEBBUILDOPTS -rfakeroot" EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot" echo "I: using fakeroot in build." else # run the build in root - SUTOUSER="" + SUTOUSER="su " BUILDUSERID=0 BUILDUSERNAME=root fi @@ -81,7 +82,15 @@ echo "Copying source file" 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 echo "chown $BUILDUSERNAME:$BUILDUSERNAME /tmp/buildd /tmp/buildd/*" | $CHROOTEXEC /bin/bash; then + : # success +else + echo "pbuilder: Failed chowning to $BUILDUSERNAME:$BUILDUSERNAME" >&2 + exit 1; +fi +if echo "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" | $CHROOTEXEC $SUTOUSER ; then + : # success +else echo "pbuilder: Failed extracting the source" >&2 exit 1; fi @@ -98,7 +107,7 @@ fi ( : Build process - echo "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER /bin/bash + echo "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER ) & BUILD_PID=$! if [ -n "${TIMEOUT_TIME}" ]; then |