Subject: Re: login dosen't reset the umask. Was: Why login behaves different ...
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-help
Date: 07/23/1999 22:48:51
In article <199907232232.AAA00323@schleppo.sun.universe>,
Bernd Salbrechter <bernd@mycity.at> wrote:
>
>First of all thanks to Bruce Anderson for the answers to my previous
>questions, they direct me to the problem. I had troubles to get
>a ppp connection shut down, if I login to a the user "mailserver",
>which I have setup to open the connection and shut it down after
>the exchange of mails.
>
>I finaly figured out that the umask is not reset by "login" and
>this cause different permisions on the file "/var/run/ppp0.pid",
>which is not owned by the user which calls pppd, but by "deamon.wheel".
>
>If I login throu getty the umask was 0 and if I directly login from
>an other user, the umask was thaken from there. I think "login"
>should not take any values fom a previous unrelated session, if
>this is true, should I fill a PR or is it allready knowen?
>

I am not sure if the analysis is correct:

Neither getty or login appear to play with the umask; thus they use what's
being inherited by init. Umask is propagated to the children; setting the
umask on the child does not affect the parent. So it is highly unlikely
that the umask setting will survive successive login sessions.
Most shells will play with the umask through their builtins, and probably
this is the effect you are observing. Finally looking at the source for pppd,
it explicitly sets the umask...

christos