From 89e6c2c06fef01ac2f22a14169ff40320761d567 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 12 Jul 2024 08:50:50 +0200 Subject: [PATCH] listen::port did not error on comma's. Reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6419 Related feature request to allow it - or some other style: https://bugs.unrealircd.org/view.php?id=6281 --- src/conf.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/conf.c b/src/conf.c index 88f76baa4..1ddec798e 100644 --- a/src/conf.c +++ b/src/conf.c @@ -5737,6 +5737,13 @@ int _test_listen(ConfigFile *conf, ConfigEntry *ce) has_port = 1; + if (strchr(cep->value, ',')) + { + config_error("%s:%i: listen::port does not support comma's", + cep->file->filename, cep->line_number); + errors++; + continue; + } port_range(cep->value, &start, &end); if (start == end) { @@ -5744,7 +5751,8 @@ int _test_listen(ConfigFile *conf, ConfigEntry *ce) { config_error("%s:%i: listen: illegal port (must be 1..65535)", cep->file->filename, cep->line_number); - return 1; + errors++; + continue; } } else @@ -5753,7 +5761,8 @@ int _test_listen(ConfigFile *conf, ConfigEntry *ce) { config_error("%s:%i: listen: illegal port range end value is less than starting value", cep->file->filename, cep->line_number); - return 1; + errors++; + continue; } if (end - start >= 100) { @@ -5761,13 +5770,15 @@ int _test_listen(ConfigFile *conf, ConfigEntry *ce) "(and thus consumes %d sockets) this is probably not what you want.", cep->file->filename, cep->line_number, start, end, end - start + 1, end - start + 1); - return 1; + errors++; + continue; } if ((start < 1) || (start > 65535) || (end < 1) || (end > 65535)) { config_error("%s:%i: listen: illegal port range values must be between 1 and 65535", cep->file->filename, cep->line_number); - return 1; + errors++; + continue; } }