mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-19 09:51:19 +02:00
fix: use euidaccess
to check permissions
This commit is contained in:
parent
42d18c8db5
commit
ab79c5b674
1 changed files with 4 additions and 3 deletions
|
@ -359,10 +359,11 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
|
|||
if (workaround == Workaround::Native && pass_task.is_active()) {
|
||||
pass_task.stop(true);
|
||||
} else if (workaround == Workaround::Input) {
|
||||
if (geteuid() != 0) {
|
||||
syslog(LOG_WARNING, "Insufficient permission to create the fake device");
|
||||
// We check if we have the right permissions on /dev/uinput
|
||||
if (euidaccess("/dev/uinput", W_OK | R_OK) != 0) {
|
||||
syslog(LOG_WARNING, "Insufficient permissions to create the fake device");
|
||||
conv_function(PAM_ERROR_MSG,
|
||||
S("Insufficient permission to send Enter "
|
||||
S("Insufficient permissions to send Enter "
|
||||
"press, waiting for user to press it instead"));
|
||||
} else {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue