Mercurial > dovecot > core-2.2
changeset 21521:bfc81bb63199
quota: If quota_over_flag_value is unset, skip the quota_over check.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 07 Feb 2017 15:44:20 +0200 |
parents | b1c4db787e1c |
children | 4e92ddc813fa |
files | src/plugins/quota/quota.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota.c Tue Feb 07 15:33:07 2017 +0200 +++ b/src/plugins/quota/quota.c Tue Feb 07 15:44:20 2017 +0200 @@ -1020,7 +1020,7 @@ return ret; } -static void quota_over_flag_init_root(struct quota_root *root, +static bool quota_over_flag_init_root(struct quota_root *root, const char **quota_over_flag_r, bool *status_r) { @@ -1033,7 +1033,7 @@ name = t_strconcat(root->set->set_name, "_over_flag_value", NULL); flag_mask = mail_user_plugin_getenv(root->quota->user, name); if (flag_mask == NULL) - return; + return FALSE; /* compare quota_over_flag's value (that comes from userdb) to quota_over_flag_value and save the result. */ @@ -1041,6 +1041,7 @@ *quota_over_flag_r = mail_user_plugin_getenv(root->quota->user, name); *status_r = *quota_over_flag_r != NULL && wildcard_match_icase(*quota_over_flag_r, flag_mask); + return TRUE; } static void quota_over_flag_check_root(struct quota_root *root) @@ -1067,7 +1068,8 @@ return; } root->quota_over_flag_checked = TRUE; - quota_over_flag_init_root(root, "a_over_flag, "a_over_status); + if (!quota_over_flag_init_root(root, "a_over_flag, "a_over_status)) + return; resources = quota_root_get_resources(root); for (i = 0; resources[i] != NULL; i++) {