From owner-svn-src-head@freebsd.org Fri Aug 25 00:28:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0910DEB9E9; Fri, 25 Aug 2017 00:28:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B32326C0DA; Fri, 25 Aug 2017 00:28:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7P0SugI067109; Fri, 25 Aug 2017 00:28:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P0SuB7067106; Fri, 25 Aug 2017 00:28:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708250028.v7P0SuB7067106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 25 Aug 2017 00:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322868 - head/etc/periodic/security X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc/periodic/security X-SVN-Commit-Revision: 322868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2017 00:28:58 -0000 Author: asomers Date: Fri Aug 25 00:28:56 2017 New Revision: 322868 URL: https://svnweb.freebsd.org/changeset/base/322868 Log: Fix 100.chksetuid and 110.neggrpperm for mountpoints with spaces Also, fix them for mountpoints with tabs. PR: 48325 Reported by: pguyot@kallisys.net, aaron@baugher.biz MFC after: 3 weeks Modified: head/etc/periodic/security/100.chksetuid head/etc/periodic/security/110.neggrpperm head/etc/periodic/security/security.functions Modified: head/etc/periodic/security/100.chksetuid ============================================================================== --- head/etc/periodic/security/100.chksetuid Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/100.chksetuid Fri Aug 25 00:28:56 2017 (r322868) @@ -45,7 +45,13 @@ if check_yesno_period security_status_chksetuid_enable then echo "" echo 'Checking setuid files and devices:' - MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` + IFS=$'\n' # Don't split mount points with spaces or tabs + MP=`mount -t ufs,zfs | awk ' + $0 !~ /no(suid|exec)/ { + sub(/^.* on \//, "/"); + sub(/ \(.*\)/, ""); + print $0 + }'` find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \ \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ \( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ | Modified: head/etc/periodic/security/110.neggrpperm ============================================================================== --- head/etc/periodic/security/110.neggrpperm Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/110.neggrpperm Fri Aug 25 00:28:56 2017 (r322868) @@ -43,7 +43,13 @@ if check_yesno_period security_status_neggrpperm_enabl then echo "" echo 'Checking negative group permissions:' - MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` + IFS=$'\n' # Don't split mount points with spaces or tabs + MP=`mount -t ufs,zfs | awk ' + $0 !~ /no(suid|exec)/ { + sub(/^.* on \//, "/"); + sub(/ \(.*\)/, ""); + print $0 + }'` n=$(find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \ \( \( ! -perm +010 -and -perm +001 \) -or \ \( ! -perm +020 -and -perm +002 \) -or \ Modified: head/etc/periodic/security/security.functions ============================================================================== --- head/etc/periodic/security/security.functions Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/security.functions Fri Aug 25 00:28:56 2017 (r322868) @@ -48,6 +48,7 @@ rc=0 # LABEL is the base name of the ${LOG}/${label}.{today,yesterday} files. check_diff() { + unset IFS rc=0 if [ "$1" = "new_only" ]; then shift