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)

pull/5/merge
David Schweikert 13 years ago
parent b788ca80ef
commit d731dfc5b1

@ -3,6 +3,9 @@ David Schweikert <david@schweikert.ch>
- Revision v3.1 ALPHA - Revision v3.1 ALPHA
* -g option (generate): exclude network and broadcast address for cidr * -g option (generate): exclude network and broadcast address for cidr
ranges (idea by Eric Brander) 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 * ANSI C (C89) compiler now a requirement
* portability fixes * portability fixes

@ -389,15 +389,6 @@ int main( int argc, char **argv )
/* check if we are root */ /* 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 */ /* confirm that ICMP is available on this machine */
#ifndef IPV6 #ifndef IPV6
if( ( proto = getprotobyname( "icmp" ) ) == NULL ) if( ( proto = getprotobyname( "icmp" ) ) == NULL )
@ -414,7 +405,7 @@ int main( int argc, char **argv )
#endif #endif
if( s < 0 ) 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 #ifdef IPV6
/* /*

Loading…
Cancel
Save