]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: make DynamicUser=1 and StateDirectory= work with TemporaryFileSystem=/var/lib
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 27 Jul 2021 15:41:38 +0000 (16:41 +0100)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 27 Oct 2021 21:45:26 +0000 (22:45 +0100)
commitdf61e79a5d9d6adfb8ea7f5f9dcb98fdda136910
treea0697fcfbf78ed999db19bfa41e578bc166962e0
parentd5bb2b0375b04449401cd43855722b60a4dcccd4
core: make DynamicUser=1 and StateDirectory= work with TemporaryFileSystem=/var/lib

The /var/lib/private/foo -> /var/lib/foo symlink for StateDirectory and
DynamicUser is set up on the host filesystem, before the mount namespacing
is brought up. If an empty /var/lib is used, to ensure the service does not
see other services data, the symlink is then not available despite
/var/lib/private being set up as expected.

Make a list of symlinks that need to be set up, and create them after all
the namespaced filesystems have been created, but before any eventual
read-only switch is flipped.
src/core/execute.c
src/core/namespace.c
src/core/namespace.h
src/test/test-namespace.c
src/test/test-ns.c
test/units/testsuite-34.sh