summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-13 19:50:52 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-13 19:50:52 +0000
commitbc9dbeed5aae44d969a3a4b87318dbddbec7f4b9 (patch)
tree9fde04dbf57ab85a6c33a3e3e592b117ddb6cd7c /bin/misc-functions.sh
parent678d56c57b955deb5451298ef2910d2000f7b7bb (diff)
downloadportage-bc9dbeed5aae44d969a3a4b87318dbddbec7f4b9.tar.gz
portage-bc9dbeed5aae44d969a3a4b87318dbddbec7f4b9.tar.bz2
portage-bc9dbeed5aae44d969a3a4b87318dbddbec7f4b9.zip
simplify unsafe file checking so files/paths with spaces dont cause troubles (trunk r6391:6392)
svn path=/main/branches/2.1.2/; revision=6393
Diffstat (limited to 'bin/misc-functions.sh')
-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 1b22b2f6c..71137f244 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