pause for some time on wrong password

master
Linux User 3 years ago
parent b97be63e1a
commit 9f0238d788
  1. 2
      us.c

@ -61,6 +61,7 @@
#define FLAG_NOLOG 0x4
#define SESSION_FILE_DIR "/var/run"
#define SESSION_TIMEOUT (60*5)
#define FAIL_PAUSE 3
struct env_elem {
char *name;
@ -620,6 +621,7 @@ static int authenticate(uid_t uid, int ask, int persist)
/* Remove password from memory, just to be sure */
memset(pass, 0, PASS_MAX);
if (strncmp(hash, enc, PASS_MAX)) {
sleep(FAIL_PAUSE);
printf("Authentication failure\n");
setuid(uid);
return -1;

Loading…
Cancel
Save