summaryrefslogtreecommitdiffhomepage
path: root/svr-authpam.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-09-08 14:53:53 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-09-08 14:53:53 +0000
commit52551cb771e8cd1ba3b5eb137fc43b61bd35cd79 (patch)
tree98f548742f415989b50335bac93e46126a5777cf /svr-authpam.c
parent4dfb834f7cd153cd90904c36dca314f5516beca2 (diff)
- Test for pam_fail_delay() function in configure
- Recognise "username:" as a PAM prompt - Add some randomness to the auth-failure delay - Fix wrongly committed options.h/debug.h --HG-- extra : convert_revision : f242f0e66fb0ea5d3b374995d2f548d37dd8f3a3
Diffstat (limited to 'svr-authpam.c')
-rw-r--r--svr-authpam.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/svr-authpam.c b/svr-authpam.c
index 8d6a6e7..a570d71 100644
--- a/svr-authpam.c
+++ b/svr-authpam.c
@@ -102,7 +102,7 @@ pamConvFunc(int num_msg,
/* We don't recognise the prompt as asking for a password,
so can't handle it. Add more above as required for
different pam modules/implementations */
- dropbear_log(LOG_NOTICE, "PAM unknown prompt %s (no echo)",
+ dropbear_log(LOG_NOTICE, "PAM unknown prompt '%s' (no echo)",
compare_message);
rc = PAM_CONV_ERR;
break;
@@ -123,12 +123,15 @@ pamConvFunc(int num_msg,
case PAM_PROMPT_ECHO_ON:
- if (!((strcmp(compare_message, "login:" ) == 0)
- || (strcmp(compare_message, "please enter username:") == 0))) {
+ if (!(
+ (strcmp(compare_message, "login:" ) == 0)
+ || (strcmp(compare_message, "please enter username:") == 0)
+ || (strcmp(compare_message, "username:") == 0)
+ )) {
/* We don't recognise the prompt as asking for a username,
so can't handle it. Add more above as required for
different pam modules/implementations */
- dropbear_log(LOG_NOTICE, "PAM unknown prompt %s (with echo)",
+ dropbear_log(LOG_NOTICE, "PAM unknown prompt '%s' (with echo)",
compare_message);
rc = PAM_CONV_ERR;
break;
@@ -212,7 +215,10 @@ void svr_auth_pam() {
goto cleanup;
}
+#ifdef HAVE_PAM_FAIL_DELAY
+ /* We have our own random delay code already, disable PAM's */
(void) pam_fail_delay(pamHandlep, 0 /* musec_delay */);
+#endif
/* (void) pam_set_item(pamHandlep, PAM_FAIL_DELAY, (void*) pamDelayFunc); */