Date: Sun, 16 Feb 2003 03:00:30 -0800 (PST) From: Paul Guyot <pguyot@kallisys.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: misc/48325: /etc/periodic/security/100.chksetuid doesn't work with spaces in mount points Message-ID: <20030216110030.B4B0A3DD@mail.continuity.cx>
next in thread | raw e-mail | index | archive | help
>Number: 48325
>Category: misc
>Synopsis: /etc/periodic/security/100.chksetuid doesn't work with spaces in mount points
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 16 03:00:30 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Paul Guyot
>Release: FreeBSD 4.7-STABLE i386
>Organization:
Kallisys
>Environment:
MacOS X
>Description:
If one has spaces in a mount point, then 100.chksetuid doesn't work (it fails for these mount points).
Having a space can occur on FreeBSD and is much more likely to happen on MacOS X where one just has to put a space in a volume's name.
Additionally, it doesn't handle hfs volumes.
>How-To-Repeat:
Create a UFS mount point with a space in its path (e.g. "/Volumes/Foo Bar") and then run periodic security.
>Fix:
Apply this patch:
--- 100.chksetuid.old Fri Oct 25 17:14:16 2002
+++ 100.chksetuid Sun Feb 16 11:43:59 2003
@@ -44,21 +44,13 @@
echo ""
echo 'Checking setuid files and devices:'
# XXX Note that there is the possibility of overrunning the args to ls
- MP=`mount -t ufs | grep -v " nosuid" | awk '{ print $3 }' | sort`
- if [ -n "${MP}" ]
- then
- set ${MP}
- while [ $# -ge 1 ]; do
- mount=$1
- shift
- find $mount -xdev -type f \
- \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
- \( -perm -u+s -or -perm -g+s \) -print0
- done | xargs -0 -n 20 ls -liTd | sed 's/^ *//' | sort -k 11 |
+ (mount -t hfs && mount -t ufs) | grep -v " nosuid" |
+ sed -n -e 's/^.* on \(.*\) (.*local.*)/\1/p' |
+ awk '{ printf "find \"%s\" -xdev -type f \\( -perm -u+x -or -perm -g+x -or -perm -o+x \\) \\( -perm -u+s -or -perm -g+s \\) -print0\n", $0 }' |
+ sort | sh | xargs -0 -n 20 ls -liTd | sed 's/^ *//' | sort -k 11 |
check_diff setuid - "${host} setuid diffs:"
- rc=$?
- fi;;
+ rc=$?;;
*) rc=0;;
esac
-exit $rc
+exit $rc
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030216110030.B4B0A3DD>
