Permalink
Browse files

When the user is allowed to run commands without a password (ie nopas…

…s 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.
  • Loading branch information...
Jesse
Jesse committed Jul 5, 2016
1 parent 1a3589f commit dc0fb3212d97a6a726ee2c2a96ae6d86b138c0ba
Showing with 5 additions and 2 deletions.
  1. +5 −2 doas.c
View
7 doas.c
@@ -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

0 comments on commit dc0fb32

Please sign in to comment.