summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-03 19:21:11 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-03 19:21:11 +0000
commita310f282fb18b6385f386830bf4aa36fe16b41cf (patch)
tree32bcafda47207282096498ebd726bfb2f8334e00 /bin/misc-functions.sh
parentBug #211949 - Tweak the regex so that a leading whitespace character (diff)
downloadportage-multirepo-a310f282fb18b6385f386830bf4aa36fe16b41cf.tar.gz
portage-multirepo-a310f282fb18b6385f386830bf4aa36fe16b41cf.tar.bz2
portage-multirepo-a310f282fb18b6385f386830bf4aa36fe16b41cf.zip
Buf #210372 - Fix FEATURES=suidctl so that it really works again.
svn path=/main/trunk/; revision=9423
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 67eaa292..3ccb7e7b 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -490,6 +490,7 @@ preinst_suid_scan() {
fi
# total suid control.
if hasq suidctl $FEATURES; then
+ local sfconf
sfconf=${PORTAGE_CONFIGROOT}etc/portage/suidctl.conf
# sandbox prevents us from writing directly
# to files outside of the sandbox, but this
@@ -498,19 +499,19 @@ preinst_suid_scan() {
vecho ">>> Performing suid scan in ${D}"
for i in $(find "${D}" -type f \( -perm -4000 -o -perm -2000 \) ); do
if [ -s "${sfconf}" ]; then
- suid="$(grep "^/${i#${D}}$" "${sfconf}")"
- if [ "${suid}" = "${i/${D}}" ]; then
- vecho "- ${i/${D}} is an approved suid file"
+ install_path=/${i#${D}}
+ if grep -q "^${install_path}\$" "${sfconf}" ; then
+ vecho "- ${install_path} is an approved suid file"
else
- vecho ">>> Removing sbit on non registered ${i/${D}}"
+ vecho ">>> Removing sbit on non registered ${install_path}"
for x in 5 4 3 2 1 0; do echo -ne "\a"; sleep 0.25 ; done
vecho -ne "\a"
ls_ret=$(ls -ldh "${i}")
chmod ugo-s "${i}"
- grep "^#${i/${D}}$" "${sfconf}" > /dev/null || {
+ grep "^#${install_path}$" "${sfconf}" > /dev/null || {
vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
- echo "## ${ls_ret%${D}*}${ls_ret#*${D}}" >> "${sfconf}"
- echo "#${i/${D}}" >> "${sfconf}"
+ echo "## ${ls_ret%${D}*}${install_path}" >> "${sfconf}"
+ echo "#${install_path}" >> "${sfconf}"
# no delwrite() eh?
# delwrite ${sconf}
}