From: Timo Sirainen Date: Sun, 5 Nov 2017 21:51:56 +0000 (+0200) Subject: director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0 X-Git-Tag: 2.3.0.rc1~555 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88734aa9496db13e7ce0cd5f1c03b3ddfe3effd6;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/director/doveadm-connection.c b/src/director/doveadm-connection.c index 9f5ddb7266..4957fc2297 100644 --- a/src/director/doveadm-connection.c +++ b/src/director/doveadm-connection.c @@ -590,7 +590,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; }