diff options
| author | viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-03 20:11:12 +0000 |
|---|---|---|
| committer | viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-03 20:11:12 +0000 |
| commit | 790dc8a4bf326a7598fc41aa8c018e867edee33a (patch) | |
| tree | 281aa0f14877734a92336a21355eb945a8d1517e /src/chanserv.c | |
| parent | 482a8aa766c9e1a96ff63b44ed319fe51588c35c (diff) | |
BUILD : 1.7.21 (1426) BUGS : 876 NOTES : We now support CIDR in channel ban/invite/except lists. Introduces new CIDR capable generic lists system.
git-svn-id: svn://svn.anope.org/anope/trunk@1426 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1141 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/chanserv.c')
| -rw-r--r-- | src/chanserv.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/chanserv.c b/src/chanserv.c index 68197a230..8dd72130c 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -2570,29 +2570,30 @@ AutoKick *is_stuck(ChannelInfo * ci, char *mask) void stick_mask(ChannelInfo * ci, AutoKick * akick) { - int i; char *av[2]; + Entry *ban; if (!ci) { return; } - for (i = 0; i < ci->c->bancount; i++) { - /* If akick is already covered by a wider ban. - Example: c->bans[i] = *!*@*.org and akick->u.mask = *!*@*.epona.org */ - if (match_wild_nocase(ci->c->bans[i], akick->u.mask)) - return; - - if (ircd->reversekickcheck) { - /* If akick is wider than a ban already in place. - Example: c->bans[i] = *!*@irc.epona.org and akick->u.mask = *!*@*.epona.org */ - if (match_wild_nocase(akick->u.mask, ci->c->bans[i])) + if (ci->c->bans && ci->c->bans->entries != 0) { + for (ban = ci->c->bans->entries; ban; ban = ban->next) { + /* If akick is already covered by a wider ban. + Example: c->bans[i] = *!*@*.org and akick->u.mask = *!*@*.epona.org */ + if (entry_match_mask(ban, sstrdup(akick->u.mask), 0)) return; + + if (ircd->reversekickcheck) { + /* If akick is wider than a ban already in place. + Example: c->bans[i] = *!*@irc.epona.org and akick->u.mask = *!*@*.epona.org */ + if (match_wild_nocase(akick->u.mask, ban->mask)) + return; + } } } /* Falling there means set the ban */ - av[0] = sstrdup("+b"); av[1] = akick->u.mask; anope_cmd_mode(whosends(ci), ci->c->name, "+b %s", akick->u.mask); |
