]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-who: Do not parse numbers as IP addresses
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 14 Mar 2022 08:18:58 +0000 (10:18 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 14 Mar 2022 15:10:23 +0000 (15:10 +0000)
Fixes doveadm kick as well.

Broken in 381daab1e3b56a0bc94d2191cf62beba0df51af9

src/doveadm/doveadm-who.c

index ca4e1241e7ab69eb8dadc27cfd15bedf89540e99..b60e515f2e9ea033aea47a9f0c104db7d5d80da5 100644 (file)
@@ -152,7 +152,8 @@ int who_parse_args(struct who_context *ctx, const char *const *masks)
        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;