]> granicus.if.org Git - sudo/commitdiff
Repair challenge/response prompting for BSD authentication which
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Oct 2015 21:00:47 +0000 (15:00 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Oct 2015 21:00:47 +0000 (15:00 -0600)
got broken while it was converted to use the conversation function.

plugins/sudoers/auth/bsdauth.c

index 18a25e32f3e4f13796f3045353dd7f738a2ff6e2..438ba2dfba5ec7cb2888ab251ddd70208ad460c5 100644 (file)
@@ -123,7 +123,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_con
     if ((s = auth_challenge(as)) == NULL) {
        pass = auth_getpass(prompt, def_passwd_timeout * 60, SUDO_CONV_PROMPT_ECHO_OFF, callback);
     } else {
-       pass = auth_getpass(prompt, def_passwd_timeout * 60, SUDO_CONV_PROMPT_ECHO_OFF, callback);
+       pass = auth_getpass(s, def_passwd_timeout * 60, SUDO_CONV_PROMPT_ECHO_OFF, callback);
        if (pass && *pass == '\0') {
            if ((prompt = strrchr(s, '\n')))
                prompt++;
@@ -141,7 +141,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_con
                log_warningx(0, N_("unable to allocate memory"));
                debug_return_int(AUTH_FATAL);
            }
-           pass = auth_getpass(prompt, def_passwd_timeout * 60,
+           pass = auth_getpass(s, def_passwd_timeout * 60,
                SUDO_CONV_PROMPT_ECHO_ON, callback);
            free(s);
        }