From a145623bc403e410f41808a8e5cb31d29a52567c Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 4 Feb 2024 19:36:06 +0800 Subject: [PATCH] core/service: don't setup credentials for ExecCondition= and ExecReload= This seems to be a mistake in #27279. I believe credentials should not be made available to condition or reload tasks. In most cases they're irrelevant from the actual job of the service. Also, currently the first ExecCondition= or ExecReload= cannot access creds anyway, making the incompatibility introduced negligible. If people actually come up with valid use cases, we can always revisit this. --- src/core/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index ac9986994d..41fe842db6 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1609,7 +1609,7 @@ static ExecFlags service_exec_flags(ServiceExecCommand command_id) { /* All start phases get access to credentials */ // FIXME: SERVICE_EXEC_START_POST - if (IN_SET(command_id, /* FIXME */ SERVICE_EXEC_CONDITION, SERVICE_EXEC_START_PRE, SERVICE_EXEC_START, /* FIXME */ SERVICE_EXEC_RELOAD)) + if (IN_SET(command_id, SERVICE_EXEC_START_PRE, SERVICE_EXEC_START)) flags |= EXEC_WRITE_CREDENTIALS; if (IN_SET(command_id, SERVICE_EXEC_START_PRE, SERVICE_EXEC_START)) -- 2.25.1