Simplifies the next commit.
if (ctx.who.filter.net_bits == 0 &&
ctx.who.filter.dest_ip.family == 0 &&
- strpbrk(ctx.who.filter.username, "*?") == NULL) {
+ !ctx.who.filter.username_wildcards) {
/* kick a single [alternative] user's all connections */
p_array_init(&ctx.kicks, ctx.who.pool, 1);
struct kick_session *session = array_append_space(&ctx.kicks);
return -1;
}
ctx->filter.username = masks[i];
+ if (strpbrk(masks[i], "*?") != NULL)
+ ctx->filter.username_wildcards = TRUE;
}
}
return 0;
struct who_filter {
const char *username;
+ bool username_wildcards;
const char *alt_username_field;
unsigned int alt_username_idx;