aboutsummaryrefslogtreecommitdiff
path: root/pdebuild-internal
diff options
context:
space:
mode:
authorlool <lool>2006-11-03 17:45:01 +0000
committerlool <lool>2006-11-03 17:45:01 +0000
commit33cbe10c36728ad75935a39ac1955bf68b7624ed (patch)
treeb129c37478880ecfc7603b82024fe46905e6d77c /pdebuild-internal
parentd374518ca3ffb0bad1b4eb7e315c2c34176047bc (diff)
downloadpbuilder-33cbe10c36728ad75935a39ac1955bf68b7624ed.tar
pbuilder-33cbe10c36728ad75935a39ac1955bf68b7624ed.tar.gz
* pdebuild-internal: install the passwd package before calling
groupadd and useradd; restore it's installation state after groupadd and useradd.
Diffstat (limited to 'pdebuild-internal')
-rw-r--r--pdebuild-internal13
1 files changed, 12 insertions, 1 deletions
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.