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.
This commit is contained in:
@@ -3324,6 +3324,7 @@ int bus_exec_context_set_transient_property(
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
}
|
||||
exec_directory_sort(d);
|
||||
|
||||
joined = unit_concat_strv(l, UNIT_ESCAPE_SPECIFIERS);
|
||||
if (!joined)
|
||||
@@ -3787,6 +3788,8 @@ int bus_exec_context_set_transient_property(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
exec_directory_sort(directory);
|
||||
|
||||
r = sd_bus_message_exit_container(message);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user