summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-21 22:39:57 +0000
committerDamien Miller <djm@mindrot.org>2020-01-22 09:41:47 +1100
commit70d38c3cfd4550e8ee66cc3bf1b91aa339c91df5 (patch)
tree1f58cb4a0122654955d8a5533167ca0b52e82293
parenta78c66d5d2144bd49779bc80a647346bd3d7233d (diff)
upstream: expose the number of currently-authenticating connections
along with the MaxStartups limit in the proctitle; suggestion from Philipp Marek, w/ feedback from Craig Miskell ok dtucker@ OpenBSD-Commit-ID: a4a6db2dc1641a5df8eddf7d6652176e359dffb3
-rw-r--r--sshd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index 0cf13a741..46f693a8e 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.542 2019/12/15 18:57:30 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.543 2020/01/21 22:39:57 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1059,7 +1059,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
1059{ 1059{
1060 fd_set *fdset; 1060 fd_set *fdset;
1061 int i, j, ret, maxfd; 1061 int i, j, ret, maxfd;
1062 int startups = 0, listening = 0, lameduck = 0; 1062 int ostartups = -1, startups = 0, listening = 0, lameduck = 0;
1063 int startup_p[2] = { -1 , -1 }; 1063 int startup_p[2] = { -1 , -1 };
1064 char c = 0; 1064 char c = 0;
1065 struct sockaddr_storage from; 1065 struct sockaddr_storage from;
@@ -1084,6 +1084,12 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
1084 * the daemon is killed with a signal. 1084 * the daemon is killed with a signal.
1085 */ 1085 */
1086 for (;;) { 1086 for (;;) {
1087 if (ostartups != startups) {
1088 setproctitle("[listener] %d of %d-%d startups",
1089 startups, options.max_startups_begin,
1090 options.max_startups);
1091 ostartups = startups;
1092 }
1087 if (received_sighup) { 1093 if (received_sighup) {
1088 if (!lameduck) { 1094 if (!lameduck) {
1089 debug("Received SIGHUP; waiting for children"); 1095 debug("Received SIGHUP; waiting for children");