Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int check_authentication(char *password){
- char password_buffer[16];
- int auth_flag=0;
- strcpy(password_buffer,password);
- printf("%s\n", password_buffer);
- if(strcmp(password_buffer,"brillig")==0)
- auth_flag=1;
- if(strcmp(password_buffer,"outgrabe")==0)
- auth_flag=1;
- return auth_flag;
- }
- int main(int argc,char *argv[]){
- if(argc<2){
- printf("Usage:%s <password> \n", argv[0]);
- exit(0);
- }
- if(check_authentication(argv[1])){
- printf("\n-=-=-=-=-=-=-=-=-=-=-=--=-=-=--=-=-=-=-=\n");
- printf(" Access Granted \n");
- printf("\n-=-=-=-=-=-=-=-=-=-=-=--=-=-=--=-=-=-=-=\n");
- }else{
- printf("\nAccess Denied.\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement