Check for root user
authorOrk <ork@olol.eu>
Wed, 9 Oct 2013 22:44:55 +0000 (00:44 +0200)
committerOrk <ork@olol.eu>
Wed, 9 Oct 2013 22:44:55 +0000 (00:44 +0200)
evhz.c

diff --git a/evhz.c b/evhz.c
index a34fd83277723d9397905669bc8a47451ef10a1b..c4dd389763c5490748809a03db2d8b89a2494258 100644 (file)
--- a/evhz.c
+++ b/evhz.c
@@ -42,6 +42,11 @@ int main(int argc, char *argv[]) {
                }
        }
 
+    if(geteuid() != 0) {
+        printf("%s must be used as superuser", argv[0]);
+        return 1;
+    }
+
        signal(SIGINT, sigint);
 
        printf("Press CTRL-C to exit.\n\n");