aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-05-28 20:49:08 +0900
committerJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-05-28 20:49:08 +0900
commit2038380f92defbbba1c9804eaa3245f6b6a00971 (patch)
tree87e0bf8c0f4e00e3399d6d6200b69230fc80b4e4
parent0755365a36c322d82139e2b89ccf61f5a6e83621 (diff)
downloadpbuilder-2038380f92defbbba1c9804eaa3245f6b6a00971.tar
pbuilder-2038380f92defbbba1c9804eaa3245f6b6a00971.tar.gz
398865: apply patch for LOGNAME, and implement also shadow group file
-rw-r--r--debian/changelog5
-rwxr-xr-xpbuilder-buildpackage2
-rw-r--r--pbuilder-buildpackage-funcs12
3 files changed, 13 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 8212c79..2b55758 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
pbuilder (0.168) UNRELEASED; urgency=low
- * set LOGNAME when build user is created within chroot.
+ * Bug fix: "Fix user/group name resolution inside chroot", thanks to
+ Anderson Lizardo (Closes: #398865).
* do not always output 'Aborting with error' on create/update (bug
introduced in 0.167)
* fix man pages to have reference to pbuilder-doc.html, and fix home
@@ -9,7 +10,7 @@ pbuilder (0.168) UNRELEASED; urgency=low
* fix C10shell script to work with the new 'tee' log mode.
(add '2> /dev/tty')
- -- Junichi Uekawa <dancer@debian.org> Mon, 28 May 2007 20:30:07 +0900
+ -- Junichi Uekawa <dancer@debian.org> Mon, 28 May 2007 20:36:43 +0900
pbuilder (0.167) unstable; urgency=low
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index becab23..18c781a 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -32,7 +32,7 @@ if [ ! -f "$PACKAGENAME" ]; then
fi;
if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
- SUTOUSER="su -p $BUILDUSERNAME"
+ SUTOUSER="env LOGNAME=$BUILDUSERNAME su -p $BUILDUSERNAME"
DEBBUILDOPTS="$DEBBUILDOPTS -rfakeroot"
EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
echo "I: using fakeroot in build."
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