From: Todd C. Miller Date: Fri, 13 Dec 2002 18:20:34 +0000 (+0000) Subject: Write the prompt *after* turning off echo to avoid some password characters X-Git-Tag: SUDO_1_6_7~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f9ed308f07e029e067e0b33010627bfc7bc8ea8;p=sudo Write the prompt *after* turning off echo to avoid some password characters being echoed on heavily-loaded machines with fast typists. --- diff --git a/tgetpass.c b/tgetpass.c index 659f854dc..a99604f4b 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -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;