components/openssh/patches/048-maxstartups-log_dropped.patch
author Tomas Kuthan <tomas.kuthan@oracle.com>
Thu, 06 Oct 2016 07:26:21 -0700
changeset 7060 6881211a7ba8
permissions -rw-r--r--
24301902 Log connections dropped when exceeding MaxStartups
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7060
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     1
#
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     2
# When MaxStartups of unauthenticated concurrent connections is hit,
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     3
# additional connections are dropped.
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     4
#
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     5
# Dropped connections should be logged. Server administrator should be able to
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     6
# find this information and might be interested in details. 
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     7
#
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     8
# Patch source: in-house
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     9
# Offered upstream:
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    10
# https://bugzilla.mindrot.org/show_bug.cgi?id=2613
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    11
#
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    12
diff -pur old/sshd.c new/sshd.c
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    13
--- old/sshd.c
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    14
+++ new/sshd.c
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    15
@@ -1419,7 +1419,8 @@ server_accept_loop(int *sock_in, int *so
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    16
 				continue;
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    17
 			}
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    18
 			if (drop_connection(startups) == 1) {
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    19
-				debug("drop connection #%d", startups);
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    20
+				logit("MaxStartups: dropping connection #%d",
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    21
+				    startups);
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    22
 				close(*newsock);
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    23
 				continue;
6881211a7ba8 24301902 Log connections dropped when exceeding MaxStartups
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    24
 			}