#include #include int main(argc, argv) int argc; char *argv[]; { FILE *authfile; char runme[2000]; char allowed[50]; int temp; if ( 2 > argc) { printf("Usage: %s [script name] \n", argv[0]); exit(1); } authfile = fopen ("auth.dat","r"); if (authfile == (FILE*) NULL) { printf ("** ERROR READING auth.dat, Access Denied\n"); } else { while (fgets(allowed,50,authfile)) { temp = strlen(allowed); allowed[temp-1]=NULL; if(strcmp(allowed,argv[1])==0) { runme[0]=46; runme[1]=47; for ( temp = 1; temp < argc; temp++) { strcat(runme,argv[temp]); strcat(runme, " "); } /*strcat("/usr/sbin/auth/",runme);*/ system(runme); exit(0); } } } printf ("** COMMAND NOT ALLOWED\n"); return 1; }