From: octo Date: Sun, 30 Apr 2006 16:37:45 +0000 (+0000) Subject: Check for superuser privileges at startup. X-Git-Tag: liboping-0.1.0~21 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0dca49ae4e6f488e77b05c97b2988e4962c303b6;p=collectd.git Check for superuser privileges at startup. --- diff --git a/src/oping.c b/src/oping.c index 0c799863..07f0cec6 100644 --- a/src/oping.c +++ b/src/oping.c @@ -253,6 +253,12 @@ int main (int argc, char **argv) int optind; int i; + if (geteuid () != 0) + { + fprintf (stderr, "Need superuser privileges to open a RAW socket. Sorry.\n"); + return (1); + } + optind = read_options (argc, argv); if (optind >= argc)