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 created a YouTube channel | January 11, 2025 | 84 views
School Memes | September 24, 2021 | 41294 views
First post of 2025 | January 01, 2025 | 104 views
It's been a while... here's a random meme. | January 16, 2025 | 105 views
I plan on making a real "fake" OS | November 20, 2024 | 211 views

Quick Settings


Top Users

Dheirya_Tyagi_CEO | 3841 Reputation
Bravo | 2456 Reputation
Bendy | 2107 Reputation
ajh | 2031 Reputation
Eklavya_Tyagi | 1315 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 | 26 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 | 20 posts

Talk about personal topics in this category.


Not displaying all categories. See all categories.