bin/187461: sysrc mishandles variable names containing a dot

Adam McDougall mcdouga9 at egr.msu.edu
Tue Mar 11 23:10:01 UTC 2014


>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 at 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 at build10:~ # grep a.b /etc/rc.conf
root at build10:~ # sysrc a.b=yes
a.b:  -> 
root at build10:~ # grep a.b /etc/rc.conf
a.b="yes"
root at build10:~ # sysrc a.b=yes
a.b:  -> 
root at build10:~ # grep a.b /etc/rc.conf
a.b="yes"
a.b="yes"

>Fix:


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


More information about the freebsd-bugs mailing list