nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] I Could Have Sworn that the inc Command used to work.


From: Bakul Shah
Subject: Re: [nmh-workers] I Could Have Sworn that the inc Command used to work.
Date: Mon, 03 Jun 2019 01:30:53 -0700

On Mon, 03 Jun 2019 09:08:16 +0100 Ralph Corderoy <address@hidden> wrote:
> Hi Ken,
>
> > > /var/mail/$USER   Location of the system mail drop.
> >
> > But we don't actually use $USER (we call getpwuid(getuid()) and use
> > that).
>
> And even then it's not that simple.
>
> > I personally interpreted the use of $USER as "the username goes here",
> > not "we use the value of the $USER environment variable".  But I admit
> > that this is not clear.
>
> I'd interpret it as being able to do `USER=notme inc'.
>
> Should we simplify the code to demand $LOGNAME exists and use that?
> POSIX, he say
>
>     LOGNAME
>         The system shall initialize this variable at the time of login
>         to be the user's login name.  See <pwd.h>.  For a value of
>         LOGNAME to be portable across implementations of POSIX.1-2017,
>         the value should be composed of characters from the portable
>         filename character set.

You can use getlogin(3) or getlogin_r(3) as per ISO/IEC 9945-1:1996.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]