summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-04-13 19:19:25 +0000
committerMike Frysinger <vapier@gentoo.org>2007-04-13 19:19:25 +0000
commitb6b6e08774bd428b9490b1585e3e05abd83ec7b1 (patch)
treecbf7cd132100f3d4c4ae59715520ef9a897a77a4 /bin
parentae214443f004c3ba11d9fba148fb4e6a0f50c4d4 (diff)
downloadportage-b6b6e08774bd428b9490b1585e3e05abd83ec7b1.tar.gz
portage-b6b6e08774bd428b9490b1585e3e05abd83ec7b1.tar.bz2
portage-b6b6e08774bd428b9490b1585e3e05abd83ec7b1.zip
simplify unsafe file checking so files/paths with spaces dont cause troubles
svn path=/main/trunk/; revision=6392
Diffstat (limited to 'bin')
-rwxr-xr-xbin/misc-functions.sh19
1 files changed, 5 insertions, 14 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c5e74dff4..51c52c3e0 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -45,18 +45,6 @@ install_qa_check() {
cd "${D}" || die "cd failed"
prepall
- declare -i UNSAFE=0
- for i in $(find "${D}/" -type f -perm -2002); do
- ((UNSAFE++))
- vecho "UNSAFE SetGID: $i"
- chmod -s,o-w "$i"
- done
- for i in $(find "${D}/" -type f -perm -4002); do
- ((UNSAFE++))
- vecho "UNSAFE SetUID: $i"
- chmod -s,o-w "$i"
- done
-
# Now we look for all world writable files.
for i in $(find "${D}/" -type f -perm -2); do
vecho -ne '\a'
@@ -199,8 +187,11 @@ install_qa_check() {
PORTAGE_QUIET=${tmp_quiet}
fi
- if [[ ${UNSAFE} > 0 ]] ; then
- die "There are ${UNSAFE} unsafe files. Portage will not install them."
+ local unsafe_files=$(find "${D}" -type f '(' -perm -2002 -o -perm -4002 ')')
+ if [[ -n ${unsafe_files} ]] ; then
+ eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"
+ eqawarn "${unsafe_files}"
+ die "Unsafe files found in \${D}. Portage will not install them."
fi
if [[ -d ${D}/${D} ]] ; then