must be super-user to exec it.
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 24 Oct 1988 13:24:26 +0000 (05:24 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 24 Oct 1988 13:24:26 +0000 (05:24 -0800)
SCCS-vsn: usr.sbin/cron/cron.c 4.14

usr/src/usr.sbin/cron/cron.c

index caf9c6b..f476beb 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
-static char *sccsid = "@(#)cron.c      4.13 (Berkeley) %G%";
+static char *sccsid = "@(#)cron.c      4.14 (Berkeley) %G%";
 #endif
 
 #include <sys/types.h>
@@ -60,6 +60,11 @@ main(argc, argv)
        char c;
        extern char *optarg;
 
+       if (geteuid()) {
+               fprintf(stderr, "cron: NOT super-user\n");
+               exit(1);
+       }
+
        openlog("cron", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_DAEMON);
        switch (fork()) {