From: Todd C. Miller Date: Thu, 15 Jan 2004 20:13:47 +0000 (+0000) Subject: Add support for chalnecho and display server responses used by fwtk >= 2.0 X-Git-Tag: SUDO_1_6_8~243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae1a984afcff5c75505482f6955d0ce0aa43b454;p=sudo Add support for chalnecho and display server responses used by fwtk >= 2.0 --- diff --git a/auth/fwtk.c b/auth/fwtk.c index 1fe52aab6..1af20a2b0 100644 --- a/auth/fwtk.c +++ b/auth/fwtk.c @@ -122,6 +122,7 @@ fwtk_verify(pw, prompt, auth) /* Send username to authentication server. */ (void) snprintf(buf, sizeof(buf), "authorize %s 'sudo'", pw->pw_name); +restart: if (auth_send(buf) || auth_recv(resp, sizeof(resp))) { warnx("lost connection to authentication server"); return(AUTH_FATAL); @@ -135,9 +136,15 @@ fwtk_verify(pw, prompt, auth) pass = tgetpass("Response [echo on]: ", def_passwd_timeout * 60, tgetpass_flags | TGP_ECHO); } + } else if (strncmp(resp, "chalnecho ", 10) == 0) { + pass = tgetpass(&resp[10], def_passwd_timeout * 60, tgetpass_flags); } else if (strncmp(resp, "password", 8) == 0) { pass = tgetpass(prompt, def_passwd_timeout * 60, tgetpass_flags); + } else if (strncmp(resp, "display ", 8) == 0) { + fprintf(stderr, "%s\n", &resp[8]); + strlcpy(buf, "response dummy", sizeof(buf)); + goto restart; } else { warnx("%s", resp); return(AUTH_FATAL);