From 215a1dbc2f8fd0dd9bb084a49208af62123b2897 Mon Sep 17 00:00:00 2001 From: boltgolt Date: Sun, 19 Feb 2023 15:21:07 +0100 Subject: [PATCH] Error code fixes --- howdy/src/config.ini | 2 +- howdy/src/pam/main.cc | 2 +- howdy/src/pam/main.hh | 2 +- howdy/src/rubberstamps/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/howdy/src/config.ini b/howdy/src/config.ini index 8e4ca79..27ab823 100644 --- a/howdy/src/config.ini +++ b/howdy/src/config.ini @@ -31,7 +31,7 @@ disabled = false use_cnn = false # Set a workaround to do face and password authentication at the same time -# off diables concurrency, so password authentication starts after Howdy +# off user will have to press enter themselves after a Howdy timeout # input will send an enter keypress to stop the password prompt # native will stop the prompt at PAM level (can lead to instability!) workaround = off diff --git a/howdy/src/pam/main.cc b/howdy/src/pam/main.cc index 4090cba..75b3d15 100644 --- a/howdy/src/pam/main.cc +++ b/howdy/src/pam/main.cc @@ -351,7 +351,7 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv, // If python process ran into a timeout // Do not send enter presses or terminate the PAM function, as the user might still be typing their password - if (status == CompareError::TIMEOUT_ACTIVE) { + if (WEXITSTATUS(status) == CompareError::TIMEOUT_REACHED && WIFEXITED(status)) { // Wait for the password to be typed pass_task.stop(false); diff --git a/howdy/src/pam/main.hh b/howdy/src/pam/main.hh index 12f687d..30716bb 100644 --- a/howdy/src/pam/main.hh +++ b/howdy/src/pam/main.hh @@ -14,7 +14,7 @@ enum CompareError : int { ABORT = 12, TOO_DARK = 13, INVALID_DEVICE = 14, - TIMEOUT_ACTIVE = 2816 + RUBBERSTAMP = 15 }; inline auto get_workaround(const std::string &workaround) -> Workaround { diff --git a/howdy/src/rubberstamps/__init__.py b/howdy/src/rubberstamps/__init__.py index 1c85297..0e14648 100644 --- a/howdy/src/rubberstamps/__init__.py +++ b/howdy/src/rubberstamps/__init__.py @@ -170,7 +170,7 @@ def execute(config, gtk_proc, opencv): # Abort authentication if the stamp returned false if result is False: if verbose: print("Authentication aborted by rubber stamp") - sys.exit(14) + sys.exit(15) # This is outside the for loop, so we've run all the rules if verbose: print("All rubberstamps processed, authentication successful")