From owner-svn-src-stable-11@freebsd.org Wed Sep 27 15:05:51 2017 Return-Path: Delivered-To: svn-src-stable-11@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 4B6C9E06670; Wed, 27 Sep 2017 15:05:51 +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 24C32766EC; Wed, 27 Sep 2017 15:05:51 +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 v8RF5ov4001383; Wed, 27 Sep 2017 15:05:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8RF5o7e001380; Wed, 27 Sep 2017 15:05:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709271505.v8RF5o7e001380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 27 Sep 2017 15:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324060 - stable/11/etc/periodic/security X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/etc/periodic/security X-SVN-Commit-Revision: 324060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2017 15:05:51 -0000 Author: asomers Date: Wed Sep 27 15:05:49 2017 New Revision: 324060 URL: https://svnweb.freebsd.org/changeset/base/324060 Log: MFC r322868: 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 Modified: stable/11/etc/periodic/security/100.chksetuid stable/11/etc/periodic/security/110.neggrpperm stable/11/etc/periodic/security/security.functions Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/security/100.chksetuid ============================================================================== --- stable/11/etc/periodic/security/100.chksetuid Wed Sep 27 14:59:18 2017 (r324059) +++ stable/11/etc/periodic/security/100.chksetuid Wed Sep 27 15:05:49 2017 (r324060) @@ -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: stable/11/etc/periodic/security/110.neggrpperm ============================================================================== --- stable/11/etc/periodic/security/110.neggrpperm Wed Sep 27 14:59:18 2017 (r324059) +++ stable/11/etc/periodic/security/110.neggrpperm Wed Sep 27 15:05:49 2017 (r324060) @@ -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: stable/11/etc/periodic/security/security.functions ============================================================================== --- stable/11/etc/periodic/security/security.functions Wed Sep 27 14:59:18 2017 (r324059) +++ stable/11/etc/periodic/security/security.functions Wed Sep 27 15:05:49 2017 (r324060) @@ -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