#include #include #define NUSERS 3 int main (int argc, char *argv[]) { char apache[]="/etc/rc.d/init.d/httpd.jkl stop"; int i, authorize, authorized_uids[NUSERS] = {169, 500, 501}; authorize = 0; for(i = 0; i < NUSERS; i++) { if((getuid() == authorized_uids[i]) || (getuid() == 0)){ authorize = 1; } } if(authorize == 0) { fprintf(stderr, "Sorry, you are not the chosen one...\n"); exit(1); } setreuid(0,0); setregid(0,0); system(apache); exit(0); }