View | Details | Raw Unified | Return to bug 2199
Collapse All | Expand All

(-)auth.c (+13 lines)
Lines 236-241 auth_log(Authctxt *authctxt, int authenticated, int partial, Link Here
236
	authctxt->info = NULL;
236
	authctxt->info = NULL;
237
}
237
}
238
238
239
void
240
auth_maxtries_exceeded(Authctxt *authctxt)
241
{
242
	packet_disconnect("Too many authentication failures for "
243
	    "%s%.100s from %.200s port %d %s",
244
	    authctxt->valid ? "" : "invalid user ",
245
	    authctxt->user,
246
	    get_remote_ipaddr(),
247
	    get_remote_port(),
248
	    compat20 ? "ssh2" : "ssh1");
249
	/* NOTREACHED */
250
}
251
239
/*
252
/*
240
 * Check whether root logins are disallowed.
253
 * Check whether root logins are disallowed.
241
 */
254
 */
(-)auth.h (-2 / +1 lines)
Lines 133-138 void auth_info(Authctxt *authctxt, const char *, ...) Link Here
133
	    __attribute__((__format__ (printf, 2, 3)))
133
	    __attribute__((__format__ (printf, 2, 3)))
134
	    __attribute__((__nonnull__ (2)));
134
	    __attribute__((__nonnull__ (2)));
135
void	auth_log(Authctxt *, int, int, const char *, const char *);
135
void	auth_log(Authctxt *, int, int, const char *, const char *);
136
void	auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn));
136
void	userauth_finish(Authctxt *, int, const char *, const char *);
137
void	userauth_finish(Authctxt *, int, const char *, const char *);
137
int	auth_root_allowed(const char *);
138
int	auth_root_allowed(const char *);
138
139
Lines 184-189 void auth_debug_reset(void); Link Here
184
185
185
struct passwd *fakepw(void);
186
struct passwd *fakepw(void);
186
187
187
#define AUTH_FAIL_MSG "Too many authentication failures for %.100s"
188
189
#endif
188
#endif
(-)auth1.c (-1 / +1 lines)
Lines 297-303 do_authloop(Authctxt *authctxt) Link Here
297
			return;
297
			return;
298
298
299
		if (++authctxt->failures >= options.max_authtries)
299
		if (++authctxt->failures >= options.max_authtries)
300
			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
300
			auth_maxtries_exceeded(authctxt);
301
301
302
		packet_start(SSH_SMSG_FAILURE);
302
		packet_start(SSH_SMSG_FAILURE);
303
		packet_send();
303
		packet_send();
(-)auth2.c (-1 / +1 lines)
Lines 312-318 userauth_finish(Authctxt *authctxt, int authenticated, const char *method, Link Here
312
		    (authctxt->attempt > 1 || strcmp(method, "none") != 0))
312
		    (authctxt->attempt > 1 || strcmp(method, "none") != 0))
313
			authctxt->failures++;
313
			authctxt->failures++;
314
		if (authctxt->failures >= options.max_authtries)
314
		if (authctxt->failures >= options.max_authtries)
315
			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
315
			auth_maxtries_exceeded(authctxt);
316
		methods = authmethods_get(authctxt);
316
		methods = authmethods_get(authctxt);
317
		debug3("%s: failure partial=%d next methods=\"%s\"", __func__,
317
		debug3("%s: failure partial=%d next methods=\"%s\"", __func__,
318
		    partial, methods);
318
		    partial, methods);

Return to bug 2199