From fe760177fe0c1d272f395c2fa144ec37194d80fa Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 4 Feb 2024 19:34:16 +0800 Subject: [PATCH] core/service: don't give ExecStopPost= commands tty access 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index a7bf1b8cfe..ac9986994d 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -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 */ -- 2.25.1