The following commit has been merged in the master branch: commit 3905d90a61fdc391b38711d9f0570d4262a91751 Author: Marek Lindner lindner_marek@yahoo.de Date: Thu Jan 25 20:57:37 2007 +0100
check if batmand is started by root
diff --git a/posix.c b/posix.c index eec43a3..b6aad53 100644 --- a/posix.c +++ b/posix.c @@ -245,6 +245,14 @@ int main( int argc, char *argv[] ) { // memset( &device_node_array[0], 0, sizeof( device_node_array ) ); // printf("B.A.T.M.A.N-experimental %s\n", VERSION);
+ /* Check if user is root */ + if ( ( getuid() ) || ( getgid() ) ) { + + fprintf( stderr, "Error - you must be root to run batmand !\n" ); + exit(EXIT_FAILURE); + + } + apply_init_args( argc, argv );