conf/174053: [patch] fix etc/rc.d/sysctl to work with values that contain spaces

4721 at hushmail.com 4721 at hushmail.com
Sun Dec 2 13:20:00 UTC 2012


>Number:         174053
>Category:       conf
>Synopsis:       [patch] fix etc/rc.d/sysctl to work with values that contain spaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 02 13:20:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     4721 at hushmail.com
>Release:        
>Organization:
>Environment:
>Description:
the etc/rc.d/sysctl script attempts to get the current value of a sysctl and skip setting it if it is already equal to the target value. if the value contains spaces the check fails and that line of sysctl.conf is skipped.
adding quotes around the check solves this.

example line to test:
dev.hdaa.0.nid5_config=as=15\ seq=0\ conn=None
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: etc/rc.d/sysctl
===================================================================
--- etc/rc.d/sysctl	(revision 243646)
+++ etc/rc.d/sysctl	(working copy)
@@ -29,7 +29,7 @@
 				mib=${var%=*}
 				val=${var#*=}
 
-				if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then
+				if current_value=`${SYSCTL} -n "${mib}" 2>/dev/null`; then
 					case ${current_value} in
 					${val})
 						;;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list