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