- only use PORTAGE_TMPDIR /after/ it is set
authorFabian Groffen <grobian@gentoo.org>
Sat, 29 Sep 2007 21:11:52 +0000 (21:11 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 29 Sep 2007 21:11:52 +0000 (21:11 -0000)
- don't chown ${TMP} to what in theory should be our own, especially
  since GID isn't set.

svn path=/main/branches/prefix/; revision=7888

bin/etc-update

index a59227c3660b5417faa43911a39f6eb495a9665c..3df45a62b725389e5378b79cdcdbab600de8c01c 100755 (executable)
@@ -456,7 +456,6 @@ function die() {
 #
 scriptname=$(basename $0)
 
-TMP="${PORTAGE_TMPDIR}/etc-update-$$"
 trap die term
 
 type portageq > /dev/null || exit $?
@@ -465,6 +464,8 @@ eval $(portageq envvar -v CONFIG_PROTECT \
 export PORTAGE_TMPDIR
 export EROOT=${ROOT%/}${EPREFIX}/
 
+TMP="${PORTAGE_TMPDIR}/etc-update-$$"
+
 # quick hack to get prefix support in
 PORTAGE_CONFIGROOT=${PORTAGE_CONFIGROOT}${EPREFIX}/
 
@@ -478,7 +479,6 @@ rm -rf "${TMP}" 2> /dev/null
 mkdir "${TMP}" || die "failed to create temp dir" 1
 # make sure we have a secure directory to work in
 chmod 0700 "${TMP}" || die "failed to set perms on temp dir" 1
-chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership on temp dir" 1
 
 # I need the CONFIG_PROTECT value
 #CONFIG_PROTECT=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT)