aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/skhd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/skhd.c b/src/skhd.c
index ef0d82d..0e162c6 100644
--- a/src/skhd.c
+++ b/src/skhd.c
@@ -5,6 +5,7 @@
#include <getopt.h>
#include <signal.h>
#include <string.h>
+#include <unistd.h>
#include <Carbon/Carbon.h>
@@ -201,6 +202,10 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
+ if(getuid() == 0 || geteuid() == 0) {
+ error("skhd: running as root is not allowed! abort..\n");
+ }
+
if(secure_keyboard_entry_enabled()) {
error("skhd: secure keyboard entry is enabled! abort..\n");
}