From 99bc061a741224cf667cc558f455b627c71cd6f9 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 30 Aug 2024 19:59:56 +0200 Subject: [PATCH] Fix require authentication { } not allowing SASL users in. It was behaving like a ban user { } block. Reported by Jellis in https://bugs.unrealircd.org/view.php?id=6464 --- src/modules/tkl.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/tkl.c b/src/modules/tkl.c index ae5618220..351de7347 100644 --- a/src/modules/tkl.c +++ b/src/modules/tkl.c @@ -3422,13 +3422,18 @@ int find_tkline_match_matcher(Client *client, int skip_soft, TKL *tkl) /* For config file ban { } we use security groups instead of simple user/host */ if (tkl->ptr.serverban->match) { - if (user_allowed_by_security_group(client, tkl->ptr.serverban->match)) + /* If hard-ban, or soft-ban&unauthenticated.. */ + if (!(tkl->ptr.serverban->subtype & TKL_SUBTYPE_SOFT) || + ((tkl->ptr.serverban->subtype & TKL_SUBTYPE_SOFT) && !IsLoggedIn(client))) { - if (find_tkl_exception(tkl->type, client)) - return 0; /* exempted */ - return 1; /* banned */ + if (user_allowed_by_security_group(client, tkl->ptr.serverban->match)) + { + if (find_tkl_exception(tkl->type, client)) + return 0; /* exempted */ + return 1; /* banned */ + } + return 0; } - return 0; } tkl_uhost(tkl, uhost, sizeof(uhost), NO_SOFT_PREFIX);