From nobody@FreeBSD.org  Sun Dec  2 13:11:03 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 58FF580D
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Dec 2012 13:11:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 3FB458FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Dec 2012 13:11:03 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB2DB2rP015762
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 2 Dec 2012 13:11:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qB2DB2d1015755;
	Sun, 2 Dec 2012 13:11:02 GMT
	(envelope-from nobody)
Message-Id: <201212021311.qB2DB2d1015755@red.freebsd.org>
Date: Sun, 2 Dec 2012 13:11:02 GMT
From: "4721@hushmail.com" <4721@hushmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] fix etc/rc.d/sysctl to work with values that contain spaces
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 02 13:20:00 UTC 2012
>Closed-Date:    Fri Dec 14 03:06:42 UTC 2012
>Last-Modified:  Fri Dec 14 03:06:42 UTC 2012
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Dec 2 19:01:09 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174053 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Fri Dec 14 03:05:44 UTC 2012 
State-Changed-Why:  
No longer revalent after sysctl(8) addition of file parsing feature. 


Responsible-Changed-From-To: freebsd-rc->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Fri Dec 14 03:05:44 UTC 2012 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174053 
>Unformatted:
