From: David Schweikert Date: Thu, 16 Feb 2012 22:07:05 +0000 (+0100) Subject: do not explicitely check if running as root, to make it possible to install fping... X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d731dfc5b1f8e79c6a5e70c26cec10ebf2bd4fa5;p=fping.git do not explicitely check if running as root, to make it possible to install fping with linux capabilities instead of making it setuid (setcap cap_net_raw+ep fping) --- diff --git a/ChangeLog b/ChangeLog index d70f1af..1e73b29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ David Schweikert - Revision v3.1 ALPHA * -g option (generate): exclude network and broadcast address for cidr ranges (idea by Eric Brander) + * do not explicitely check if running as root, to make it possible to + install fping with linux capabilities instead of making it setuid + (setcap cap_net_raw+ep fping) * ANSI C (C89) compiler now a requirement * portability fixes diff --git a/fping.c b/fping.c index e6a6696..d22eb92 100644 --- a/fping.c +++ b/fping.c @@ -389,15 +389,6 @@ int main( int argc, char **argv ) /* check if we are root */ - if( geteuid() ) - { - fprintf( stderr, - "This program can only be run by root, or it must be setuid root.\n" ); - - exit( 3 ); - - }/* IF */ - /* confirm that ICMP is available on this machine */ #ifndef IPV6 if( ( proto = getprotobyname( "icmp" ) ) == NULL ) @@ -414,7 +405,7 @@ int main( int argc, char **argv ) #endif if( s < 0 ) - errno_crash_and_burn( "can't create raw socket" ); + errno_crash_and_burn( "can't create raw socket (must run as root?)" ); #ifdef IPV6 /*