]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: don't setup credentials for ExecCondition= and ExecReload=
authorMike Yuan <me@yhndnzj.com>
Sun, 4 Feb 2024 11:36:06 +0000 (19:36 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 4 Feb 2024 16:52:46 +0000 (00:52 +0800)
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

index ac9986994d3c549c1e5aa23e7f4f37a30569bba2..41fe842db63777b9e4585f57c1d0bbabe900fa11 100644 (file)
@@ -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))