Add sudoers option to perform authentication even in non-interative mode.
If noninteractive_auth is set, authentication methods that do not require input from the user's terminal may proceed. It is off by default, which restores the pre-1.9.9 behavior of "sudo -n".
This commit is contained in:
@@ -125,6 +125,12 @@ check_user_interactive(int validated, int mode, struct getpass_closure *closure)
|
||||
FALLTHROUGH;
|
||||
|
||||
default:
|
||||
if (ISSET(mode, MODE_NONINTERACTIVE) && !def_noninteractive_auth) {
|
||||
validated |= FLAG_NO_USER_INPUT;
|
||||
log_auth_failure(validated, 0);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* XXX - should not lecture if askpass helper is being used. */
|
||||
lectured = display_lecture(closure->tstat);
|
||||
|
||||
|
Reference in New Issue
Block a user