diff options
author | Eugene Grosbein <eugen@FreeBSD.org> | 2018-11-10 14:21:26 +0000 |
---|---|---|
committer | Eugene Grosbein <eugen@FreeBSD.org> | 2018-11-10 14:21:26 +0000 |
commit | ab478b01852736ca87946a6bbc73f94001c09f07 (patch) | |
tree | 1ed6c3353c27283ca42dd9f8b1781cd7a8e9c443 /usr.sbin/periodic | |
parent | 7b3c65ba1c6185f579dbd08ec2392ea380f65b2e (diff) | |
download | src-ab478b01852736ca87946a6bbc73f94001c09f07.tar.gz src-ab478b01852736ca87946a6bbc73f94001c09f07.zip |
Notes
Diffstat (limited to 'usr.sbin/periodic')
-rwxr-xr-x | usr.sbin/periodic/etc/weekly/340.noid | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/periodic/etc/weekly/340.noid b/usr.sbin/periodic/etc/weekly/340.noid index 11a5f53ea25d..047fdd52f313 100755 --- a/usr.sbin/periodic/etc/weekly/340.noid +++ b/usr.sbin/periodic/etc/weekly/340.noid @@ -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 "`syscrc jail_conf`" -e "$sep") + 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 |