From: Timo Sirainen Date: Wed, 12 Jan 2022 15:40:37 +0000 (+0200) Subject: doveadm who/kick: Handle number parameter as a username rather than IP address X-Git-Tag: 2.4.0~4485 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cddfe0d77e8eb45d296caf388d270407c506a208;p=thirdparty%2Fdovecot%2Fcore.git doveadm who/kick: Handle number parameter as a username rather than IP address --- diff --git a/src/doveadm/doveadm-who.c b/src/doveadm/doveadm-who.c index fa3d2789d8..959cd7925f 100644 --- a/src/doveadm/doveadm-who.c +++ b/src/doveadm/doveadm-who.c @@ -163,7 +163,8 @@ int who_parse_args(struct who_context *ctx, const char *alt_username_field, unsigned int i, net_bits; for (i = 0; masks[i] != NULL; i++) { - if (net_parse_range(masks[i], &net_ip, &net_bits) == 0) { + if (!str_is_numeric(masks[i], '\0') && + net_parse_range(masks[i], &net_ip, &net_bits) == 0) { if (ctx->filter.net_bits != 0) { i_error("Multiple network masks not supported"); doveadm_exit_code = EX_USAGE;