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:
parent
d0077ef1e5
commit
42d18c8db5
1 changed files with 6 additions and 6 deletions
|
@ -361,8 +361,9 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
|
||||||
} else if (workaround == Workaround::Input) {
|
} else if (workaround == Workaround::Input) {
|
||||||
if (geteuid() != 0) {
|
if (geteuid() != 0) {
|
||||||
syslog(LOG_WARNING, "Insufficient permission to create the fake device");
|
syslog(LOG_WARNING, "Insufficient permission to create the fake device");
|
||||||
conv_function(PAM_ERROR_MSG, S("Insufficient permission to send Enter "
|
conv_function(PAM_ERROR_MSG,
|
||||||
"input, waiting for Enter input..."));
|
S("Insufficient permission to send Enter "
|
||||||
|
"press, waiting for user to press it instead"));
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
EnterDevice enter_device;
|
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) {
|
} catch (std::runtime_error &err) {
|
||||||
syslog(LOG_WARNING, "Failed to send enter input: %s", err.what());
|
syslog(LOG_WARNING, "Failed to send enter input: %s", err.what());
|
||||||
conv_function(
|
conv_function(PAM_ERROR_MSG, S("Failed to send Enter press, waiting "
|
||||||
PAM_ERROR_MSG,
|
"for user to press it instead"));
|
||||||
S("Failed to send Enter input, waiting for Enter input..."));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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)
|
// input wasn't focused or if the uinput device failed to send keypress)
|
||||||
pass_task.stop(false);
|
pass_task.stop(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue