]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota root default init changed to use common param parse function
authorSergey Kitov <sergey.kitov@open-xchange.com>
Fri, 19 May 2017 07:46:27 +0000 (10:46 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 23 May 2017 08:14:26 +0000 (11:14 +0300)
src/plugins/quota/quota.c

index e15df35ce857896b6033910c8509bea746810183..d4ec65f3ea265cda4fdde8de4aa992f6d60f34e6 100644 (file)
@@ -378,29 +378,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