Bug 42762

Summary: ppp.8 has no description of $env and ~user expansion in ppp.conf
Product: Documentation Reporter: AIDA Shinra <aida-s>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me CC: aida-s
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description AIDA Shinra 2002-09-14 03:20:01 UTC
ppp expands $env to corresponding environment variables, and ~user to their
home directory name reading any command lines in ppp.conf. However, ppp.8
doesn't explain this at all.

Without description of this feature, some trouble happens. For example,
 authkey pa$ssword
is transformed info ' authkey pa'(if $ssword is undefined), and authentication
'mysteriously' fails.

Fix: 

Add proper description of '$', '~', and '/'.
Comment 1 Peter Pentchev 2004-11-05 17:35:07 UTC
On Sat, Sep 14, 2002 at 11:10:55AM +0900, AIDA Shinra wrote:
> 
> >Number:         42762
> >Category:       docs
> >Synopsis:       ppp.8 has no description of $env and ~user expansion in ppp.conf
[snip]
> >Description:
> ppp expands $env to corresponding environment variables, and ~user to their
> home directory name reading any command lines in ppp.conf. However, ppp.8
> doesn't explain this at all.
> 
> Without description of this feature, some trouble happens. For example,
>  authkey pa$ssword
> is transformed info ' authkey pa'(if $ssword is undefined), and authentication
> 'mysteriously' fails.
> 
> >How-To-Repeat:
> >Fix:
> Add proper description of '$', '~', and '/'.

Sorry about the long delay; what do you think about the following
patch, which documents the '$' and '~' characters?  Does the '/'
character have any special meaning?

Index: src/usr.sbin/ppp/ppp.8.m4
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/ppp.8.m4,v
retrieving revision 1.312
diff -u -r1.312 ppp.8.m4
--- src/usr.sbin/ppp/ppp.8.m4	29 Jul 2004 05:59:43 -0000	1.312
+++ src/usr.sbin/ppp/ppp.8.m4	5 Nov 2004 17:27:37 -0000
@@ -812,6 +812,23 @@
 .Pq Dq \&: .
 .It
 A command line must contain a space or tab in the first column.
+.It
+A string starting with the
+.Dq $
+character is substituted with the value of the environment variable by
+the same name.
+Likewise, a string starting with the
+.Dq ~
+character is substituted with the full path to the home directory of
+the user account by the same name.
+If you want to include a literal
+.Dq $
+or
+.Dq ~
+character in a command or argument, enclose them in double quotes, e.g.
+.Bd -literal -offset indent
+set password "pa$ss~word"
+.Ed
 .El
 .Pp
 The

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net    roam@cnsys.bg    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.
Comment 2 Peter Pentchev freebsd_committer freebsd_triage 2004-11-05 18:42:58 UTC
State Changed
From-To: open->feedback

Awaiting feedback from the originator on the proposed correction to 
the manual page.
Comment 3 Brian Somers freebsd_committer freebsd_triage 2004-12-16 15:50:56 UTC
Oops, lost in my inbox :(  Sorry.

I guess there are three things to be described here.

$var - as described
~ - as described
~user - the home directory of ``user''.

Please feel free to commit when you can - after adding the last bit...

Cheers.

On Fri, 5 Nov 2004 19:35:07 +0200, Peter Pentchev <roam@ringlet.net> wrote:
> On Sat, Sep 14, 2002 at 11:10:55AM +0900, AIDA Shinra wrote:
> > 
> > >Number:         42762
> > >Category:       docs
> > >Synopsis:       ppp.8 has no description of $env and ~user expansion in ppp.conf
> [snip]
> > >Description:
> > ppp expands $env to corresponding environment variables, and ~user to their
> > home directory name reading any command lines in ppp.conf. However, ppp.8
> > doesn't explain this at all.
> > 
> > Without description of this feature, some trouble happens. For example,
> >  authkey pa$ssword
> > is transformed info ' authkey pa'(if $ssword is undefined), and authentication
> > 'mysteriously' fails.
> > 
> > >How-To-Repeat:
> > >Fix:
> > Add proper description of '$', '~', and '/'.
> 
> Sorry about the long delay; what do you think about the following
> patch, which documents the '$' and '~' characters?  Does the '/'
> character have any special meaning?
> 
> Index: src/usr.sbin/ppp/ppp.8.m4
> ===================================================================
> RCS file: /home/ncvs/src/usr.sbin/ppp/ppp.8.m4,v
> retrieving revision 1.312
> diff -u -r1.312 ppp.8.m4
> --- src/usr.sbin/ppp/ppp.8.m4	29 Jul 2004 05:59:43 -0000	1.312
> +++ src/usr.sbin/ppp/ppp.8.m4	5 Nov 2004 17:27:37 -0000
> @@ -812,6 +812,23 @@
>  .Pq Dq \&: .
>  .It
>  A command line must contain a space or tab in the first column.
> +.It
> +A string starting with the
> +.Dq $
> +character is substituted with the value of the environment variable by
> +the same name.
> +Likewise, a string starting with the
> +.Dq ~
> +character is substituted with the full path to the home directory of
> +the user account by the same name.
> +If you want to include a literal
> +.Dq $
> +or
> +.Dq ~
> +character in a command or argument, enclose them in double quotes, e.g.
> +.Bd -literal -offset indent
> +set password "pa$ss~word"
> +.Ed
>  .El
>  .Pp
>  The
> 
> G'luck,
> Peter
> 
> -- 
> Peter Pentchev	roam@ringlet.net    roam@cnsys.bg    roam@FreeBSD.org
> PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
> This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.
> 


-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
Comment 4 Peter Pentchev 2004-12-16 16:59:56 UTC
On Thu, Dec 16, 2004 at 03:50:56PM +0000, Brian Somers wrote:
> Oops, lost in my inbox :(  Sorry.
> 
> I guess there are three things to be described here.
> 
> $var - as described
> ~ - as described
> ~user - the home directory of ``user''.
> 
> Please feel free to commit when you can - after adding the last bit...

Thanks, I just committed a slightly reworded version which also describes
the special meaning of ~ (it was ~ that was missed, not ~user).

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net    roam@cnsys.bg    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Thit sentence is not self-referential because "thit" is not a word.
Comment 5 Peter Pentchev freebsd_committer freebsd_triage 2004-12-16 17:00:53 UTC
State Changed
From-To: feedback->patched

A fix was committed to -CURRENT, I will MFC it in two weeks. 
Thanks for the problem report!
Comment 6 Giorgos Keramidas freebsd_committer freebsd_triage 2005-02-22 13:30:26 UTC
State Changed
From-To: patched->closed

The change seems to have already found its way to RELENG_5.