aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage-funcs
diff options
context:
space:
mode:
authorkraai <kraai>2005-10-03 13:57:43 +0000
committerkraai <kraai>2005-10-03 13:57:43 +0000
commit48d9b569689392c5a24f79cf31279118297ae6d5 (patch)
treed0cd2a6af875c4855b7f1380004a43a8a027fcb6 /pbuilder-buildpackage-funcs
parent3ca78410712f64606bd4f85e716798dca06ae6da (diff)
downloadpbuilder-48d9b569689392c5a24f79cf31279118297ae6d5.tar
pbuilder-48d9b569689392c5a24f79cf31279118297ae6d5.tar.gz
Don't add a redundant group, passwd, and shadow entries for the build user.
Diffstat (limited to 'pbuilder-buildpackage-funcs')
-rw-r--r--pbuilder-buildpackage-funcs16
1 files changed, 12 insertions, 4 deletions
diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index 093e053..fb888e8 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -81,10 +81,18 @@ function cowprotect () {
function createbuilduser () {
# create the build user
if [ -n "$SUTOUSER" ]; then
- cowprotect $BUILDPLACE/etc/passwd $BUILDPLACE/etc/group $BUILDPLACE/etc/shadow
- echo "$BUILDUSERNAME:x:$BUILDUSERID:$BUILDUSERID:,,,:/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd
- echo "$BUILDUSERNAME:*:$BUILDUSERID:" >> $BUILDPLACE/etc/group
- echo "$BUILDUSERNAME:!:::::::" >> $BUILDPLACE/etc/shadow
+ if ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/passwd; then
+ cowprotect $BUILDPLACE/etc/passwd
+ echo "$BUILDUSERNAME:x:$BUILDUSERID:$BUILDUSERID:,,,:/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd
+ fi
+ if ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/group; then
+ cowprotect $BUILDPLACE/etc/group
+ echo "$BUILDUSERNAME:*:$BUILDUSERID:" >> $BUILDPLACE/etc/group
+ fi
+ if ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/shadow; then
+ cowprotect $BUILDPLACE/etc/shadow
+ echo "$BUILDUSERNAME:!:::::::" >> $BUILDPLACE/etc/shadow
+ fi
unset LOGNAME || true
else
unset LOGNAME || true