]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 5 Nov 2017 21:51:56 +0000 (23:51 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 6 Nov 2017 18:09:13 +0000 (20:09 +0200)
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

index 9f5ddb7266ddcd0d7d7f05753bea0e06386914c6..4957fc2297e2daab0ece50e56879d0d5f01a9006 100644 (file)
@@ -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;
        }