From 6cdf5bb48deb785c55f061b94eeb243965221b60 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 8 Jan 2021 09:32:24 +0100 Subject: [PATCH] openssh: honour MAX_LISTEN_SOCKS; closes #4403 --- src/etc/inc/plugins.inc.d/openssh.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/openssh.inc b/src/etc/inc/plugins.inc.d/openssh.inc index 78e58bc75..3dfbac28c 100644 --- a/src/etc/inc/plugins.inc.d/openssh.inc +++ b/src/etc/inc/plugins.inc.d/openssh.inc @@ -3,7 +3,7 @@ /* * Copyright (C) 2004 Scott Ullrich * Copyright (C) 2004 Fred Mol - * Copyright (C) 2015-2018 Franco Fichtner + * Copyright (C) 2015-2021 Franco Fichtner * 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) {