summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2024-03-17 15:55:39 +0100
committerAlexander Barton <alex@barton.de>2024-03-17 22:42:19 +0100
commit1118b0e77ca961a7b082f90cb124210eca8fb6bd (patch)
tree618e6e70b8ffafabcff0c60db811aa5808731c60
parent5fd195a2cd785a735b7d873ab83579879c4f1028 (diff)
downloadngircd-1118b0e77ca961a7b082f90cb124210eca8fb6bd.tar.gz
ngircd-1118b0e77ca961a7b082f90cb124210eca8fb6bd.zip
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).
-rw-r--r--src/ngircd/irc-metadata.c4
1 files changed, 3 insertions, 1 deletions
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),