Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465174 - sys-apps/shadow[pam]: login does not respect UMASK from /etc/login.defs (due to missing
Summary: sys-apps/shadow[pam]: login does not respect UMASK from /etc/login.defs (due ...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2013-04-08 23:25 UTC by Muelli
Modified: 2019-03-28 06:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Muelli 2013-04-08 23:25:23 UTC
/bin/login from shadow currently has following the man page:

       The following configuration variables in /etc/login.defs change the behavior of this
       UMASK (number)
           The file mode creation mask is initialized to this value. If not specified, the
           mask will be initialized to 022.

           useradd and newusers use this mask to set the mode of the home directory they

           It is also used by login to define users' initial umask. Note that this mask can
           be overriden by the user's GECOS line (if QUOTAS_ENAB is set) or by the
           specification of a limit with the K identifier in limits(5).

So I went and edited /etc/login.defs accordingly to set the umask to a different value.

However, that new umask was not picked up. A simple "ssh box umask" showed the default 022 umask. Note that no shell is invoked so /etc/profile, which may define a umask, is not read.

After patching /etc/pam.d/system-login to include the line

session         optional

at the top of the session block, it worked as expected.

I expected it to work out of the box based on the documentation mentioned above.