From a65be8295754f957e61881c48022052aedbb738a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 5 Nov 2017 23:51:56 +0200 Subject: [PATCH] director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0 The reset command would just hang in that case. doveadm would never have sent this, so this is just an extra sanity check. --- src/director/doveadm-connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/director/doveadm-connection.c b/src/director/doveadm-connection.c index 2b61787327..e622691fa0 100644 --- a/src/director/doveadm-connection.c +++ b/src/director/doveadm-connection.c @@ -592,7 +592,8 @@ doveadm_cmd_host_reset_users(struct doveadm_connection *conn, unsigned int max_moving_users = DEFAULT_MAX_MOVING_USERS; if (args[0] != NULL && args[1] != NULL && - str_to_uint(args[1], &max_moving_users) < 0) { + (str_to_uint(args[1], &max_moving_users) < 0 || + max_moving_users == 0)) { i_error("doveadm sent invalid HOST-RESET-USERS parameters"); return DOVEADM_DIRECTOR_CMD_RET_FAIL; } -- 2.47.3