Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2012 13:11:02 GMT
From:      "4721@hushmail.com" <4721@hushmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/174053: [patch] fix etc/rc.d/sysctl to work with values that contain spaces
Message-ID:  <201212021311.qB2DB2d1015755@red.freebsd.org>
Resent-Message-ID: <201212021320.qB2DK0EM058189@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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