summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-28 21:10:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-28 21:10:25 +0000
commit8970d4fc1446536cefa4f9076ce107e2d2f4b020 (patch)
treeaf6c0614b5acf30391030a3761c34c765815414b /bin/misc-functions.sh
parenta5fbe42b9cd508dcd829c9ccbb73f975a4d31db5 (diff)
downloadportage-8970d4fc1446536cefa4f9076ce107e2d2f4b020.tar.gz
portage-8970d4fc1446536cefa4f9076ce107e2d2f4b020.tar.bz2
portage-8970d4fc1446536cefa4f9076ce107e2d2f4b020.zip
Make the FEATURES=sfperms loops safe for whitespace in paths
by using find -print0 | while read -d $'\0'. svn path=/main/trunk/; revision=9083
Diffstat (limited to 'bin/misc-functions.sh')
-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 d293fd769..6c34fd044 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -430,7 +430,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"
@@ -441,7 +442,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.