Score:
74
Followers:
3

terminal locker for Unix made in C

This is script game fromt the book Unix System Security I took the scripts and edited it a little bit 

#include <stdio.h>
#include <signal.h>
 main ()
{
  char passbuf[10], *passwd, *getpass ();
  int sleepcount = 1;
  int validentry = 0;

  while ( ! validentry) {
    strcpy (passbuf, getpass ("Enter password: "));

    if ( strlen (passbuf) < 4)
      printf("Please enter at least four characters\n");
    else 
      validentry = 1;
    
  }
  signal(SIGINT, SIG_IGN);
  signal(SIGQUIT, SIG_IGN);
  printf("\n\n\n\n\n");
  printf("\t\t*************************************\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*          TERMINAL SECURED         *\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*                                   *\n");
  printf("\t\t*************************************\n");
  printf("\n\n\n\n\n");

  validentry = 0;

  while ( ! validentry){
    passwd = getpass ("Enter password: ");

    if (strcmp(passwd, passbuf) != 0){
      sleep(sleepcount);
      sleepcount *= 2;
      printf("Bad password, try again.\n");
    }
    else 
      validentry = 1, printf("Unlocked!\n");
  }

}

 



Login For More Features

So you can create and connect with what matters to you.

or
More From floppyfish118

Trending Posts

I like how the CEO's literal brother called out s… | August 21, 2024 | 112 views
i genuinely forgot this site existed | August 23, 2024 | 126 views
The state of Social Rumbles | August 04, 2024 | 97 views
Ryan's Toys Review in 2015: Let's open surprise e… | August 23, 2024 | 42 views
Hello world | July 02, 2024 | 457 views

Quick Settings


Top Users

Dheirya_Tyagi_CEO | 3812 Reputation
Bravo | 2456 Reputation
Bendy | 2105 Reputation
ajh | 2009 Reputation
Eklavya_Tyagi | 1295 Reputation

Precipitation: %
Wind: mph
Weather data updates every 6 hours.

Categories

Not a category you like? Create one.

Sports | 18 followers | 6 posts

Talk about sports in this category!


Lifestyle | 18 followers | 12 posts

Talk about lifestyle in this category!


Political | 14 followers | 5 posts

Talk about political issues in this category!


Travel | 10 followers | 4 posts

Talk about travel in this category!


Fashion | 16 followers | 4 posts

Talk about fashion in this category!


Education | 15 followers | 24 posts

Talk about education in this category!


Music | 19 followers | 7 posts

Talk about music in this category!


News | 13 followers | 22 posts

Talk about news in this category!


Personal | 18 followers | 19 posts

Talk about personal topics in this category.


Not displaying all categories. See all categories.