core: assign TTY to PAM context when TTYPath= is specified
Fixes #38486 again, which was fixed by1405d46bf9, but regressed again byf875a8026e. This also make it use exec_input_is_terminal(). Follow-up forf875a8026e.
This commit is contained in:
@@ -1237,7 +1237,10 @@ 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)) {
|
||||
/* Do not implicitly configure TTY unless TTYPath= or StandardInput=tty is specified. See issue
|
||||
* #39334. Note, exec_context_tty_path() returns "/dev/console" when TTYPath= is unspecified, hence
|
||||
* explicitly check context->tty_path here. */
|
||||
if (!context->tty_path && !exec_input_is_terminal(context->std_input)) {
|
||||
*ret = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user