diff options
author | Junichi Uekawa <dancer@dancer64.netfort.gr.jp> | 2007-05-28 20:49:08 +0900 |
---|---|---|
committer | Junichi Uekawa <dancer@dancer64.netfort.gr.jp> | 2007-05-28 20:49:08 +0900 |
commit | 2038380f92defbbba1c9804eaa3245f6b6a00971 (patch) | |
tree | 87e0bf8c0f4e00e3399d6d6200b69230fc80b4e4 /pbuilder-buildpackage-funcs | |
parent | 0755365a36c322d82139e2b89ccf61f5a6e83621 (diff) | |
download | pbuilder-2038380f92defbbba1c9804eaa3245f6b6a00971.tar pbuilder-2038380f92defbbba1c9804eaa3245f6b6a00971.tar.gz |
398865: apply patch for LOGNAME, and implement also shadow group file
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 |