Add SUDO_CONV_PREFER_TTY flag for conversation function to tell

sudo to try writing to /dev/tty first.  Can be used in conjunction
with SUDO_CONV_INFO_MSG and SUDO_CONV_ERROR_MSG.
This commit is contained in:
Todd C. Miller
2018-06-13 11:19:33 -06:00
parent 89c83f0321
commit 6eadaddc99
5 changed files with 196 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ struct sudo_conv_message {
#define SUDO_CONV_INFO_MSG 0x0004 /* informational message */
#define SUDO_CONV_PROMPT_MASK 0x0005 /* mask user input */
#define SUDO_CONV_PROMPT_ECHO_OK 0x1000 /* flag: allow echo if no tty */
#define SUDO_CONV_PREFER_TTY 0x2000 /* flag: use tty if possible */
int msg_type;
int timeout;
const char *msg;