Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9423 - main/trunk/bin
Date: Mon, 03 Mar 2008 19:21:16
Message-Id: E1JWGDp-0006uZ-0Y@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-03 19:21:11 +0000 (Mon, 03 Mar 2008)
3 New Revision: 9423
4
5 Modified:
6 main/trunk/bin/misc-functions.sh
7 Log:
8 Buf #210372 - Fix FEATURES=suidctl so that it really works again.
9
10
11 Modified: main/trunk/bin/misc-functions.sh
12 ===================================================================
13 --- main/trunk/bin/misc-functions.sh 2008-03-03 10:25:40 UTC (rev 9422)
14 +++ main/trunk/bin/misc-functions.sh 2008-03-03 19:21:11 UTC (rev 9423)
15 @@ -490,6 +490,7 @@
16 fi
17 # total suid control.
18 if hasq suidctl $FEATURES; then
19 + local sfconf
20 sfconf=${PORTAGE_CONFIGROOT}etc/portage/suidctl.conf
21 # sandbox prevents us from writing directly
22 # to files outside of the sandbox, but this
23 @@ -498,19 +499,19 @@
24 vecho ">>> Performing suid scan in ${D}"
25 for i in $(find "${D}" -type f \( -perm -4000 -o -perm -2000 \) ); do
26 if [ -s "${sfconf}" ]; then
27 - suid="$(grep "^/${i#${D}}$" "${sfconf}")"
28 - if [ "${suid}" = "${i/${D}}" ]; then
29 - vecho "- ${i/${D}} is an approved suid file"
30 + install_path=/${i#${D}}
31 + if grep -q "^${install_path}\$" "${sfconf}" ; then
32 + vecho "- ${install_path} is an approved suid file"
33 else
34 - vecho ">>> Removing sbit on non registered ${i/${D}}"
35 + vecho ">>> Removing sbit on non registered ${install_path}"
36 for x in 5 4 3 2 1 0; do echo -ne "\a"; sleep 0.25 ; done
37 vecho -ne "\a"
38 ls_ret=$(ls -ldh "${i}")
39 chmod ugo-s "${i}"
40 - grep "^#${i/${D}}$" "${sfconf}" > /dev/null || {
41 + grep "^#${install_path}$" "${sfconf}" > /dev/null || {
42 vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
43 - echo "## ${ls_ret%${D}*}${ls_ret#*${D}}" >> "${sfconf}"
44 - echo "#${i/${D}}" >> "${sfconf}"
45 + echo "## ${ls_ret%${D}*}${install_path}" >> "${sfconf}"
46 + echo "#${install_path}" >> "${sfconf}"
47 # no delwrite() eh?
48 # delwrite ${sconf}
49 }
50
51 --
52 gentoo-commits@l.g.o mailing list