From 1118b0e77ca961a7b082f90cb124210eca8fb6bd Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 17 Mar 2024 15:55:39 +0100 Subject: [PATCH] METATADA: Fix unsetting "cloakhost" Correctly re-generate the "cloaked hostname" when removing the "cloakhost" using an empty string by passing down NULL instead of the empty string, which results in protocol violations (for example on WHOIS). --- src/ngircd/irc-metadata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ngircd/irc-metadata.c b/src/ngircd/irc-metadata.c index 2a3de1b4..00205f16 100644 --- a/src/ngircd/irc-metadata.c +++ b/src/ngircd/irc-metadata.c @@ -72,7 +72,9 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req) } if (strcasecmp(Req->argv[1], "cloakhost") == 0) { - Client_UpdateCloakedHostname(target, prefix, Req->argv[2]); + /* Set or remove a "cloaked hostname". */ + Client_UpdateCloakedHostname(target, prefix, + *Req->argv[2] ? Req->argv[2] : NULL); if (Client_Conn(target) > NONE && Client_HasMode(target, 'x')) IRC_WriteStrClientPrefix(target, prefix, RPL_HOSTHIDDEN_MSG, Client_ID(target), -- 2.39.2