# HG changeset patch # User Timo Sirainen # Date 1486475060 -7200 # Node ID bfc81bb631994113e97467554c234273024e3709 # Parent b1c4db787e1ceb3288270826cc9893b370377181 quota: If quota_over_flag_value is unset, skip the quota_over check. diff -r b1c4db787e1c -r bfc81bb63199 src/plugins/quota/quota.c --- 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++) {