summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-02-02 23:30:24 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-02-02 23:30:24 +1100
commit2fba993080eba14e339d6a6666ee79580ee20f97 (patch)
tree0b7bc9ce53758047f3a844b0f9d5679ace5e94eb /auth.c
parent9dc6c7dbec0716157e561036c480bca1bc3c7e47 (diff)
downloadopenssh-git-2fba993080eba14e339d6a6666ee79580ee20f97.tar.gz
- (dtucker) [auth.c canohost.c canohost.h configure.ac defines.h loginrec.c]
Bug #974: Teach sshd to write failed login records to btmp for failed auth attempts (currently only for password, kbdint and C/R, only on Linux and HP-UX), based on code from login.c from util-linux. With ashok_kovai at hotmail.com, ok djm@
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/auth.c b/auth.c
index dfc1be37..b6c00c12 100644
--- a/auth.c
+++ b/auth.c
@@ -244,7 +244,10 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
info);
#ifdef CUSTOM_FAILED_LOGIN
- if (authenticated == 0 && strcmp(method, "password") == 0)
+ if (authenticated == 0 && !authctxt->postponed &&
+ (strcmp(method, "password") == 0 ||
+ strncmp(method, "keyboard-interactive", 20) == 0) ||
+ strcmp(method, "challenge-response") == 0)
record_failed_login(authctxt->user,
get_canonical_hostname(options.use_dns), "ssh");
#endif