From 0dca49ae4e6f488e77b05c97b2988e4962c303b6 Mon Sep 17 00:00:00 2001 From: octo Date: Sun, 30 Apr 2006 16:37:45 +0000 Subject: [PATCH] Check for superuser privileges at startup. --- src/oping.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.30.2