[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Wed Feb 3 02:58:35 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-02-03 08:58:34 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     doc/Changes1.6 src/match.c src/patch.h

Log message:

Don't assume cidr notation for hostmasks with slashes, unless the string portion after the slash consists only of digits.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.60 eggdrop1.6/doc/Changes1.6:1.61
--- eggdrop1.6/doc/Changes1.6:1.60	Tue Jan 26 03:39:59 2010
+++ eggdrop1.6/doc/Changes1.6	Wed Feb  3 02:58:24 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.60 2010/01/26 09:39:59 pseudo Exp $
+$Id: Changes1.6,v 1.61 2010/02/03 08:58:24 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,10 @@
 
 1.6.20 (CVS):
 
+  - Don't assume cidr notation for hostmasks with slashes, unless the string
+    portion after the slash consists only of digits.
+    Found by: simple / Patch by: pseudo
+
   - Fixed the STRIP_ALL flag used with strip_mirc_codes() to actually work.
     Found by: T3256 / Patch by: pseudo
 
Index: eggdrop1.6/src/match.c
diff -u eggdrop1.6/src/match.c:1.14 eggdrop1.6/src/match.c:1.15
--- eggdrop1.6/src/match.c:1.14	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/src/match.c	Wed Feb  3 02:58:24 2010
@@ -4,7 +4,7 @@
  *   hostmask matching
  *   cidr matching
  *
- * $Id: match.c,v 1.14 2010/01/07 13:48:31 pseudo Exp $
+ * $Id: match.c,v 1.15 2010/02/03 08:58:24 pseudo Exp $
  *
  * Once this code was working, I added support for % so that I could
  * use the same code both in Eggdrop and in my IrcII client.
@@ -260,11 +260,11 @@
 
   /* check for CIDR notation and perform
      generic string matching if not found */
-  if (!(p = strrchr(r, '/')))
+  if (!(p = strrchr(r, '/')) || !str_isdigit(p + 1))
     return wild_match(r, s) ? 1 : NOMATCH;
   /* if the two strings are both cidr masks,
      use the broader prefix */
-  if (cmp && (q = strrchr(s, '/'))) {
+  if (cmp && (q = strrchr(s, '/')) && str_isdigit(q + 1)) {
     if (atoi(p + 1) > atoi(q + 1))
       return NOMATCH;
     *q = 0;
@@ -305,7 +305,7 @@
     return 1;
   p = strrchr(r, '/');
   q = strrchr(s, '/');
-  if (!p && !q)
+  if ((!p || !str_isdigit(p + 1)) && (!q || !str_isdigit(q + 1)))
     return (wild_match(r, s) || wild_match(s, r));
 
   if (p) {
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1231 eggdrop1.6/src/patch.h:1.1232
--- eggdrop1.6/src/patch.h:1.1231	Mon Jan 25 21:12:15 2010
+++ eggdrop1.6/src/patch.h	Wed Feb  3 02:58:24 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1231 2010/01/26 03:12:15 tothwolf Exp $
+ * $Id: patch.h,v 1.1232 2010/02/03 08:58:24 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1264472362");            /* current unixtime */
+patch("1265187270");            /* current unixtime */
 /*
  *
  *
  */
-patch("runtime-threads");
+patch("cidr-isdigit");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list