Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-04-19 00:55:43 UTC
Modified files:
ChangeLog ircd/match.c
Log message:
Avoid intepreting non-IP-based hostmasks as IP-based.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.602 ircu2.10/ChangeLog:1.603
--- ircu2.10/ChangeLog:1.602 Sun Apr 17 09:59:48 2005
+++ ircu2.10/ChangeLog Mon Apr 18 17:55:31 2005
@@ -1,3 +1,8 @@
+2005-04-18 Michael Poole <[EMAIL PROTECTED]>
+
+ * ircd/match.c (check_if_ipmask): Do not interpret masks that
+ start with . or / as IP-based host masks.
+
2005-04-17 Michael Poole <[EMAIL PROTECTED]>
* ircd/channel.c (mode_process_clients): Only prohibit deops of
Index: ircu2.10/ircd/match.c
diff -u ircu2.10/ircd/match.c:1.15 ircu2.10/ircd/match.c:1.16
--- ircu2.10/ircd/match.c:1.15 Sun Mar 20 08:06:29 2005
+++ ircu2.10/ircd/match.c Mon Apr 18 17:55:32 2005
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Functions to match strings against IRC mask strings.
- * @version $Id: match.c,v 1.15 2005/03/20 16:06:29 entrope Exp $
+ * @version $Id: match.c,v 1.16 2005/04/19 00:55:32 entrope Exp $
*/
#include "config.h"
@@ -875,6 +875,13 @@
int has_digit = 0;
const char *p;
+ /* Given the bug that inspired this test, this may seem like a hasty
+ * kludge. It isn't: Wildcard characters should be matched from the
+ * start, as when the username is the "interesting" part of the ban.
+ * Likewise, we cannot simply reject masks interpreted as */0.
+ */
+ if (mask[0] == '.' || mask[0] == '/')
+ return 0;
for (p = mask; *p; ++p)
if (*p != '*' && *p != '?' && *p != '.' && *p != '/')
{
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches