commit: 095f4b4daf6029369c5d5ed308607c8b1e45276d Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Tue Mar 31 17:08:26 2020 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Tue Mar 31 17:08:26 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=095f4b4d
scripts/bootstrap-prefix: check ownership of $EPREFIX dir, bug #715312 Closes: https://bugs.gentoo.org/715312 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> scripts/bootstrap-prefix.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 5eca478c5a..25e091c37a 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -2714,10 +2714,20 @@ EOF EPREFIX= continue fi + if [[ $(stat -c '%U/%G' "${EPREFIX}"/.canihaswrite) != \ + $(stat -c '%U/%G' "${EPREFIX}") ]] ; + then + echo + echo "The $EPREFIX directory has different ownership than expected." + echo "Ensure the directory is owned (user and group) by your" + echo "primary ids" + EPREFIX= + continue + fi # don't really expect this one to fail rm -f "${EPREFIX}"/.canihaswrite || exit 1 # location seems ok - break; + break done export STAGE1_PATH=${PATH} export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$EPREFIX/tmp/usr/local/bin:${PATH}"
