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

@@ -68,7 +68,12 @@ sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
repl = &replies[n];
switch (msg->msg_type) {
case SUDO_CONV_PROMPT_ECHO_ON:
SET(flags, TGP_ECHO);
case SUDO_CONV_PROMPT_MASK:
if (msg->msg_type == SUDO_CONV_PROMPT_ECHO_ON)
SET(flags, TGP_ECHO);
else
SET(flags, TGP_MASK);
/* FALLTHROUGH */
case SUDO_CONV_PROMPT_ECHO_OFF:
/* Read the password unless interrupted. */
pass = tgetpass(msg->msg, msg->timeout, flags);