From: Daan De Meyer Date: Thu, 16 Oct 2025 06:42:03 +0000 (+0200) Subject: core: Don't use TTYPath= for PAM unless StandardInput=tty X-Git-Tag: v259-rc1~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f875a8026ec2dfa6026da3ee216782e9f7c04a43;p=thirdparty%2Fsystemd.git core: Don't use TTYPath= for PAM unless StandardInput=tty Fixes #39334 --- diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index e02d2ddee69..06052ef57df 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -1226,6 +1226,11 @@ static int exec_context_get_tty_for_pam(const ExecContext *context, char **ret) return 1; } + if (!IN_SET(context->std_input, EXEC_INPUT_TTY, EXEC_INPUT_TTY_FAIL, EXEC_INPUT_TTY_FORCE)) { + *ret = NULL; + return 0; + } + /* Next, let's try to use the TTY specified in TTYPath=. */ const char *t = exec_context_tty_path(context); if (!t) {