]> arthur.barton.de Git - ngircd-alex.git/commitdiff
METATADA: Fix unsetting "cloakhost"
authorAlexander Barton <alex@barton.de>
Sun, 17 Mar 2024 14:55:39 +0000 (15:55 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 17 Mar 2024 21:42:19 +0000 (22:42 +0100)
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

index 2a3de1b454cbba48cb0cbe6739f5f49a3350c801..00205f16a312d83c027906458deac98c83a6a500 100644 (file)
@@ -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),