openssh: honour MAX_LISTEN_SOCKS; closes #4403

This commit is contained in:
Franco Fichtner 2021-01-08 09:32:24 +01:00
parent ccb32474bf
commit 6cdf5bb48d

View File

@ -3,7 +3,7 @@
/*
* Copyright (C) 2004 Scott Ullrich <sullrich@gmail.com>
* Copyright (C) 2004 Fred Mol <fredmol@xs4all.nl>
* Copyright (C) 2015-2018 Franco Fichtner <franco@opnsense.org>
* Copyright (C) 2015-2021 Franco Fichtner <franco@opnsense.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -201,7 +201,11 @@ function openssh_configure_do($verbose = false, $interface = '')
continue;
}
$listeners[] = $tmpaddr;
if (count($listeners) < 16) {
$listeners[] = $tmpaddr;
} else {
log_error("The SSH listening address $tmpaddr cannot be added due to MAX_LISTEN_SOCKS limit reached.");
}
}
foreach ($listeners as $listener) {