Monday, November 8, 2010

Check the root access in linux

#include <unistd.h>#include <sys/types.h>#include <stdio.h>int
{

{
printf(
}
main()if(getuid())"Error Must be in rooot");elseprintf(

}
/////////////////////////////
Getuid returns 0 for root access
"u are in root");