From 33cbe10c36728ad75935a39ac1955bf68b7624ed Mon Sep 17 00:00:00 2001 From: lool Date: Fri, 3 Nov 2006 17:45:01 +0000 Subject: * pdebuild-internal: install the passwd package before calling groupadd and useradd; restore it's installation state after groupadd and useradd. --- pdebuild-internal | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pdebuild-internal') diff --git a/pdebuild-internal b/pdebuild-internal index 91ce3fb..32a2012 100644 --- a/pdebuild-internal +++ b/pdebuild-internal @@ -73,9 +73,20 @@ export PBCURRENTCOMMANDLINEOPERATION="pdebuild" /usr/lib/pbuilder/pbuilder-satisfydepends apt-get install -y --force-yes fakeroot -# create the user similar to that used outside +# we will need "passwd" for groupadd/useradd, retain whether it was installed +# warning: dpkg --get-selections returns true for unknown packages +PASSWD_SELECTION="$(LC_ALL=C dpkg --get-selections passwd && true)" +if [ -z "$PASSWD_SELECTION" ]; then + PASSWD_SELECTION="passwd purge" +fi +# install passwd +apt-get install -y --force-yes passwd +# create the user similar to that used outside groupadd -g "${BUILDRESULTGID}" -o pbgroup useradd -g pbgroup -u "${BUILDRESULTUID}" -o pbuser +# restore the state of the passwd package +echo "$PASSWD_SELECTION" | LC_ALL=C dpkg --set-selections +apt-get dselect-upgrade -u -y --force-yes # what about id -G output? if other groups than the designated is used, we're stuffed. -- cgit v1.2.3