Skip to content

Commit

Permalink
METATADA: Fix unsetting "cloakhost"
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
alexbarton committed Mar 17, 2024
1 parent 5fd195a commit 1118b0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ngircd/irc-metadata.c
Expand Up @@ -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),
Expand Down

0 comments on commit 1118b0e

Please sign in to comment.