Skip to content

Commit

Permalink
director: Make sure IP address parsing works in DIRECTOR-ADD/REMOVE
Browse files Browse the repository at this point in the history
We were passing the entire string through to net_addr2ip(). It seems that
inet_aton() stops at whitespace though, so this wasn't actually causing
errors at least on Linux.
  • Loading branch information
sirainen committed Oct 25, 2016
1 parent 30a1cb8 commit b7d3b04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/director/doveadm-connection.c
Expand Up @@ -203,7 +203,7 @@ doveadm_cmd_director_add(struct doveadm_connection *conn, const char *line)

args = t_strsplit_tab(line);
if (args[0] == NULL ||
net_addr2ip(line, &ip) < 0 ||
net_addr2ip(args[0], &ip) < 0 ||
(args[1] != NULL && net_str2port(args[1], &port) < 0)) {
i_error("doveadm sent invalid DIRECTOR-ADD parameters");
return -1;
Expand All @@ -227,7 +227,7 @@ doveadm_cmd_director_remove(struct doveadm_connection *conn, const char *line)

args = t_strsplit_tab(line);
if (args[0] == NULL ||
net_addr2ip(line, &ip) < 0 ||
net_addr2ip(args[0], &ip) < 0 ||
(args[1] != NULL && net_str2port(args[1], &port) < 0)) {
i_error("doveadm sent invalid DIRECTOR-REMOVE parameters");
return -1;
Expand Down

0 comments on commit b7d3b04

Please sign in to comment.