changeset 19497:1d2999cfe0a4

director: If doveadm attempts to change tag for an existing host, return error.
author Timo Sirainen <tss@iki.fi>
date Wed, 09 Dec 2015 13:02:46 +0200
parents 13afb0912164
children d397b0ad0ac4
files src/director/doveadm-connection.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/doveadm-connection.c	Wed Dec 09 13:02:19 2015 +0200
+++ b/src/director/doveadm-connection.c	Wed Dec 09 13:02:46 2015 +0200
@@ -282,6 +282,9 @@
 			return TRUE;
 		}
 		host = mail_host_add_ip(dir->mail_hosts, &ip, tag);
+	} else if (tag[0] != '\0' && strcmp(mail_host_get_tag(host), tag) != 0) {
+		o_stream_nsend_str(conn->output, "host tag can't be changed\n");
+		return TRUE;
 	} else if (host->desynced) {
 		o_stream_nsend_str(conn->output,
 			"host is already being updated - try again later\n");