Avoid intepreting non-IP-based hostmasks as IP-based.
authorMichael Poole <mdpoole@troilus.org>
Tue, 19 Apr 2005 00:55:32 +0000 (00:55 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 19 Apr 2005 00:55:32 +0000 (00:55 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1369 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/match.c

index 71254a93c61bd957b98a317739d31303bb5e6fbf..f0dd632e447aa7eac8a621a499108152f21f5ad7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-18  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/match.c (check_if_ipmask): Do not interpret masks that
+       start with . or / as IP-based host masks.
+
 2005-04-17  Michael Poole <mdpoole@troilus.org>
 
        * ircd/channel.c (mode_process_clients): Only prohibit deops of
index 62b60acf00d6f7b0fbffef4862fd120e0a797e97..f2074f63b7f7b9304fbdb4a329961587a45c296b 100644 (file)
@@ -875,6 +875,13 @@ int check_if_ipmask(const char *mask)
   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 != '/')
     {