From 648036fcdc9e49e7518facf2b1a516d020ce4723 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Tue, 15 Dec 2009 08:14:21 +0000 Subject: [PATCH] fix etc-update trying to chown the tempdir to a group that requires root privileges svn path=/main/branches/prefix/; revision=15095 --- bin/etc-update | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/etc-update b/bin/etc-update index 968b2be9d..d927accfb 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -514,7 +514,12 @@ 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 +# GID need not to be available, and group 0 is not cool when not being +# root, hence just rely on mkdir to have created a dir which is owned by +# the user +if [[ -z ${UID} || ${UID} == 0 ]] ; then + chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership on temp dir" 1 +fi # I need the CONFIG_PROTECT value #CONFIG_PROTECT=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT) -- 2.26.2