From: Michael Poole Date: Tue, 19 Apr 2005 00:55:32 +0000 (+0000) Subject: Avoid intepreting non-IP-based hostmasks as IP-based. X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=34879a0f6a225651fa7cecea78597148aefd6d1e;p=ircu2.10.12-pk.git Avoid intepreting non-IP-based hostmasks as IP-based. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1369 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 71254a9..f0dd632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-18 Michael Poole + + * ircd/match.c (check_if_ipmask): Do not interpret masks that + start with . or / as IP-based host masks. + 2005-04-17 Michael Poole * ircd/channel.c (mode_process_clients): Only prohibit deops of diff --git a/ircd/match.c b/ircd/match.c index 62b60ac..f2074f6 100644 --- a/ircd/match.c +++ b/ircd/match.c @@ -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 != '/') {