Re-enable terminal echo after fingerprint auth

This commit is contained in:
Dash
2022-03-08 20:09:56 -05:00
parent 564502577e
commit 354dd16468

View File

@ -38,6 +38,7 @@
#include <signal.h>
#include <sys/signalfd.h>
#include <poll.h>
#include <termios.h>
#define PAM_SM_AUTH
#include <security/pam_modules.h>
@ -788,6 +789,12 @@ do_auth (pam_handle_t *pamh, const char *username)
int ret = do_verify(bus, data);
pthread_cancel (pw_prompt_thread);
/* Authenticating with fingerprint doesn't re-enable echo, so we have to */
struct termios term;
tcgetattr(fileno(stdin), &term);
term.c_lflag |= ECHO;
tcsetattr(fileno(stdin), 0, &term);
/* Simply disconnect from bus if we return PAM_SUCCESS */
if (ret != PAM_SUCCESS)
release_device (pamh, bus, data->dev);