From nobody@FreeBSD.org  Sun Dec 18 15:12:25 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA1FD106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Dec 2011 15:12:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id C88908FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Dec 2011 15:12:25 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pBIFCPMu004069
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Dec 2011 15:12:25 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pBIFCPdD004068;
	Sun, 18 Dec 2011 15:12:25 GMT
	(envelope-from nobody)
Message-Id: <201112181512.pBIFCPdD004068@red.freebsd.org>
Date: Sun, 18 Dec 2011 15:12:25 GMT
From: Mike Clarke <jmc-fbsdpr@milibyte.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Environment variables set from /etc/login.conf do not have surrounding quote characters removed
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163432
>Category:       conf
>Synopsis:       Environment variables set from /etc/login.conf do not have surrounding quote characters removed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 18 15:20:08 UTC 2011
>Closed-Date:    Mon Dec 19 17:57:05 UTC 2011
>Last-Modified:  Mon Dec 19 17:57:05 UTC 2011
>Originator:     Mike Clarke
>Release:        FreeBSD 9.0-RC2 amd64
>Organization:
>Environment:
System: FreeBSD curlew.lan 9.0-RC2 FreeBSD 9.0-RC2 #0: Sat Nov 12 18:35:25 UTC 2011 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
If /etc/login.conf is used to set an environment variable and the value is enclosed between quote characters the quotes are not stripped off when setting the variable. This problem only arises with FreeBSD 9, the quotes were removed with earlier versions.

>How-To-Repeat:
Add a value for EXINIT to the default /etc/login.conf as shown below:

:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,EXINIT="set ai ic sw=3":\

Then login and check the value of EXINIT, the quotes have been included and it appears as "set ai ic sw=3" instead of set ai ic sw=3. The presence of the quotes prevents vi from setting these options.

>Fix:
As a workaround edit /etc/login.conf to remove the surrounding quotes from the item in the setenv line. However this will not work if you need to include commas in the value.


>Release-Note:
>Audit-Trail:

From: Jaakko Heinonen <jh@FreeBSD.org>
To: Mike Clarke <jmc-fbsdpr@milibyte.co.uk>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/163432: Environment variables set from /etc/login.conf do
 not have surrounding quote characters removed
Date: Sun, 18 Dec 2011 20:18:37 +0200

 Hi,
 
 On 2011-12-18, Mike Clarke wrote:
 > If /etc/login.conf is used to set an environment variable and the
 > value is enclosed between quote characters the quotes are not stripped
 > off when setting the variable. This problem only arises with FreeBSD
 > 9, the quotes were removed with earlier versions.
 > 
 > :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,EXINIT="set ai ic sw=3":\
 
 Can you clarify the "earlier versions"? I get this on 8.2-RELEASE:
 
 $ env
 .
 .
 EXINIT="set ai ic sw=3"
 
 -- 
 Jaakko

From: Mike Clarke <jmc-fbsdpr@milibyte.co.uk>
To: Jaakko Heinonen <jh@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: conf/163432: Environment variables set from /etc/login.conf do not have surrounding quote characters removed
Date: Sun, 18 Dec 2011 20:52:27 +0000

 On Sunday 18 December 2011, Jaakko Heinonen wrote:
 
 > Can you clarify the "earlier versions"?
 
 On 8.1-RELEASE the quotes get stripped off.
 
 curlew:/home/mike% grep setenv /etc/login.conf
         :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,EDITOR=vi,EXINIT="set 
 ai ic sw=3",PAGER=less,EJECT=/dev/acd0:\
 
 
 curlew:/home/mike% env | grep EXINIT
 EXINIT=set ai ic sw=3
 
 -- 
 Mike Clarke

From: Jaakko Heinonen <jh@FreeBSD.org>
To: Mike Clarke <jmc-fbsdpr@milibyte.co.uk>
Cc: bug-followup@freebsd.org
Subject: Re: conf/163432: Environment variables set from /etc/login.conf do
 not have surrounding quote characters removed
Date: Mon, 19 Dec 2011 12:34:45 +0200

 On 2011-12-18, Mike Clarke wrote:
 > On 8.1-RELEASE the quotes get stripped off.
 > 
 > curlew:/home/mike% grep setenv /etc/login.conf
 >         :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,EDITOR=vi,EXINIT="set 
 > ai ic sw=3",PAGER=less,EJECT=/dev/acd0:\
 > 
 > 
 > curlew:/home/mike% env | grep EXINIT
 > EXINIT=set ai ic sw=3
 
 I still get EXINIT="set ai ic sw=3" on 8.1-RELEASE. Are you sure that
 your database is up to date (i.e. you have run cap_mkdb /etc/login.conf)?
 
 -- 
 Jaakko

From: Mike Clarke <jmc-fbsdpr@milibyte.co.uk>
To: Jaakko Heinonen <jh@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: conf/163432: Environment variables set from /etc/login.conf do not have surrounding quote characters removed
Date: Mon, 19 Dec 2011 14:13:19 +0000

 On Monday 19 December 2011, you wrote:
 
 > I still get EXINIT="set ai ic sw=3" on 8.1-RELEASE. Are you sure that
 > your database is up to date (i.e. you have run cap_mkdb
 > /etc/login.conf)?
 
 Yes, it's up to date but I've just discovered a long forgotten line 
 in .cshrc which was also setting EXINIT and overriding the value from 
 login.conf. After removing the .cshrc line I now get the quotes the 
 same way as you do. The issue only became visible on the new 9.0 system 
 I was setting up because the new user account didn't have a copy of the 
 old .cshrc file.
 
 I've now removed the qoutes from login.conf since I now see that they 
 should not have been there. I'm sorry for any inconvenience caused by 
 my oversight.
 
 This does leave the minor point that the absence of a quoting facility 
 means that it doesn't seem possible to include a comma in the value of 
 an environment variable defined in login.conf, though I doubt if many 
 users will ever need to do this.
 
 -- 
 Mike Clarke
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Mon Dec 19 17:57:04 UTC 2011 
State-Changed-Why:  
Not a regression. Submitter agrees that this can be closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163432 
>Unformatted:
