]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm who/kick: Handle number parameter as a username rather than IP address
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 12 Jan 2022 15:40:37 +0000 (17:40 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 8 Feb 2022 09:48:24 +0000 (10:48 +0100)
src/doveadm/doveadm-who.c

index fa3d2789d8a9fe0285bc229a820601746e8cf8b7..959cd7925f8f0541847f88d7d501fb9087b7afef 100644 (file)
@@ -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;