From: Mike Yuan Date: Sun, 4 Feb 2024 11:34:16 +0000 (+0800) Subject: core/service: don't give ExecStopPost= commands tty access X-Git-Tag: v256-rc1~968^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe760177fe0c1d272f395c2fa144ec37194d80fa;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/service.c b/src/core/service.c index a7bf1b8cfee..ac9986994d3 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 */