Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2012 18:01:20 -0500 (EST)
From:      Garrett Wollman <wollman@csail.mit.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/173669: textproc/augeas: shellvars can't parse loader.conf
Message-ID:  <201211162301.qAGN1KLn086065@xyz.csail.mit.edu>
Resent-Message-ID: <201211162310.qAGNA0WO033392@freefall.freebsd.org>

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

>Number:         173669
>Category:       ports
>Synopsis:       textproc/augeas: shellvars can't parse loader.conf
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 16 23:10:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Wollman
>Release:        FreeBSD 9.1-RC3 amd64
>Organization:
MIT Computer Science & Artificial Intelligence Lab
>Environment:
System: FreeBSD xyz.csail.mit.edu 9.1-RC3 FreeBSD 9.1-RC3 #14 r242372M: Thu Nov 1 01:12:44 EDT 2012 wollman@xyz.csail.mit.edu:/usr/obj/usr/src/sys/CSAIL amd64

>Description:

textproc/augeas includes a patch to shellvars.aug that make it claim
to support /boot/loader.conf.  However, loader.conf allows setting
kernel environment variables, which often have dots in them, and the
regular expression in shellvars.aug won't match on these lines,
causing the parse to fail and augeas to be unable to edit the file.

>How-To-Repeat:

Define any kernel environment variable, like kern.hwpmc.nsamples, in
/boot/loader.conf.  In augtool, run "print /augeas/files/boot/loader.conf"
and get back:

/augeas/files/boot/loader.conf
/augeas/files/boot/loader.conf/path = "/files/boot/loader.conf"
/augeas/files/boot/loader.conf/mtime = "1351131615"
/augeas/files/boot/loader.conf/lens = "@Shellvars"
/augeas/files/boot/loader.conf/lens/info = "/usr/local/share/augeas/lenses/dist/shellvars.aug:138.12-.89:"
/augeas/files/boot/loader.conf/error = "parse_failed"
/augeas/files/boot/loader.conf/error/pos = "90"
/augeas/files/boot/loader.conf/error/line = "5"
/augeas/files/boot/loader.conf/error/char = "0"
/augeas/files/boot/loader.conf/error/lens = "/usr/local/share/augeas/lenses/dist/shellvars.aug:138.12-.89:"
/augeas/files/boot/loader.conf/error/message = "Syntax error"

>Fix:

Fork a new lens that's like shellvars but includes "." in the
character class for key names, and let it take over /boot/loader.conf.
(You could also remove support for "export" and "unset" keywords.)

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



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