]> granicus.if.org Git - sudo/commitdiff
Write the prompt *after* turning off echo to avoid some password characters
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Dec 2002 18:20:34 +0000 (18:20 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Dec 2002 18:20:34 +0000 (18:20 +0000)
being echoed on heavily-loaded machines with fast typists.

tgetpass.c

index 659f854dcef4d77c766b8977c8e6fa69dc860f6d..a99604f4b6e17e150228113238002cd037515b2a 100644 (file)
@@ -154,9 +154,6 @@ restart:
        output = STDERR_FILENO;
     }
 
-    if (prompt)
-       (void) write(output, prompt, strlen(prompt));
-
     /*
      * Catch signals that would otherwise cause the user to end
      * up with echo turned off in the shell.  Don't worry about
@@ -187,6 +184,9 @@ restart:
        memset(&oterm, 0, sizeof(oterm));
     }
 
+    if (prompt)
+       (void) write(output, prompt, strlen(prompt));
+
     pass = tgetline(input, buf, sizeof(buf), timeout);
     save_errno = errno;