From: Michael Poole Date: Tue, 13 Sep 2005 12:06:30 +0000 (+0000) Subject: Fix bug in last commit to find_ban(). X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=23e173891aafc7778efbc6bef585fa1a536bf8f2 Fix bug in last commit to find_ban(). git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1484 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 72f90da..d63a47d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-09-13 Michael Poole + + * 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 * ircd/ircd.c (try_connections): modify autoreconnect logic to diff --git a/ircd/channel.c b/ircd/channel.c index e1ea3ba..d14e04f 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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; }