svn commit: r278772 - in stable/9/etc: . rc.d

Hiroki Sato hrs at FreeBSD.org
Sat Feb 14 18:57:04 UTC 2015


Author: hrs
Date: Sat Feb 14 18:57:02 2015
New Revision: 278772
URL: https://svnweb.freebsd.org/changeset/base/278772

Log:
  MFC r273999 and r271545:
  
  Do not try to create a /dev/log symlink in a jail.
  
  PR:	179828

Modified:
  stable/9/etc/rc.d/syslogd
  stable/9/etc/rc.subr
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/etc/rc.d/   (props changed)

Modified: stable/9/etc/rc.d/syslogd
==============================================================================
--- stable/9/etc/rc.d/syslogd	Sat Feb 14 18:56:44 2015	(r278771)
+++ stable/9/etc/rc.d/syslogd	Sat Feb 14 18:57:02 2015	(r278772)
@@ -29,7 +29,7 @@ syslogd_precmd()
 
 	#	Transitional symlink for old binaries
 	#
-	if [ ! -L /dev/log ]; then
+	if [ ! -L /dev/log ] && ! check_jail jailed; then
 		ln -sf /var/run/log /dev/log
 	fi
 	rm -f /var/run/log

Modified: stable/9/etc/rc.subr
==============================================================================
--- stable/9/etc/rc.subr	Sat Feb 14 18:56:44 2015	(r278771)
+++ stable/9/etc/rc.subr	Sat Feb 14 18:57:02 2015	(r278772)
@@ -2011,6 +2011,22 @@ check_required_after()
 	return 0
 }
 
+# check_jail mib
+#	Return true if security.jail.$mib exists and set to 1.
+
+check_jail()
+{
+	local _mib _v
+
+	_mib=$1
+	if _v=$(${SYSCTL_N} "security.jail.$_mib" 2> /dev/null); then
+		case $_v in
+		1)	return 0;;
+		esac
+	fi
+	return 1
+}
+
 # check_kern_features mib
 #	Return existence of kern.features.* sysctl MIB as true or
 #	false.  The result will be cached in $_rc_cache_kern_features_


More information about the svn-src-stable-9 mailing list