>Number:         187461
>Category:       bin
>Synopsis:       sysrc mishandles variable names containing a dot
>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:   Tue Mar 11 23:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Adam McDougall
>Release:        FreeBSD 10.0-STABLE
>Organization:
>Environment:
FreeBSD build10 10.0-STABLE FreeBSD 10.0-STABLE #0 r262298: Fri Feb 21 18:28:26 
EST 2014     root@build10:/usr/obj/usr/src/sys/BUILD10  amd64
>Description:
Recently I was trying to convert some "echo a.b.c=1 > /etc/sysctl.conf" type 
statements to use sysrc instead.  It appears if the variable contains one or 
more dots, sysrc will write the desired value, fail to read it, and it will 
always create a new entry if executed again.  This is inconvenient for editing 
values in /etc/sysctl.conf using the -f parameter because such entries almost 
always have a dot in the variable.
sysrc -f /etc/sysctl.conf

Symptoms are present on FreeBSD 9 too.
>How-To-Repeat:
root@build10:~ # grep a.b /etc/rc.conf
root@build10:~ # sysrc a.b=yes
a.b:  -> 
root@build10:~ # grep a.b /etc/rc.conf
a.b="yes"
root@build10:~ # sysrc a.b=yes
a.b:  -> 
root@build10:~ # grep a.b /etc/rc.conf
a.b="yes"
a.b="yes"

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to