aboutsummaryrefslogtreecommitdiff
path: root/pdebuild-internal
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2009-12-05 12:10:32 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2009-12-05 12:10:32 +0900
commit88e0052c7362c2c2a7841579f007ccabeae27c49 (patch)
treead390947fa6e3ffc3a8b7b824439e13391ba8210 /pdebuild-internal
parentecb7c3dca0ece8b7a1a0da368b00d7b67eac0ccb (diff)
downloadpbuilder-88e0052c7362c2c2a7841579f007ccabeae27c49.tar
pbuilder-88e0052c7362c2c2a7841579f007ccabeae27c49.tar.gz
pdebuild-internal make HOME set to non-relative path. (closes: #492898)
Diffstat (limited to 'pdebuild-internal')
-rw-r--r--pdebuild-internal16
1 files changed, 11 insertions, 5 deletions
diff --git a/pdebuild-internal b/pdebuild-internal
index 173bfb9..5b77a32 100644
--- a/pdebuild-internal
+++ b/pdebuild-internal
@@ -102,12 +102,18 @@ export PBCURRENTCOMMANDLINEOPERATION="pdebuild"
"$PBUILDERSATISFYDEPENDSCMD"
apt-get install -q -y --force-yes fakeroot
-# create the user similar to that used outside
-groupadd -g "${BUILDRESULTGID}" -o pbgroup
-useradd -g pbgroup -u "${BUILDRESULTUID}" -o pbuser
-# what about id -G output? if other groups than the designated is used, we're stuffed.
-export HOME=$(pwd)/../
+# set home directory to ..
+export HOME=$(readlink -f $(pwd)/../)
+if [ -z "${HOME}" ]; then
+ echo "E: Failed to obtain reasonable HOME from pwd"
+fi
+
+# create the user similar to that used outside.
+# TODO: what about id -G output? if other groups than the designated
+# is used, we're stuffed.
+groupadd -g "${BUILDRESULTGID}" -o pbgroup
+useradd -g pbgroup -u "${BUILDRESULTUID}" -d "${HOME}" -o pbuser
executehooks "A"