]> granicus.if.org Git - sudo/commitdiff
Add support for chalnecho and display server responses used by fwtk >= 2.0
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 15 Jan 2004 20:13:47 +0000 (20:13 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 15 Jan 2004 20:13:47 +0000 (20:13 +0000)
auth/fwtk.c

index 1fe52aab6485587953add8f29a21415e39632136..1af20a2b0b7c51399f6fa042a7264c0bc7423e59 100644 (file)
@@ -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);