uint32_t ip4;
pos = irc_pton_ip4(input, bits, &ip4);
if (pos) {
+/* glibc's htons() macro is not -Wshadow-safe. */
+#undef htons
addr->in6[5] = htons(65535);
addr->in6[6] = htons(ntohl(ip4) >> 16);
addr->in6[7] = htons(ntohl(ip4) & 65535);
return NULL;
}
+char *
+ircstrlower(char *str) {
+ size_t ii;
+ for (ii = 0; str[ii] != '\0'; ++ii)
+ str[ii] = tolower(str[ii]);
+ return str;
+}
+
int
split_line(char *line, int irc_colon, int argv_size, char *argv[])
{
int
user_matches_glob(struct userNode *user, const char *orig_glob, int flags)
{
+ irc_in_addr_t mask;
char *glob, *marker;
+ unsigned char mask_bits;
/* Make a writable copy of the glob */
glob = alloca(strlen(orig_glob)+1);
return 0;
}
*marker = 0;
- if (!match_ircglob(user->ident, glob))
+ if (((IsFakeIdent(user) && IsHiddenHost(user) && (flags & MATCH_VISIBLE)) || !match_ircglob(user->ident, glob)) &&
+ !(IsFakeIdent(user) && match_ircglob(user->fakeident, glob)))
return 0;
glob = marker + 1;
/* Check for a fakehost match. */
&& (IsFakeHost(user) || (hidden_host_suffix && user->handle_info)))
return 0;
/* If it might be an IP glob, test that. */
- if (!glob[strspn(glob, "0123456789./*?")]
- && match_ircglob(irc_ntoa(&user->ip), glob))
+ if (irc_pton(&mask, &mask_bits, glob)
+ && irc_check_mask(&user->ip, &mask, mask_bits))
return 1;
/* None of the above; could only be a hostname match. */
return match_ircglob(user->hostname, glob);
}
char *
-intervalString(char *output, time_t interval, struct handle_info *hi)
+intervalString(char *output, unsigned long interval, struct handle_info *hi)
{
static const struct {
const char *msg_single;
const char *msg_plural;
- long length;
+ unsigned long length;
} unit[] = {
{ "MSG_YEAR", "MSG_YEARS", 365 * 24 * 60 * 60 },
{ "MSG_WEEK", "MSG_WEEKS", 7 * 24 * 60 * 60 },