0020-METADATA-Fix-unsetting-cloakhost.patch 1.1 KB

12345678910111213141516171819202122232425262728
  1. From fe5f1666983f2ef7499b0454fc30ae36edc29f5e Mon Sep 17 00:00:00 2001
  2. From: Alexander Barton <alex@barton.de>
  3. Date: Sun, 17 Mar 2024 15:55:39 +0100
  4. Subject: [PATCH 20/20] METADATA: Fix unsetting "cloakhost"
  5. Correctly re-generate the "cloaked hostname" when removing the
  6. "cloakhost" using an empty string by passing down NULL instead of the
  7. empty string, which results in protocol violations (for example on
  8. WHOIS).
  9. (cherry picked from commit 1118b0e77ca961a7b082f90cb124210eca8fb6bd)
  10. ---
  11. src/ngircd/irc-metadata.c | 4 +++-
  12. 1 file changed, 3 insertions(+), 1 deletion(-)
  13. --- a/src/ngircd/irc-metadata.c
  14. +++ b/src/ngircd/irc-metadata.c
  15. @@ -72,7 +72,9 @@
  16. }
  17. if (strcasecmp(Req->argv[1], "cloakhost") == 0) {
  18. - Client_UpdateCloakedHostname(target, prefix, Req->argv[2]);
  19. + /* Set or remove a "cloaked hostname". */
  20. + Client_UpdateCloakedHostname(target, prefix,
  21. + *Req->argv[2] ? Req->argv[2] : NULL);
  22. if (Client_Conn(target) > NONE && Client_HasMode(target, 'x'))
  23. IRC_WriteStrClientPrefix(target, prefix,
  24. RPL_HOSTHIDDEN_MSG, Client_ID(target),