Просмотр исходного кода

* Ported [2938] to 1.2.11
* Fixed CIDR masks not being checked on JOIN. (also fixes some other cases of CIDR matching) (fixes #270)


svn: 2939

Bryan Drewery 20 лет назад
Родитель
Сommit
e078e4efa0
3 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/mod/channels.mod/userchan.c
  3. 1 1
      src/mod/irc.mod/chan.c

+ 1 - 0
doc/UPDATES

@@ -11,6 +11,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed cmd_checkchannels so that results are not shown in log, but to user only. (fixes #217)
 * Disabled watcher feature.
 * Fixed problems with symlinked binaries. (fixes #240)
+* Fixed CIDR masks not being checked on JOIN. (also fixes some other cases of CIDR matching) (fixes #270)
 
 1.2.10 - http://tracker.shatow.net/milestone/1.2.10
 * Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.

+ 1 - 1
src/mod/channels.mod/userchan.c

@@ -200,7 +200,7 @@ int u_equals_mask(maskrec *u, char *mask)
 bool u_match_mask(maskrec *rec, char *mask)
 {
   for (; rec; rec = rec->next)
-    if (wild_match(rec->mask, mask))
+    if (wild_match(rec->mask, mask) || match_cidr(rec->mask, mask))
       return 1;
   return 0;
 }

+ 1 - 1
src/mod/irc.mod/chan.c

@@ -2492,7 +2492,7 @@ static int gotjoin(char *from, char *chname)
               !(use_exempts && (isexempted(chan, from) || (chan->ircnet_status & CHAN_ASKED_EXEMPTS))) && 
               me_op(chan)) {
             for (b = chan->channel.ban; b->mask[0]; b = b->next) {
-              if (wild_match(b->mask, from)) {
+              if (wild_match(b->mask, from) || match_cidr(b->mask, from)) {
                 dprintf(DP_SERVER, "KICK %s %s :%s%s\n", chname, m->nick, bankickprefix, r_banned());
                 m->flags |= SENTKICK;
                 goto exit;