Mercurial > dovecot > core-2.2
diff src/director/doveadm-connection.c @ 22656:1789bf2a1e01
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.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sun, 05 Nov 2017 23:51:56 +0200 |
parents | 09523ad05bef |
children | 34765a426c56 |
line wrap: on
line diff
--- a/src/director/doveadm-connection.c Sun Nov 05 23:27:36 2017 +0200 +++ b/src/director/doveadm-connection.c Sun Nov 05 23:51:56 2017 +0200 @@ -592,7 +592,8 @@ 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; }