C_LOADRUNNER 42
Buf-ex1.c Guest on 14th May 2020 10:45:05 AM
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5. {
  6.     char buff[15];
  7.     int pass = 0;
  8.  
  9.     printf("\n Enter the password : \n");
  10.     gets(buff);
  11.  
  12.     if(strcmp(buff, "redhawk"))
  13.     {
  14.         printf ("\n Wrong Password \n");
  15.     }
  16.     else
  17.     {
  18.         printf ("\n Correct Password \n");
  19.         pass = 1;
  20.     }
  21.  
  22.     if(pass)
  23.     {
  24.        /* Now Give root or admin rights to user*/
  25.         printf ("\n Root privileges given to the user \n");
  26.     }
  27.  
  28.     return 0;
  29. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.