Fix -A flag when askpass is specified in sudo.conf or if sudo doesn't need

to read a password.
This commit is contained in:
Todd C. Miller
2010-06-15 15:11:10 -04:00
parent f64bb67c6c
commit 4fb8a83e6f
5 changed files with 7 additions and 13 deletions

View File

@@ -101,8 +101,9 @@ tgetpass(const char *prompt, int timeout, int flags)
/* If using a helper program to get the password, run it instead. */
if (ISSET(flags, TGP_ASKPASS)) {
if (askpass && *askpass)
return(sudo_askpass(askpass, prompt));
if (askpass == NULL || *askpass == '\0')
errorx(1, "no askpass program specified, try setting SUDO_ASKPASS");
return(sudo_askpass(askpass, prompt));
}
restart: