Fix fd leak of /dev/tty on auth failure, introduced in revision 1.91.
authormillert <millert@openbsd.org>
Wed, 13 Oct 2021 17:41:14 +0000 (17:41 +0000)
committermillert <millert@openbsd.org>
Wed, 13 Oct 2021 17:41:14 +0000 (17:41 +0000)
commit8a9f00d353222b3d056e9e397cc79c20a65d7917
tree4a019a6d94ce4df57ca558ce1e89c898c0b2b058
parent09a3e3768d8351aaa461e9d2f131bbf572b668d2
Fix fd leak of /dev/tty on auth failure, introduced in revision 1.91.
Move the auth retry loop into authuser() and only open /dev/tty once.
Also refactor the password reading into authuser_checkpass().
Bug reported by multi AT in-addr DOT xyz.  OK kn@
usr.bin/doas/doas.c