Add SUDO_CONV_PROMPT_MASK define which corresponds to the "pwfeedback"

sudoers option.  Do not disable echo if TGP_ECHO is set.
This commit is contained in:
Todd C. Miller
2010-06-09 10:31:05 -04:00
parent 51f70f2040
commit a4a6620b24
8 changed files with 55 additions and 43 deletions

View File

@@ -308,9 +308,13 @@ auth_getpass(const char *prompt, int timeout, int type)
struct sudo_conv_message msg;
struct sudo_conv_reply repl;
/* Mask user input if pwfeedback set and echo is off. */
if (type == SUDO_CONV_PROMPT_ECHO_OFF && def_pwfeedback)
type = SUDO_CONV_PROMPT_MASK;
/* Call conversation function */
memset(&msg, 0, sizeof(msg));
msg.msg_type = SUDO_CONV_PROMPT_ECHO_OFF;
msg.msg_type = type;
msg.timeout = def_passwd_timeout * 60;
msg.msg = prompt;
memset(&repl, 0, sizeof(repl));