diff options
author | 2019-11-13 11:25:11 +0000 | |
---|---|---|
committer | 2019-11-13 11:25:11 +0000 | |
commit | a794df6a2884cc7437aca1ef808f4f547d8da9de (patch) | |
tree | b8d35ca51a0223c7e8d01992652a77c0906744c7 | |
parent | Send uhid(4) reports via the optional interrupt out pipe. Some (diff) | |
download | wireguard-openbsd-a794df6a2884cc7437aca1ef808f4f547d8da9de.tar.xz wireguard-openbsd-a794df6a2884cc7437aca1ef808f4f547d8da9de.zip |
When clients get denied by MaxStartups, send a noification prior to
the SSH2 protocol banner according to RFC4253 section 4.2. ok djm@
deraadt@ markus@
-rw-r--r-- | usr.bin/ssh/sshd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 0414679f230..a71eb4ea8ff 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.539 2019/10/31 21:23:19 djm Exp $ */ +/* $OpenBSD: sshd.c,v 1.540 2019/11/13 11:25:11 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1098,6 +1098,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) if (drop_connection(startups) == 1) { char *laddr = get_local_ipaddr(*newsock); char *raddr = get_peer_ipaddr(*newsock); + char msg[] = "Exceeded MaxStartups\r\n"; verbose("drop connection #%d from [%s]:%d " "on [%s]:%d past MaxStartups", startups, @@ -1105,6 +1106,8 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) laddr, get_local_port(*newsock)); free(laddr); free(raddr); + /* best-effort notification to client */ + (void)write(*newsock, msg, strlen(msg)); close(*newsock); continue; } |