FS#66068 - [filesystem][pambase][shadow] Use pam_umask.so?
Attached to Project:
Arch Linux
Opened by Marcos Mello (marcosfrm) - Wednesday, 01 April 2020, 19:56 GMT
Last edited by David Runge (dvzrv) - Friday, 22 September 2023, 20:33 GMT
Opened by Marcos Mello (marcosfrm) - Wednesday, 01 April 2020, 19:56 GMT
Last edited by David Runge (dvzrv) - Friday, 22 September 2023, 20:33 GMT
|
Details
Would this approach benefit Arch?
https://bugzilla.redhat.com/show_bug.cgi?id=1807957 If I get things correctly: - Add "session optional pam_umask.so" to PAM stack (system-login) - Synchronize /etc/login.defs with upstream shadow: set UMASK to 022 and new option (since 4.8.1) HOME_MODE to 0700. - Drop umask call from /etc/profile (filesystem package) This way umask configuration is centralized in /etc/login.defs. |
This task depends upon
Closed by David Runge (dvzrv)
Friday, 22 September 2023, 20:33 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with shadow 4.14.0-3, filesystem 2023.09.18, pambase 20230918
Friday, 22 September 2023, 20:33 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with shadow 4.14.0-3, filesystem 2023.09.18, pambase 20230918
The key feature to make it work is the new /etc/login.defs' HOME_MODE option.
https://github.com/systemd/systemd/issues/6077
FS#69933perhaps the changes should be reviewed together by the same developers?Currently umask is set 077 in /etc/login.defs, that will be replaced by 022 for anything that has sourced /etc/profile.
Does anything apart from useradd and newusers use the 077 umask?
Why is HOME_MODE commented in upstream's /etc/login.defs?
I thought the proposal was:
UMASK 022 which is what upstream uses
HOME_MODE 0700 which is what upstream uses although it has it commented out.
If UMASK is 022 and HOME_MODE is not set so 022 is used, would that create home directories with 0755 permissions?
Edit:
logins that do not use pam such as telnet from inetutils would no longer have umask set?
How do the pri (priority) and ulimit (fsize) which may set by pam_umask from a users gecos field interact with the values set by pam_limits?
Edit2:
Attached diffs of what I understand the proposed changes to be. There is a separate version of the patch for shadow in
FS#69933that applies on top of those changes.https://bugs.kde.org/show_bug.cgi?id=445801
As we've seen recently [1], it is indeed the case, that new home directories are created with 0755 permissions.
FWIW, I'd be up for changing this in an update to shadow and pambase, but we'd also need to coordinate this with the filesystem package to remove the umask call from /etc/profile.
[1] https://bugs.archlinux.org/task/69933#comment212052
FS#69933is closed, can we implement this?@seblu: The changes to /etc/profile in filesystem are done in https://gitlab.archlinux.org/archlinux/packaging/packages/filesystem/-/commit/4a36801a4d7eb169298037b914887f0aeb14e1ad
**NOTE**: This **requires** us to release filesystem, pambase and shadow **together** to not mess this up! I'll try to get to that this week!
Please give it a thorough test and report back with any problems!
(11/11) atualizando shadow [...]
atenção: /etc/login.defs instalado como /etc/login.defs.pacnew
After login:
# umask
0077
from the old UMASK 077, used to satisfy useradd before HOME_MODE. A message "umask configuration has changed. Check for /etc/login.defs.pacnew and /etc/pam.d/system-login.pacnew and merge changes if necessary" or so would help IMHO.
Besides that, works fine!