From owner-svn-src-stable-11@freebsd.org Mon Dec 10 14:24:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D421327BA0; Mon, 10 Dec 2018 14:24:42 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EC9D7B328; Mon, 10 Dec 2018 14:24:42 +0000 (UTC) (envelope-from eugen@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F815210F1; Mon, 10 Dec 2018 14:24:42 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBAEOg4P053583; Mon, 10 Dec 2018 14:24:42 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBAEOgbC053582; Mon, 10 Dec 2018 14:24:42 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812101424.wBAEOgbC053582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 10 Dec 2018 14:24:42 +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: r341794 - stable/11/etc/periodic/weekly X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/etc/periodic/weekly X-SVN-Commit-Revision: 341794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EC9D7B328 X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 10 Dec 2018 14:24:42 -0000 Author: eugen Date: Mon Dec 10 14:24:41 2018 New Revision: 341794 URL: https://svnweb.freebsd.org/changeset/base/341794 Log: MFC r340322-r340324,r340327: periodic/etc/weekly/340.noid Prevent periodic/etc/weekly/340.noid from descending into root directories of jails. Jails have their own user/group databases and this script can produce multiple false warnings, not to mention significant extra load in case of large jailed subtrees. Leave this check for jailed invocations of the same script. Modified: stable/11/etc/periodic/weekly/340.noid Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/weekly/340.noid ============================================================================== --- stable/11/etc/periodic/weekly/340.noid Mon Dec 10 14:19:57 2018 (r341793) +++ stable/11/etc/periodic/weekly/340.noid Mon Dec 10 14:24:41 2018 (r341794) @@ -16,8 +16,26 @@ case "$weekly_noid_enable" in echo "" echo "Check for files with an unknown user or group:" + # Host should not test jailed subtrees as jails have their own + # databases of users and groups. Leave them for jailed invocations + # of this script. + + exclude='' + if [ $(sysctl -n security.jail.jailed) = 0 ]; then + sep=: + OIFS="$IFS" + IFS="$sep" + for param in $(jail -f "`sysrc -n jail_conf`" -e "$sep" 2>/dev/null) + do + case "$param" in + path=*) exclude="$exclude -path ${param#path=} -prune -or" + esac + done + IFS="$OIFS" + fi + rc=$(find -H ${weekly_noid_dirs:-/} \ - \( ! -fstype local -prune -or -name \* \) -and \ + \( $exclude ! -fstype local -prune -or -name \* \) -and \ \( -nogroup -o -nouser \) -print | sed 's/^/ /' | tee /dev/stderr | wc -l) [ $rc -gt 1 ] && rc=1