Skip to content

Commit

Permalink
doveadm direcor add: Don't accept number as a valid hostname.
Browse files Browse the repository at this point in the history
This is usually a mistake. For example "doveadm director add -t host 100"
shouldn't be adding a new IP 100 (0.0.0.100)
  • Loading branch information
sirainen authored and GitLab committed Jan 17, 2017
1 parent 3d88d8e commit 521c046
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doveadm/doveadm-director.c
Expand Up @@ -469,6 +469,13 @@ 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) {
/* host is a number. this would translate to an IP address,
which is probably a mistake. */
i_error("Invalid host '%s'", host);
director_cmd_help(cctx->cmd);
return;
}

host = ctx->host;
if (ctx->tag == NULL) {
Expand Down

0 comments on commit 521c046

Please sign in to comment.