diff options
Diffstat (limited to 'pbuilder-buildpackage-funcs')
-rw-r--r-- | pbuilder-buildpackage-funcs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs index 62726b0..a36fcb4 100644 --- a/pbuilder-buildpackage-funcs +++ b/pbuilder-buildpackage-funcs @@ -82,19 +82,25 @@ function cowprotect () { function createbuilduser () { # create the build user, if it is necessary and specified. if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then + if [ -e $BUILDPLACE/etc/shadow ]; then p='x'; else p='*'; fi + if [ -e $BUILDPLACE/etc/gshadow ]; then g='x'; else g='*'; fi if ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/passwd; then cowprotect $BUILDPLACE/etc/passwd - echo "$BUILDUSERNAME:x:$BUILDUSERID:$BUILDUSERID:,,,:/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd + echo "$BUILDUSERNAME:$p:$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 + echo "$BUILDUSERNAME:$g:$BUILDUSERID:" >> $BUILDPLACE/etc/group fi if [ -e $BUILDPLACE/etc/shadow ] && ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/shadow; then cowprotect $BUILDPLACE/etc/shadow echo "$BUILDUSERNAME:!:::::::" >> $BUILDPLACE/etc/shadow fi - export LOGNAME="${BUILDUSERNAME}" + if [ -e $BUILDPLACE/etc/gshadow ] && ! grep -q ^$BUILDUSERNAME: $BUILDPLACE/etc/gshadow; then + cowprotect $BUILDPLACE/etc/gshadow + echo "$BUILDUSERNAME:!::" >> $BUILDPLACE/etc/gshadow + fi + unset LOGNAME || true else unset LOGNAME || true fi |