0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

refactor: improve error messages

This commit is contained in:
MusiKid 2022-01-25 18:32:39 +01:00 committed by musikid
parent d0077ef1e5
commit 42d18c8db5
No known key found for this signature in database
GPG key ID: 7567D43648C6E2F4

View file

@ -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);
}