pid1: by default make user units inherit their umask from the user manager
authorFranck Bui <fbui@suse.com>
Fri, 3 Apr 2020 08:00:25 +0000 (10:00 +0200)
committerMichael Biebl <biebl@debian.org>
Fri, 10 Apr 2020 09:55:15 +0000 (10:55 +0100)
commit3545e51202e2ab927cfe69040d7145b861ac39e1
treeceb3fad6fa87f72487ba7f25534633589805ee25
parent69bc972e2e86b391e13939f1eba860dff7251cd0
pid1: by default make user units inherit their umask from the user manager

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.

(cherry picked from commit 5e37d1930b41b24c077ce37c6db0e36c745106c7)

Gbp-Pq: Name pid1-by-default-make-user-units-inherit-their-umask-from-.patch
man/systemd.exec.xml
src/basic/process-util.c
src/basic/process-util.h
src/core/unit.c