]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/dbus-execute.c
core: do not create symlink to private directory if parent already exists
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Sep 2022 04:06:54 +0000 (13:06 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Oct 2022 00:25:00 +0000 (09:25 +0900)
commita2ab603cc42e1484c799f76a233b077c17db91cb
treec94474cd395761e4b367b9adaafc223c71d9cd6d
parent564e5c987877f7e481d896c7fd82e8e5a69addc2
core: do not create symlink to private directory if parent already exists

The very basic functinality of StateDirectory= or friends is creating
specified directories. That should work if one entry is a subdirectory
of another. However, it does not when combined with DynamicUser=yes.

To support such case, this adds ExecDirectoryItem.only_create flag, and
if it is set PID1 only create private directory, and not create the symlink
to the private directory.

Fixes #24783.
src/core/dbus-execute.c
src/core/execute.c
src/core/execute.h
src/core/unit.c