]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: don't give ExecStopPost= commands tty access
authorMike Yuan <me@yhndnzj.com>
Sun, 4 Feb 2024 11:34:16 +0000 (19:34 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 4 Feb 2024 16:47:07 +0000 (00:47 +0800)
All tasks spawned later than ExecStart= (e.g. ExecReload=, ExecStop=, ...)
don't get tty access. ExecStopPost= is the odd one out. Fix that.

src/core/service.c

index a7bf1b8cfeead154d11b603cf27be057fbc51e05..ac9986994d3c549c1e5aa23e7f4f37a30569bba2 100644 (file)
@@ -1604,7 +1604,7 @@ static ExecFlags service_exec_flags(ServiceExecCommand command_id) {
         assert(command_id < _SERVICE_EXEC_COMMAND_MAX);
 
         /* Control processes spawned before main process also get tty access */
-        if (IN_SET(command_id, SERVICE_EXEC_CONDITION, SERVICE_EXEC_START_PRE, SERVICE_EXEC_START, /* FIXME */ SERVICE_EXEC_STOP_POST))
+        if (IN_SET(command_id, SERVICE_EXEC_CONDITION, SERVICE_EXEC_START_PRE, SERVICE_EXEC_START))
                 flags |= EXEC_APPLY_TTY_STDIN;
 
         /* All start phases get access to credentials */