fix: set shadow file to root:shadow 0640 in mutable mode#41
fix: set shadow file to root:shadow 0640 in mutable mode#41jfroche wants to merge 1 commit intonikstur:mainfrom
Conversation
When mutable users are enabled, tools like passwd need to read /etc/shadow, which requires the file to be accessible to the shadow group. In mutable mode, set the shadow file to mode 0640 with the shadow group. In immutable mode the existing 0000 behavior is preserved.
We have added a PR to userborn to fix the ownership/permission on /etc/shadow: nikstur/userborn#41 /etc/shadow has mode 0640 and group shadow after both activation and deactivation.
|
Edit: please ignore. |
|
Why do it only in mutable mode? It should always be root shadow. |
|
Userborn follows the semantics of systemd-sysusers which uses these exact file permissions. |
Well, you don't though? sysusers preserves existing permissions, it never overrides them, permissions it creates are relevant only when it creates a file that doesn't exist. Where as userborn and update-users-groups.pl always override permissions as it seems. So for systemd-sysusers you can create a file using systemd-tmpfiles and set whatever permissions you like. Well, that is a different issue though. |
|
I took a slightly different approach in #46, before seeing this PR. My main motivation is to remove setuid from unixchk_pwd and have only setgid instead. |
When mutable users are enabled, tools like passwd need to read /etc/shadow, which requires the file to be accessible to the shadow group.
In mutable mode, set the shadow file to mode 0640 with the shadow group.
In immutable mode the existing 0000 behavior is preserved.