# arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
#
+2004-10-16 21:14:11 GMT Michael Poole <mdpoole@troilus.org> patch-82
+
+ Summary:
+ Fix glob matching against IPs
+ Revision:
+ srvx--devo--1.3--patch-82
+
+ Do not require the first character in an IP glob to be a digit. If an
+ IP-looking glob does not match, fall through to the other host matching
+ rules, in case the IP-looking glob really matches their hostname.
+
+ modified files:
+ ChangeLog src/tools.c
+
+
2004-09-15 04:14:14 GMT adam <adam@gamesurge.net> patch-81
Summary:
if (!match_ircglob(user->ident, glob))
return 0;
glob = marker + 1;
- /* Now check the host part */
- if (isdigit(*glob) && !glob[strspn(glob, "0123456789./*?")]) {
- /* Looks like an IP-based mask */
- return match_ircglob(inet_ntoa(user->ip), glob);
- } else {
- /* The host part of the mask isn't IP-based */
- if (IsFakeHost(user) && match_ircglob(user->fakehost, glob))
+ /* If it might be an IP glob, test that. */
+ if (!glob[strspn(glob, "0123456789./*?")]
+ && match_ircglob(inet_ntoa(user->ip), glob))
+ return 1;
+ /* Check for a fakehost match. */
+ if (IsFakeHost(user) && match_ircglob(user->fakehost, glob))
+ return 1;
+ /* Check for an account match. */
+ if (hidden_host_suffix && user->handle_info) {
+ char hidden_host[HOSTLEN+1];
+ snprintf(hidden_host, sizeof(hidden_host), "%s.%s", user->handle_info->handle, hidden_host_suffix);
+ if (match_ircglob(hidden_host, glob))
return 1;
- if (hidden_host_suffix && user->handle_info) {
- char hidden_host[HOSTLEN+1];
- snprintf(hidden_host, sizeof(hidden_host), "%s.%s", user->handle_info->handle, hidden_host_suffix);
- if (match_ircglob(hidden_host, glob))
- return 1;
- }
- return match_ircglob(user->hostname, glob);
}
+ /* None of the above; could only be a hostname match. */
+ return match_ircglob(user->hostname, glob);
}
int