mirror of
https://github.com/slicer69/doas
synced 2024-07-24 03:34:26 +00:00
dbfba4e976
openpam_ttyconv checks if stdin is a terminal and if it is then does not bother to open /dev/tty. The result is that PAM writes the password prompt directly to stdout. In scenarios where stdin is a terminal, but stdout is redirected to a file e.g. by running doas ls &> ls.out interactively, the password prompt gets written to ls.out as well. By closing stdin first we forces PAM to read/write to/from the terminal directly. We restore stdin after authenticating. Also see https://github.com/freebsd/freebsd/blob/master/contrib/openpam/lib/libpam/openpam_ttyconv.c#L293 |
||
---|---|---|
doas.1 | ||
doas.c | ||
doas.conf.5 | ||
doas.h | ||
env.c | ||
execvpe.c | ||
LICENSE | ||
Makefile | ||
parse.y | ||
reallocarray.c | ||
tree.h |