summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2016-07-18 09:33:25 +1000
committerDarren Tucker <dtucker@zip.com.au>2016-07-18 09:33:25 +1000
commit01558b7b07af43da774d3a11a5c51fa9c310849d (patch)
tree97052332089b01018034206d1dcd683c4177f787 /monitor.c
parent65c6c6b567ab5ab12945a5ad8e0ab3a8c26119cc (diff)
Handle PAM_MAXTRIES from modules.
bz#2249: handle the case where PAM returns PAM_MAXTRIES by ceasing to offer password and keyboard-interative authentication methods. Should prevent "sshd ignoring max retries" warnings in the log. ok djm@ It probably won't trigger with keyboard-interactive in the default configuration because the retry counter is stored in module-private storage which goes away with the sshd PAM process (see bz#688). On the other hand, those cases probably won't log a warning either.
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 8b3c27a76..fbe965e7c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -75,6 +75,7 @@
75#include "cipher.h" 75#include "cipher.h"
76#include "kex.h" 76#include "kex.h"
77#include "dh.h" 77#include "dh.h"
78#include "auth-pam.h"
78#ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */ 79#ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */
79#undef TARGET_OS_MAC 80#undef TARGET_OS_MAC
80#include "zlib.h" 81#include "zlib.h"
@@ -920,6 +921,9 @@ mm_answer_authpassword(int sock, Buffer *m)
920 921
921 buffer_clear(m); 922 buffer_clear(m);
922 buffer_put_int(m, authenticated); 923 buffer_put_int(m, authenticated);
924#ifdef USE_PAM
925 buffer_put_int(m, sshpam_get_maxtries_reached());
926#endif
923 927
924 debug3("%s: sending result %d", __func__, authenticated); 928 debug3("%s: sending result %d", __func__, authenticated);
925 mm_request_send(sock, MONITOR_ANS_AUTHPASSWORD, m); 929 mm_request_send(sock, MONITOR_ANS_AUTHPASSWORD, m);
@@ -1119,6 +1123,7 @@ mm_answer_pam_query(int sock, Buffer *m)
1119 free(name); 1123 free(name);
1120 buffer_put_cstring(m, info); 1124 buffer_put_cstring(m, info);
1121 free(info); 1125 free(info);
1126 buffer_put_int(m, sshpam_get_maxtries_reached());
1122 buffer_put_int(m, num); 1127 buffer_put_int(m, num);
1123 for (i = 0; i < num; ++i) { 1128 for (i = 0; i < num; ++i) {
1124 buffer_put_cstring(m, prompts[i]); 1129 buffer_put_cstring(m, prompts[i]);