Push non-interactive mode checking down into the auth methods.

For "sudo -n" we only want to reject a command if user input is
actually required.  In the case of PAM at least, we may not need
to interact with the user.  Bug #956, GitHub issue #83
This commit is contained in:
Todd C. Miller
2022-01-04 18:57:36 -07:00
parent 296d876b76
commit 521ef37aea
14 changed files with 72 additions and 21 deletions

View File

@@ -236,6 +236,9 @@ sudo_aix_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_co
int ret = AUTH_SUCCESS;
debug_decl(sudo_aix_verify, SUDOERS_DEBUG_AUTH);
if (IS_NONINTERACTIVE(auth))
debug_return_int(AUTH_NONINTERACTIVE);
do {
pass = auth_getpass(prompt, SUDO_CONV_PROMPT_ECHO_OFF, callback);
if (pass == NULL)