- /* 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 (IsSetHost(user) && match_ircglob(sethostname, 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;
+ if (IsSetHost(user) && match_ircglob(sethostname, 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))