From: Timo Sirainen Date: Tue, 7 Feb 2017 13:44:20 +0000 (+0200) Subject: quota: If quota_over_flag_value is unset, skip the quota_over check. X-Git-Tag: 2.3.0.rc1~2138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b711a7fc74bb2d21e1e951d7ae2e8517c53bb24b;p=thirdparty%2Fdovecot%2Fcore.git quota: If quota_over_flag_value is unset, skip the quota_over check. --- diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index 868a8cc509..e03a317bbd 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -1025,7 +1025,7 @@ int quota_transaction_commit(struct quota_transaction_context **_ctx) 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) { @@ -1038,7 +1038,7 @@ static void quota_over_flag_init_root(struct quota_root *root, 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. */ @@ -1046,6 +1046,7 @@ static void quota_over_flag_init_root(struct quota_root *root, *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) @@ -1072,7 +1073,8 @@ static void quota_over_flag_check_root(struct quota_root *root) 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++) {