X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Ftools.c;h=983fe9fbddcd72c436e8ba04049b61b946e97854;hb=839ab9c7c30c63c0bb584da4ab6fe41f54f22ac4;hp=6883b7122851d4418388fd77ac99688020b9c916;hpb=e36a8c061fa07c9b03f5ac150c3a6738248ca5e3;p=srvx.git diff --git a/src/tools.c b/src/tools.c index 6883b71..983fe9f 100644 --- a/src/tools.c +++ b/src/tools.c @@ -313,7 +313,7 @@ irc_pton(irc_in_addr_t *addr, unsigned char *bits, const char *input) addr->in6[cpos + jj] = 0; } } else if (dot) { - unsigned int ip4; + uint32_t ip4; pos = irc_pton_ip4(input, bits, &ip4); if (pos) { addr->in6[5] = htons(65535); @@ -538,7 +538,7 @@ match_ircglob(const char *text, const char *glob) m++; /* allow escaping to force capitalization */ if (*m++ != *n++) - return 0; + goto backtrack; break; case '*': case '?': for (star_p = 0; ; m++) { @@ -614,7 +614,8 @@ user_matches_glob(struct userNode *user, const char *orig_glob, int flags) return 1; } /* If only matching the visible hostnames, bail early. */ - if ((flags & MATCH_VISIBLE) && (IsFakeHost(user) || IsHiddenHost(user))) + if ((flags & MATCH_VISIBLE) && IsHiddenHost(user) + && (IsFakeHost(user) || (hidden_host_suffix && user->handle_info))) return 0; /* If it might be an IP glob, test that. */ if (!glob[strspn(glob, "0123456789./*?")] @@ -793,12 +794,14 @@ ParseInterval(const char *interval) /* process the string, resetting the count if we find a unit character */ while ((c = *interval++)) { - if (isdigit((int)c)) { - partial = partial*10 + c - '0'; - } else { - seconds += TypeLength(c) * partial; - partial = 0; - } + if (isdigit((int)c)) { + partial = partial*10 + c - '0'; + } else if (strchr("yMwdhms", c)) { + seconds += TypeLength(c) * partial; + partial = 0; + } else { + return 0; + } } /* assume the last chunk is seconds (the normal case) */ return seconds + partial;