From 00a468edd21be1675f150e5b6dac9468a40456c8 Mon Sep 17 00:00:00 2001 From: eugen Date: Sat, 22 Dec 2018 10:57:52 +0000 Subject: [PATCH] MFC r342141: periodic/weekly/340.noid: do not use sysrc(8) that depends on bsdinstall(8) and may be non-functional for system built WITHOUT_BSDINSTALL. (*) Also, add a check for jails sharing whole tree with host (path=/) and do not skip it. Reported by: Andre.Albsmeier@siemens.com (*) --- etc/periodic/weekly/340.noid | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/etc/periodic/weekly/340.noid b/etc/periodic/weekly/340.noid index 101ac575267..06ac3df31ff 100755 --- a/etc/periodic/weekly/340.noid +++ b/etc/periodic/weekly/340.noid @@ -22,13 +22,24 @@ case "$weekly_noid_enable" in exclude='' if [ $(sysctl -n security.jail.jailed) = 0 ]; then + # For jail_conf + . /etc/rc.subr + load_rc_config jail + sep=: OIFS="$IFS" IFS="$sep" - for param in $(jail -f "`sysrc -n jail_conf`" -e "$sep" 2>/dev/null) + for param in $(jail -f "$jail_conf" -e "$sep" 2>/dev/null) do case "$param" in - path=*) exclude="$exclude -path ${param#path=} -prune -or" + path=*) + _p=${param#path=} + if [ -z "$_p" -o "$_p" = / ]; then + continue + fi + + exclude="$exclude -path $_p -prune -or" + ;; esac done IFS="$OIFS" -- 2.45.0