From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 11 23:10:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69DE9E7C for ; Tue, 11 Mar 2014 23:10:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2CEA8F0B for ; Tue, 11 Mar 2014 23:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BNA1nu049878 for ; Tue, 11 Mar 2014 23:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s2BNA11r049877; Tue, 11 Mar 2014 23:10:01 GMT (envelope-from gnats) Resent-Date: Tue, 11 Mar 2014 23:10:01 GMT Resent-Message-Id: <201403112310.s2BNA11r049877@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Adam McDougall Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FF68D9E for ; Tue, 11 Mar 2014 23:05:33 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2B5EB4 for ; Tue, 11 Mar 2014 23:05:33 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BN5XjC050069 for ; Tue, 11 Mar 2014 23:05:33 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s2BN5XlE050068; Tue, 11 Mar 2014 23:05:33 GMT (envelope-from nobody) Message-Id: <201403112305.s2BN5XlE050068@cgiserv.freebsd.org> Date: Tue, 11 Mar 2014 23:05:33 GMT From: Adam McDougall To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/187461: sysrc mishandles variable names containing a dot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 23:10:01 -0000 >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: