Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2014 23:05:33 GMT
From:      Adam McDougall <mcdouga9@egr.msu.edu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/187461: sysrc mishandles variable names containing a dot
Message-ID:  <201403112305.s2BN5XlE050068@cgiserv.freebsd.org>
Resent-Message-ID: <201403112310.s2BNA11r049877@freefall.freebsd.org>

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

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



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