When the user is allowed to run commands without a password (ie nopass has

been set in the doas.conf file) then we do not need to redirect a password
prompt to stderr. This patch makes sure output is displayed properly
when the user authenticates with "nopass" set.
This commit is contained in:
Jesse 2016-07-05 19:45:40 +00:00
parent 1a3589f137
commit dc0fb3212d

7
doas.c
View file

@ -523,8 +523,11 @@ main(int argc, char **argv)
*/
/* Re-establish stdout */
#ifdef USE_PAM
close(1);
dup2(temp_stdout, 1);
if (!(rule->options & NOPASS))
{
close(1);
dup2(temp_stdout, 1);
}
#endif
/* If we effectively root, set the UID to actually be root to avoid