aboutsummaryrefslogtreecommitdiffstats
path: root/src/cerberus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cerberus.c')
-rw-r--r--src/cerberus.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cerberus.c b/src/cerberus.c
index 9563ede..1479771 100644
--- a/src/cerberus.c
+++ b/src/cerberus.c
@@ -291,13 +291,26 @@ void do_login(int argc, char** argv)
/* Verify passphrase or other token, if -f has not been used */
+ ret = 2;
#if AUTH == 0
(void) hostname;
#else
initialise_login(hostname, username, read_passphrase);
- if ((skip_auth == 0) && authenticate_login())
+ if (skip_auth == 0)
+ ret = authenticate_login();
#endif
+ if (ret == 2)
printf("(auto-authenticated)\n");
+ if (ret == 0)
+ {
+ if (fork() == 0)
+ {
+ exec_hook(HOOK_DENIED, argc, argv);
+ _exit(0);
+ }
+ sleep(FAILURE_SLEEP);
+ _exit(1);
+ }
#if AUTH > 0
/* Passphrase entered, turn off timeout */