diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index 0460f102ff..a074fb4209 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -376,29 +376,14 @@ static void quota_root_deinit(struct quota_root *root) int quota_root_default_init(struct quota_root *root, const char *args, const char **error_r) { - const char *const *tmp; - - if (args == NULL) - return 0; - - tmp = t_strsplit_spaces(args, " "); - for (; *tmp != NULL; tmp++) { - if (strcmp(*tmp, "noenforcing") == 0) - root->no_enforcing = TRUE; - else if (strcmp(*tmp, "hidden") == 0) - root->hidden = TRUE; - else if (strcmp(*tmp, "ignoreunlimited") == 0) - root->disable_unlimited_tracking = TRUE; - else - break; - } - if (*tmp != NULL) { - *error_r = t_strdup_printf( - "Unknown parameter for backend %s: %s", - root->backend.name, *tmp); - return -1; - } - return 0; + const struct quota_param_parser default_params[] = { + quota_param_hidden, + quota_param_ignoreunlimited, + quota_param_noenforcing, + quota_param_ns, + {.param_name = NULL} + }; + return quota_parse_parameters(root, &args, error_r, default_params, FALSE); } static int