]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 7 Nov 2017 19:26:45 +0000 (21:26 +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 2b61787327ff60371fb5378cd5c3bed866a98f0c..e622691fa0dd5a4c1933c62349af3d33ae921b31 100644 (file)
@@ -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;
        }