diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | pbuilder-buildpackage-funcs | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index a58262f..894b882 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +pbuilder (0.135) UNRELEASED; urgency=low + + [Matt Kraai] + * Don't add redundant group, passwd, and shadow entries for the build + user. + + -- Matt Kraai <kraai@debian.org> Mon, 3 Oct 2005 06:52:07 -0700 + pbuilder (0.134) unstable; urgency=low [Junichi Uekawa] 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 |