From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 11 08:00:31 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14277106566C for ; Wed, 11 Jan 2012 08:00:31 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E68988FC14 for ; Wed, 11 Jan 2012 08:00:30 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0B80USs093355 for ; Wed, 11 Jan 2012 08:00:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0B80Ug4093353; Wed, 11 Jan 2012 08:00:30 GMT (envelope-from gnats) Date: Wed, 11 Jan 2012 08:00:30 GMT Message-Id: <201201110800.q0B80Ug4093353@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Matthew Story Cc: Subject: Re: misc/164011: comments in rc.conf cause system loading X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthew Story List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 08:00:31 -0000 The following reply was made to PR misc/164011; it has been noted by GNATS. From: Matthew Story To: bug-followup@FreeBSD.org Cc: Subject: Re: misc/164011: comments in rc.conf cause system loading Date: Wed, 11 Jan 2012 02:24:36 -0500 --f46d043c7c941cc30b04b63b8645 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 11, 2012 at 1:38 AM, Eugen Konkov wrote: > >How-To-Repeat: > If I put this line All is ok > ifconfig_vlan7="inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev > re0" # > When I do not keep space between " and # > ifconfig_vlan7="inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev > re0"# > rc.conf uses sh(1) syntax, per the man page: Options are set with ``name=value'' assignments that use sh(1) syntax. The following list provides a name and short description for each vari- able that can be set in the rc.conf file: (via man 5 rc.conf) per the POSIX specification, `#' only denotes a comment if it occurs at the beginning of a word: When it is not processing an *io_here*, the shell shall break its input into tokens by applying the first applicable rule below to the next character in its input. The token shall be from the current position in the input until a token is delimited according to one of the rules below; the characters forming the token are exactly those in the input, including any quoting characters. If it is indicated that a token is delimited, and no characters have been included in a token, processing shall continue until an actual token is delimited. [...snip] 10. If the current character is a '#', it and all subsequent characters up to, but excluding, the next shall be discarded as a comment. The that ends the line is not considered part of the comment. via: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html In your given example: "inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0"# shell is still constructing a word (for assignemnt), which will result in the assignment of: inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0# to ifconfig_vlan. A relevant snippit from "The UNIX Programming Environment" below: The metacharacter # is almost universally used for shell comments; if a shell word begins with #, the rest of the lineis ignored: $ echo hello # there hello $ echo hello#there hello#there $ (page 77) -- regards, matt --f46d043c7c941cc30b04b63b8645 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Jan 11, 2012 at 1:38 AM, Eugen Ko= nkov=A0<kes-kes@yandex.ru>=A0= wrote:
>How-To-Repeat:
If I put this line All is ok
ifconfig_vlan7=3D&quo= t;inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0" #
W= hen I do not keep space between " and #
ifconfig_vlan7=3D"inet= 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0"#
rc.conf uses sh(1) syntax, per the man page:
= =A0=A0 =A0 Options are set with ``name=3Dvalue'' assignments that u= se sh(1) syntax.
=A0=A0 =A0 The following list provides a name an= d short description for each vari-
=A0=A0 =A0 able that can be set in the rc.conf file:
(= via man 5 rc.conf)

per the POSIX specification, `#= ' only denotes a comment if it occurs at the beginning of a word:
=

When it is not processing an=A0io_here, the shell = shall break its input into tokens by applying the first applicable rule bel= ow to the next character in its input. The token shall be from the current = position in the input until a token is delimited according to one of the ru= les below; the characters forming the token are exactly those in the input,= including any quoting characters. If it is indicated that a token is delim= ited, and no characters have been included in a token, processing shall con= tinue until an actual token is delimited.
[...snip]

10. If the c= urrent character is a=A0'#', it and all subsequent charact= ers up to, but excluding, the next <newline> shall be discarded as a = comment. The <newline> that ends the line is not considered part of t= he comment.


In your given example:

"inet 10.11.19.149 netmask 255= .255.255.248 vlan 7 vlandev re0"#

shell= is still constructing a word (for assignemnt), which will result in the as= signment of:

inet 10.= 11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0#

<= /div>
to=A0ifconfig_vlan.=A0

A relevant snippit from "The UNIX Programmi= ng Environment" below:

The=A0metacharacter=A0#=A0is=A0almost=A0universally use= d for=A0shell=A0<= /span>comments; if a shell word begins with=A0#,=A0<= /span>the=A0<= /font>rest=A0of=A0<= span style=3D"font-size:small">= the lineis=A0ignored:


<= /font>

$=A0<= /span>echo=A0= hello=A0#=A0there=A0

hello=A0

$=A0hello#there=A0

hello#ther= e

$


(page 77)

--
rega= rds,
matt
--f46d043c7c941cc30b04b63b8645--