Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pid1: by default make user units inherit their umask from the user ma… #15318

Merged
merged 1 commit into from Apr 9, 2020

Conversation

fbuihuu
Copy link
Contributor

@fbuihuu fbuihuu commented Apr 3, 2020

…nager

This patch changes the way user managers set the default umask for the units it
manages.

Indeed one can expect that if user manager's umask is redefined through PAM
(via /etc/login.defs or pam_umask), all its children including the units it
spawns have their umask set to the new value.

Hence make user units inherit their umask value from their parent instead of
the hard coded value 0022 but allow them to override this value via their unit
file.

Note that reexecuting managers with 'systemctl daemon-reexec' after changing
UMask= has no effect. To take effect managers need to be restarted with
'systemct restart' instead. This behavior was already present before this
patch.

Fixes #6077.

@fbuihuu fbuihuu added the pid1 label Apr 3, 2020
@poettering
Copy link
Member

Not a fan, but Ok. But please update UMask= explanation in the systemd.exec man page, it needs to clarify what the new default is now.

@poettering poettering added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Apr 7, 2020
@fbuihuu fbuihuu force-pushed the inherit-umask-for-user-units branch from 95405af to f466c9e Compare April 8, 2020 07:23
@fbuihuu fbuihuu removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Apr 8, 2020
@fbuihuu
Copy link
Contributor Author

fbuihuu commented Apr 8, 2020

@poettering new version force pushed.

man/systemd.exec.xml Outdated Show resolved Hide resolved
@fbuihuu fbuihuu force-pushed the inherit-umask-for-user-units branch from f466c9e to 61f1ad9 Compare April 9, 2020 12:14
…nager

This patch changes the way user managers set the default umask for the units it
manages.

Indeed one can expect that if user manager's umask is redefined through PAM
(via /etc/login.defs or pam_umask), all its children including the units it
spawns have their umask set to the new value.

Hence make user units inherit their umask value from their parent instead of
the hard coded value 0022 but allow them to override this value via their unit
file.

Note that reexecuting managers with 'systemctl daemon-reexec' after changing
UMask= has no effect. To take effect managers need to be restarted with
'systemct restart' instead. This behavior was already present before this
patch.

Fixes systemd#6077.
@fbuihuu fbuihuu force-pushed the inherit-umask-for-user-units branch from 61f1ad9 to 5e37d19 Compare April 9, 2020 12:17
@poettering poettering added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Apr 9, 2020
@poettering poettering merged commit 611cb82 into systemd:master Apr 9, 2020
@fbuihuu fbuihuu deleted the inherit-umask-for-user-units branch April 10, 2020 06:20
@Reasoning-Technology
Copy link

Nautalis on our Fedora 33 machines is ignoring umask settings, including in login.defs, and making all files world readable.
Apparently this is from 'transient units' systemd->gnome-shell-> process . Will this patch fix this problem? Has it made it downstream? How can I tell?

@keszybz keszybz removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Nov 5, 2021
@keszybz
Copy link
Member

keszybz commented Nov 5, 2021

@Reasoning-Technology if you click on the "… merged commmit 611cb82" message above, the page shows that the commit is present in v249 v249-rc3 v249-rc2 v249-rc1 v248 v248-rc4 v248-rc3 v248-rc2 v248-rc1 v247 v247-rc2 v247-rc1 v246 v246-rc2 v246-rc1, i.e. v246 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Permit "systemd --user" to select/inherit the default umask
4 participants