core: add EXEC_DIRECTORY_TYPE_SHALL_CHOWN() helper
Let's make ConfigurationDirectory= a bit less "special-casey", by hiding the fact that it's the only per-service dir we do not do chown()ing for inside of a new EXEC_DIRECTORY_TYPE_SHALL_CHOWN() helper.
This commit is contained in:
+2
-2
@@ -340,7 +340,7 @@ bool exec_directory_is_private(const ExecContext *context, ExecDirectoryType typ
|
||||
if (!context->dynamic_user)
|
||||
return false;
|
||||
|
||||
if (type == EXEC_DIRECTORY_CONFIGURATION)
|
||||
if (!EXEC_DIRECTORY_TYPE_SHALL_CHOWN(type))
|
||||
return false;
|
||||
|
||||
if (type == EXEC_DIRECTORY_RUNTIME && context->runtime_directory_preserve_mode == EXEC_PRESERVE_NO)
|
||||
@@ -1639,7 +1639,7 @@ int exec_context_get_clean_directories(
|
||||
return r;
|
||||
|
||||
/* Also remove private directories unconditionally. */
|
||||
if (t != EXEC_DIRECTORY_CONFIGURATION) {
|
||||
if (EXEC_DIRECTORY_TYPE_SHALL_CHOWN(t)) {
|
||||
j = path_join(prefix[t], "private", i->path);
|
||||
if (!j)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user