From owner-freebsd-bugs Sun Feb 16 3: 0:34 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E66E237B406 for ; Sun, 16 Feb 2003 03:00:31 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDBE943FBF for ; Sun, 16 Feb 2003 03:00:30 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h1GB0UNS090629 for ; Sun, 16 Feb 2003 03:00:30 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h1GB0UGT090628; Sun, 16 Feb 2003 03:00:30 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E4AD37B401 for ; Sun, 16 Feb 2003 02:59:34 -0800 (PST) Received: from mail.continuity.cx (mail.continuity.cx [64.141.71.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6B1B43F3F for ; Sun, 16 Feb 2003 02:59:33 -0800 (PST) (envelope-from paul@mail.continuity.cx) Received: by mail.continuity.cx (Postfix, from userid 1005) id B4B0A3DD; Sun, 16 Feb 2003 03:00:30 -0800 (PST) Message-Id: <20030216110030.B4B0A3DD@mail.continuity.cx> Date: Sun, 16 Feb 2003 03:00:30 -0800 (PST) From: Paul Guyot Reply-To: Paul Guyot To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/48325: /etc/periodic/security/100.chksetuid doesn't work with spaces in mount points Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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