execute: also do the private/ symlink dance when runtime dir preservation is requested

In that case it's not safe to leave a regular dir around, hence, move it
to private/ too.
This commit is contained in:
Lennart Poettering 2019-03-14 17:00:35 +01:00
parent edbfeb1204
commit 40cd2ecc26

View file

@ -2085,7 +2085,8 @@ static int setup_exec_directory(
goto fail;
if (context->dynamic_user &&
!IN_SET(type, EXEC_DIRECTORY_RUNTIME, EXEC_DIRECTORY_CONFIGURATION)) {
(!IN_SET(type, EXEC_DIRECTORY_RUNTIME, EXEC_DIRECTORY_CONFIGURATION) ||
(type == EXEC_DIRECTORY_RUNTIME && context->runtime_directory_preserve_mode != EXEC_PRESERVE_NO))) {
_cleanup_free_ char *private_root = NULL;
/* So, here's one extra complication when dealing with DynamicUser=1 units. In that case we