namespace: make whole namespace_setup() work regardless of configured umask
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Nov 2021 10:11:27 +0000 (11:11 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Jan 2022 17:17:20 +0000 (18:17 +0100)
commit569ef9413c2ef3275b45458367342112e5d5f991
tree699956b2b54f0537a5e4a893fe36418da0fa6a9c
parentbce7fb14df960aee57f0ad5c9c12a0d35c3e504e
namespace: make whole namespace_setup() work regardless of configured umask

Let's reset the umask during the whole namespace_setup() logic, so that
all our mkdir() + mknod() are not subjected to whatever umask might
currently be set.

This mostly moves the umask save/restore logic out of
mount_private_dev() and into the stack frame of namespace_setup() that
is further out.

Fixes #19899

(cherry picked from commit cdf42f9bd40ff21a67d58b948efea055d56ad398)
src/core/namespace.c