From 42d18c8db5f0cbed02298e734b445617e33b250b Mon Sep 17 00:00:00 2001 From: MusiKid Date: Tue, 25 Jan 2022 18:32:39 +0100 Subject: [PATCH] refactor: improve error messages --- src/pam/main.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pam/main.cc b/src/pam/main.cc index 831f378..fe06872 100644 --- a/src/pam/main.cc +++ b/src/pam/main.cc @@ -361,8 +361,9 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv, } else if (workaround == Workaround::Input) { if (geteuid() != 0) { syslog(LOG_WARNING, "Insufficient permission to create the fake device"); - conv_function(PAM_ERROR_MSG, S("Insufficient permission to send Enter " - "input, waiting for Enter input...")); + conv_function(PAM_ERROR_MSG, + S("Insufficient permission to send Enter " + "press, waiting for user to press it instead")); } else { try { EnterDevice enter_device; @@ -374,13 +375,12 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv, } } catch (std::runtime_error &err) { syslog(LOG_WARNING, "Failed to send enter input: %s", err.what()); - conv_function( - PAM_ERROR_MSG, - S("Failed to send Enter input, waiting for Enter input...")); + conv_function(PAM_ERROR_MSG, S("Failed to send Enter press, waiting " + "for user to press it instead")); } } - // We stop the thread (will block until the enter key is pressed, if the + // We stop the thread (will block until the enter key is pressed if the // input wasn't focused or if the uinput device failed to send keypress) pass_task.stop(false); }