
Untitled
By: a guest on
Jun 21st, 2012 | syntax:
None | size: 0.48 KB | hits: 22 | expires: Never
#include <stdio.h>
#include <string.h>
void dostuff(int uid, char *command)
{
if (uid > 0)
printf("command %s\n",command);
else
printf("welcome to the machine\n"); // **admin**
}
int main(int argc, char ** argv)
{
int test;
int uid;
char cmd[32];
if (argc<3) {
printf("start with %s password command\n",argv[0]);
return -1;
}
if (!strcmp(argv[1],"secret")) //replace by database
// access
uid=-1;
else
uid =1;
strcpy(cmd, argv[2]);
dostuff(uid, cmd);
printf("done\n");
}