]> git.armaanb.net Git - opendoas.git/blobdiff - doas.c
prepenv can take a const rule
[opendoas.git] / doas.c
diff --git a/doas.c b/doas.c
index 7757f49659969ab979367449feac2398f90a1cb0..d30f73d25def4aefa040516647a0494d0bd6a065 100644 (file)
--- a/doas.c
+++ b/doas.c
@@ -55,20 +55,6 @@ usage(void)
        exit(1);
 }
 
-size_t
-arraylen(const char **arr)
-{
-       size_t cnt = 0;
-
-       if (arr) {
-               while (*arr) {
-                       cnt++;
-                       arr++;
-               }
-       }
-       return cnt;
-}
-
 static int
 parseuid(const char *s, uid_t *uid)
 {
@@ -426,6 +412,9 @@ main(int argc, char **argv)
                exit(1);        /* fail safe */
        }
 
+       if (geteuid())
+               errx(1, "not installed setuid");
+
        parseconfig("/etc/doas.conf", 1);
 
        /* cmdline is used only for logging, no need to abort on truncate */