summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-28 21:11:20 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-28 21:11:20 +0000
commitb5d41fb2875c7a167dcd310827740d6c3f615dbc (patch)
treeded756b65de1516bd0cea6e8ca6ef6cc37ffb373 /bin
parent0ad19b9350aa5b6b91b060b8caa0bd3582e4398e (diff)
downloadportage-b5d41fb2875c7a167dcd310827740d6c3f615dbc.tar.gz
portage-b5d41fb2875c7a167dcd310827740d6c3f615dbc.tar.bz2
portage-b5d41fb2875c7a167dcd310827740d6c3f615dbc.zip
Make the FEATURES=sfperms loops safe for whitespace in paths
by using find -print0 | while read -d $'\0'. (trunk r9083) svn path=/main/branches/2.1.2/; revision=9084
Diffstat (limited to 'bin')
-rwxr-xr-xbin/misc-functions.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 1395ff29c..3985a3af3 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -423,7 +423,8 @@ preinst_sfperms() {
# Smart FileSystem Permissions
if hasq sfperms $FEATURES; then
local i
- for i in $(find "${D}" -type f -perm -4000); do
+ find "${D}" -type f -perm -4000 -print0 | \
+ while read -d $'\0' i ; do
if [ -n "$(find "$i" -perm -2000)" ] ; then
ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${D}}"
chmod o-r "$i"
@@ -434,7 +435,8 @@ preinst_sfperms() {
eend $?
fi
done
- for i in $(find "${D}" -type f -perm -2000); do
+ find "${D}" -type f -perm -2000 -print0 | \
+ while read -d $'\0' i ; do
if [ -n "$(find "$i" -perm -4000)" ] ; then
# This case is already handled
# by the SetUID check above.