diff options
Diffstat (limited to 'auth-options.c')
-rw-r--r-- | auth-options.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/auth-options.c b/auth-options.c index 0e67bd8c0..146b3d174 100644 --- a/auth-options.c +++ b/auth-options.c | |||
@@ -58,9 +58,20 @@ int forced_tun_device = -1; | |||
58 | /* "principals=" option. */ | 58 | /* "principals=" option. */ |
59 | char *authorized_principals = NULL; | 59 | char *authorized_principals = NULL; |
60 | 60 | ||
61 | /* Throttle log messages. */ | ||
62 | int logged_from_hostip = 0; | ||
63 | int logged_cert_hostip = 0; | ||
64 | |||
61 | extern ServerOptions options; | 65 | extern ServerOptions options; |
62 | 66 | ||
63 | void | 67 | void |
68 | auth_start_parse_options(void) | ||
69 | { | ||
70 | logged_from_hostip = 0; | ||
71 | logged_cert_hostip = 0; | ||
72 | } | ||
73 | |||
74 | void | ||
64 | auth_clear_options(void) | 75 | auth_clear_options(void) |
65 | { | 76 | { |
66 | no_agent_forwarding_flag = 0; | 77 | no_agent_forwarding_flag = 0; |
@@ -288,10 +299,13 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) | |||
288 | /* FALLTHROUGH */ | 299 | /* FALLTHROUGH */ |
289 | case 0: | 300 | case 0: |
290 | xfree(patterns); | 301 | xfree(patterns); |
291 | logit("Authentication tried for %.100s with " | 302 | if (!logged_from_hostip) { |
292 | "correct key but not from a permitted " | 303 | logit("Authentication tried for %.100s with " |
293 | "host (host=%.200s, ip=%.200s).", | 304 | "correct key but not from a permitted " |
294 | pw->pw_name, remote_host, remote_ip); | 305 | "host (host=%.200s, ip=%.200s).", |
306 | pw->pw_name, remote_host, remote_ip); | ||
307 | logged_from_hostip = 1; | ||
308 | } | ||
295 | auth_debug_add("Your host '%.200s' is not " | 309 | auth_debug_add("Your host '%.200s' is not " |
296 | "permitted to use this key for login.", | 310 | "permitted to use this key for login.", |
297 | remote_host); | 311 | remote_host); |
@@ -512,11 +526,14 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw, | |||
512 | break; | 526 | break; |
513 | case 0: | 527 | case 0: |
514 | /* no match */ | 528 | /* no match */ |
515 | logit("Authentication tried for %.100s " | 529 | if (!logged_cert_hostip) { |
516 | "with valid certificate but not " | 530 | logit("Authentication tried for %.100s " |
517 | "from a permitted host " | 531 | "with valid certificate but not " |
518 | "(ip=%.200s).", pw->pw_name, | 532 | "from a permitted host " |
519 | remote_ip); | 533 | "(ip=%.200s).", pw->pw_name, |
534 | remote_ip); | ||
535 | logged_cert_hostip = 1; | ||
536 | } | ||
520 | auth_debug_add("Your address '%.200s' " | 537 | auth_debug_add("Your address '%.200s' " |
521 | "is not permitted to use this " | 538 | "is not permitted to use this " |
522 | "certificate for login.", | 539 | "certificate for login.", |