From ce7bb15c187dac1f21a4723bad88d412d22a6f7c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 12 Jul 2025 14:41:09 +0100 Subject: [PATCH] Use IsIdentValid for validating usernames in hs_request. --- modules/hostserv/hs_request.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/hostserv/hs_request.cpp b/modules/hostserv/hs_request.cpp index e2a4c9113..9d1a2fb80 100644 --- a/modules/hostserv/hs_request.cpp +++ b/modules/hostserv/hs_request.cpp @@ -77,11 +77,6 @@ struct HostRequestTypeImpl final class CommandHSRequest final : public Command { - static bool isvalidchar(char c) - { - return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-'; - } - public: CommandHSRequest(Module *creator) : Command(creator, "hostserv/request", 1, 1) { @@ -142,13 +137,11 @@ public: source.Reply(HOST_NO_VIDENT); return; } - for (const auto &chr : user) + + if (!IRCD->IsIdentValid(user)) { - if (!isvalidchar(chr)) - { - source.Reply(HOST_SET_IDENT_ERROR); - return; - } + source.Reply(HOST_SET_IDENT_ERROR); + return; } }