]> jfr.im git - irc/quakenet/snircd-patchqueue.git/commitdiff
sethostnewhostmask: check if user is +rx, not just when user is +r
authorwiebe <redacted>
Fri, 2 Apr 2010 12:32:16 +0000 (14:32 +0200)
committerwiebe <redacted>
Fri, 2 Apr 2010 12:32:16 +0000 (14:32 +0200)
series
sethostnewhostmask.patch [new file with mode: 0644]

diff --git a/series b/series
index 6cf2ba4feb30390fc931627b5576501f5c796845..4f66aab7dbe562c9b01325902ae4d48d05dd51f5 100644 (file)
--- a/series
+++ b/series
@@ -1,5 +1,6 @@
 realusernamesethost.patch
 sethostoldcode.patch
+sethostnewhostmask.patch
 cprivmsgerracconly.patch
 badchanzombie.patch
 badchanlocalkick.patch
diff --git a/sethostnewhostmask.patch b/sethostnewhostmask.patch
new file mode 100644 (file)
index 0000000..10f8cbf
--- /dev/null
@@ -0,0 +1,32 @@
+Check if new spoof user@host is not already set, but only when user already has +h or is +rx (and not just +r)
+
+diff -r be4b66b8edbf ircd/m_sethost.c
+--- a/ircd/m_sethost.c
++++ b/ircd/m_sethost.c
+@@ -136,7 +136,7 @@
+       send_reply(sptr, ERR_BADHOSTMASK, hostmask);
+       return 0;
+       }
+-      if (IsSetHost(sptr) || IsAccount(sptr)) {
++      if (IsSetHost(sptr) || HasHiddenHost(sptr)) {
+         ircd_snprintf(0, curhostmask, USERLEN + HOSTLEN + 2, "%s@%s", sptr->cli_user->username, sptr->cli_user->host);
+         if (0 == strcmp(hostmask, curhostmask)) {
+           send_reply(sptr, RPL_HOSTHIDDEN, curhostmask);
+@@ -150,7 +150,7 @@
+       send_reply(sptr, ERR_BADHOSTMASK, parv[1]);
+       return 0;
+       }
+-      if (IsSetHost(sptr) || IsAccount(sptr)) {
++      if (IsSetHost(sptr) || HasHiddenHost(sptr)) {
+         if (0 == strcmp(parv[1], sptr->cli_user->host)) {
+           send_reply(sptr, RPL_HOSTHIDDEN, parv[1]);
+           return 0;
+@@ -206,7 +206,7 @@
+   setflags = cli_flags(target);
+   FlagClr(&setflags, FLAG_SETHOST);
+-  if (IsSetHost(target) || IsAccount(target)) { 
++  if (IsSetHost(target) || HasHiddenHost(target)) { 
+     if ((0 == strcmp(parv[2], target->cli_user->username)) && (0 == strcmp(parv[3], target->cli_user->host))) 
+       return 0;
+   }