From nobody@FreeBSD.org  Mon May 10 20:58:32 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EC97716A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 20:58:32 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B497743D2F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 20:58:32 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i4B3wWav080389
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 20:58:32 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i4B3wWp1080388;
	Mon, 10 May 2004 20:58:32 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200405110358.i4B3wWp1080388@www.freebsd.org>
Date: Mon, 10 May 2004 20:58:32 -0700 (PDT)
From: Todd Miller <Todd.Miller@courtesan.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: escaping '~' and '$' characters in login.conf setenv or path capabilties doesn't work as documented
X-Send-Pr-Version: www-2.3

>Number:         66505
>Category:       docs
>Synopsis:       escaping '~' and '$' characters in login.conf setenv or path capabilties doesn't work as documented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 10 21:00:32 PDT 2004
>Closed-Date:    
>Last-Modified:  Mon Aug  9 22:00:46 GMT 2004
>Originator:     Todd Miller
>Release:        4.8 (though -current sources have the same issues)
>Organization:
>Environment:
>Description:
      login.conf(5) states that "Capabilities that set environment variables are scanned for both `~' and `$' characters, which are substituted for a user's home directory and name respectively.  To pass these characters literally into the environment variable, escape the character by preceding it with a backslash '\'.
>How-To-Repeat:
      Try escaping a ~ or $ in a setenv or path capability in login.conf or ~/.login_conf.
>Fix:
      Either remove the support for escaping the characters or document its deficiencies.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Tue May 11 07:09:37 PDT 2004 
Responsible-Changed-Why:  
Toss it here. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66505 

From: "Todd C. Miller" <Todd.Miller@courtesan.com>
To: freebsd-gnats-submit@FreeBSD.org, Todd.Miller@courtesan.com
Cc:  
Subject: Re: docs/66505: escaping '~' and '$' characters in login.conf setenv or path capabilties doesn't work as documented
Date: Mon, 09 Aug 2004 15:55:18 -0600

 One way to make the behavior match the documentation is to use
 cgetustr(3) when interpreting a "path" or "setenv" capability.  That
 way the normal backslash escape stuff is not done.  This is what I
 just did in OpenBSD (I also implemented the normal cgetstr(3)
 escaping for consistency).
 
  - todd
>Unformatted:
