From: Alexander Barton Date: Sun, 17 Mar 2024 14:55:39 +0000 (+0100) Subject: METATADA: Fix unsetting "cloakhost" X-Git-Tag: rel-27-rc1~41 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git;a=commitdiff_plain;h=1118b0e77ca961a7b082f90cb124210eca8fb6bd 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). --- 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),