Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2018 10:55:41 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r342365 - stable/12/usr.sbin/periodic/etc/weekly
Message-ID:  <201812221055.wBMAtfKx070725@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Sat Dec 22 10:55:40 2018
New Revision: 342365
URL: https://svnweb.freebsd.org/changeset/base/342365

Log:
  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 (*)

Modified:
  stable/12/usr.sbin/periodic/etc/weekly/340.noid
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/periodic/etc/weekly/340.noid
==============================================================================
--- stable/12/usr.sbin/periodic/etc/weekly/340.noid	Sat Dec 22 09:31:55 2018	(r342364)
+++ stable/12/usr.sbin/periodic/etc/weekly/340.noid	Sat Dec 22 10:55:40 2018	(r342365)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812221055.wBMAtfKx070725>