Fetch the value of "askpass" from the sudo conf struct.

This commit is contained in:
Todd C. Miller
2012-03-27 12:25:04 -04:00
parent 8b3d118f62
commit d35a8b4de4
2 changed files with 1 additions and 9 deletions

View File

@@ -163,8 +163,6 @@ void cleanup(int);
/* tgetpass.c */
char *tgetpass(const char *, int, int);
int tty_present(void);
extern const char *askpass_path;
extern const char *noexec_path;
/* zero_bytes.c */
void zero_bytes(volatile void *, size_t);

View File

@@ -61,12 +61,6 @@ static void handler(int);
static char *getln(int, char *, size_t, int);
static char *sudo_askpass(const char *, const char *);
#ifdef _PATH_SUDO_ASKPASS
const char *askpass_path = _PATH_SUDO_ASKPASS;
#else
const char *askpass_path;
#endif
/*
* Like getpass(3) but with timeout and echo flags.
*/
@@ -86,7 +80,7 @@ tgetpass(const char *prompt, int timeout, int flags)
if (askpass == NULL) {
askpass = getenv("SUDO_ASKPASS");
if (askpass == NULL || *askpass == '\0')
askpass = askpass_path;
askpass = sudo_conf_askpass_path();
}
/* If no tty present and we need to disable echo, try askpass. */