]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm direcor add: Fix checking number as hostname.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 17 Jan 2017 18:34:51 +0000 (20:34 +0200)
committerGitLab <gitlab@git.dovecot.net>
Tue, 17 Jan 2017 19:03:01 +0000 (21:03 +0200)
521c0460fe705f32ea6899c8b1f101043fe0898c was completely broken.

src/doveadm/doveadm-director.c

index 42c472759db549a2b363e7829540d6216a3b3036..ca4990c0605700f6582109f4e7abd23b1394b8df 100644 (file)
@@ -469,10 +469,10 @@ cmd_director_add_or_update(struct doveadm_cmd_context *cctx, bool update)
                director_cmd_help(cctx->cmd);
                return;
        }
-       if (str_to_uint(host, &i) == 0) {
+       if (str_to_uint(ctx->host, &i) == 0) {
                /* host is a number. this would translate to an IP address,
                   which is probably a mistake. */
-               i_error("Invalid host '%s'", host);
+               i_error("Invalid host '%s'", ctx->host);
                director_cmd_help(cctx->cmd);
                return;
        }