Index: stable/12/usr.sbin/periodic/etc/weekly/340.noid =================================================================== --- stable/12/usr.sbin/periodic/etc/weekly/340.noid (revision 341792) +++ stable/12/usr.sbin/periodic/etc/weekly/340.noid (revision 341793) @@ -1,29 +1,47 @@ #!/bin/sh - # # $FreeBSD$ # # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi case "$weekly_noid_enable" in [Yy][Ee][Ss]) 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 ;; *) rc=0;; esac exit $rc Index: stable/12 =================================================================== --- stable/12 (revision 341792) +++ stable/12 (revision 341793) Property changes on: stable/12 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r340322-340324,340327