From 9f0238d78849067bc263802311d2286e42345141 Mon Sep 17 00:00:00 2001 From: Linux User Date: Mon, 25 Oct 2021 16:57:44 +0200 Subject: [PATCH] pause for some time on wrong password --- us.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/us.c b/us.c index 25b06c4..bcb92da 100644 --- a/us.c +++ b/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;