diff --git a/src/core/execute.c b/src/core/execute.c index 4a488d075a..ad6ab6703e 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1458,7 +1458,7 @@ static bool context_has_no_new_privileges(const ExecContext *c) { context_has_syscall_logs(c); } -bool exec_context_has_credentials(const ExecContext *context) { +static bool exec_context_has_credentials(const ExecContext *context) { assert(context); diff --git a/src/core/execute.h b/src/core/execute.h index d2c39d9925..325f340862 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -465,7 +465,6 @@ const char* exec_context_fdname(const ExecContext *c, int fd_index); bool exec_context_may_touch_console(const ExecContext *c); bool exec_context_maintains_privileges(const ExecContext *c); -bool exec_context_has_credentials(const ExecContext *context); int exec_context_get_effective_ioprio(const ExecContext *c); bool exec_context_get_effective_mount_apivfs(const ExecContext *c); diff --git a/src/core/unit.c b/src/core/unit.c index 25ffc3469d..1fb7b64b98 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1347,26 +1347,6 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) { if (r < 0) return r; - if (exec_context_has_credentials(c) && u->manager->prefix[EXEC_DIRECTORY_RUNTIME]) { - _cleanup_free_ char *p = NULL, *m = NULL; - - /* Let's make sure the credentials directory of this service is unmounted *after* the service - * itself shuts down. This only matters if mount namespacing is not used for the service, and - * hence the credentials mount appears on the host. */ - - p = path_join(u->manager->prefix[EXEC_DIRECTORY_RUNTIME], "credentials", u->id); - if (!p) - return -ENOMEM; - - r = unit_name_from_path(p, ".mount", &m); - if (r < 0) - return r; - - r = unit_add_dependency_by_name(u, UNIT_AFTER, m, /* add_reference= */ true, UNIT_DEPENDENCY_FILE); - if (r < 0) - return r; - } - return 0; }