Merge branch 'grosshack' into 'grosshack'

Re-enable terminal echo after fingerprint auth

Closes #1

See merge request mishakmak/pam-fprint-grosshack!1
This commit is contained in:
mishakmak
2022-07-27 20:08:46 +00:00

View File

@ -40,6 +40,7 @@
#include <signal.h> #include <signal.h>
#include <sys/signalfd.h> #include <sys/signalfd.h>
#include <poll.h> #include <poll.h>
#include <termios.h>
#define PAM_SM_AUTH #define PAM_SM_AUTH
#include <security/pam_modules.h> #include <security/pam_modules.h>
@ -794,6 +795,12 @@ do_auth (pam_handle_t *pamh, const char *username)
int ret = do_verify(bus, data); int ret = do_verify(bus, data);
pthread_cancel (pw_prompt_thread); 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 */ /* Simply disconnect from bus if we return PAM_SUCCESS */
if (ret != PAM_SUCCESS) if (ret != PAM_SUCCESS)
release_device (pamh, bus, data->dev); release_device (pamh, bus, data->dev);