Fix bug in last commit to find_ban().
authorMichael Poole <mdpoole@troilus.org>
Tue, 13 Sep 2005 12:06:30 +0000 (12:06 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 13 Sep 2005 12:06:30 +0000 (12:06 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1484 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 72f90dad4507c60996b51b3ca675b8dc2899bddb..d63a47d184018b27403435f9064821d0c800a687 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-13  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/channel.c (find_ban): Revert to older style of comparison,
+       fixing the sense of one check.  Spotted by Alex Badea.
+
 2005-09-13  Alex Badea <vamposdecampos@gmail.com>
 
        * ircd/ircd.c (try_connections): modify autoreconnect logic to
index e1ea3bada13b16d934942606ad7756522a879740..d14e04f697aefbd9afead8553dec8e1251b4c22a 100644 (file)
@@ -380,16 +380,16 @@ struct Ban *find_ban(struct Client *cptr, struct Ban *banlist)
       continue;
     /* Compare host portion of ban. */
     hostmask = banlist->banstr + banlist->nu_len + 1;
-    if (((banlist->flags & BAN_IPMASK)
+    if (!((banlist->flags & BAN_IPMASK)
          && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits))
-        || match(hostmask, cli_user(cptr)->host)
-        || (sr && match(hostmask, sr) == 0)) {
-      /* If an exception matches, no ban can match. */
-      if (banlist->flags & BAN_EXCEPTION)
-        return NULL;
-      /* Otherwise, remember this ban but keep searching for an exception. */
-      found = banlist;
-    }
+        && match(hostmask, cli_user(cptr)->host)
+        && !(sr && match(hostmask, sr)))
+        continue;
+    /* If an exception matches, no ban can match. */
+    if (banlist->flags & BAN_EXCEPTION)
+      return NULL;
+    /* Otherwise, remember this ban but keep searching for an exception. */
+    found = banlist;
   }
   return found;
 }