extern struct setting_parser_info auth_setting_parser_info;
extern struct setting_parser_info auth_root_setting_parser_info;
-static bool auth_settings_check(void *_set, const char **error_r);
+static bool auth_settings_check(void *_set, pool_t pool, const char **error_r);
#undef DEF
#define DEF(type, name) \
}
/* <settings checks> */
-static bool auth_settings_check(void *_set ATTR_UNUSED,
+static bool auth_settings_check(void *_set ATTR_UNUSED, pool_t pool ATTR_UNUSED,
const char **error_r ATTR_UNUSED)
{
#ifndef CONFIG_BINARY
settings_parser_get_error(parser));
}
- if (settings_parser_check(parser, &error) < 0)
+ if (settings_parser_check(parser, settings_pool, &error) < 0)
i_fatal("Invalid settings: %s", error);
set = settings_parser_get(parser);
if (l->parser == NULL)
continue;
- if (!settings_parser_check(l->parser, &errormsg)) {
+ if (!settings_parser_check(l->parser, pool, &errormsg)) {
i_fatal("Error in configuration file %s: %s",
path, errormsg);
}
#include <stdlib.h>
#include <unistd.h>
-static bool imap_settings_check(void *_set, const char **error_r);
+static bool imap_settings_check(void *_set, pool_t pool, const char **error_r);
#undef DEF
#undef DEFLIST
}
/* <settings checks> */
-static bool imap_settings_check(void *_set, const char **error_r)
+static bool imap_settings_check(void *_set, pool_t pool ATTR_UNUSED,
+ const char **error_r)
{
struct imap_settings *set = _set;
if (value != NULL)
parse_expand_vars(parser, value);
- if (settings_parser_check(parser, &error) < 0)
+ if (settings_parser_check(parser, settings_pool, &error) < 0)
i_fatal("Invalid settings: %s", error);
sets = settings_parser_get_list(parser);
return ret;
}
-static bool settings_parser_check_info(const struct setting_parser_info *info,
- void *set, const char **error_r)
+static bool
+settings_parser_check_info(const struct setting_parser_info *info, pool_t pool,
+ void *set, const char **error_r)
{
const struct setting_define *def;
const ARRAY_TYPE(void_array) *val;
unsigned int i, count;
if (info->check_func != NULL) {
- if (!info->check_func(set, error_r))
+ if (!info->check_func(set, pool, error_r))
return FALSE;
}
children = array_get(val, &count);
for (i = 0; i < count; i++) {
- if (!settings_parser_check_info(def->list_info,
+ if (!settings_parser_check_info(def->list_info, pool,
children[i], error_r))
return FALSE;
}
return TRUE;
}
-bool settings_parser_check(struct setting_parser_context *ctx,
+bool settings_parser_check(struct setting_parser_context *ctx, pool_t pool,
const char **error_r)
{
unsigned int i;
for (i = 0; i < ctx->root_count; i++) {
- if (!settings_parser_check_info(ctx->roots[i].info,
+ if (!settings_parser_check_info(ctx->roots[i].info, pool,
ctx->roots[i].set_struct,
error_r))
return FALSE;
size_t parent_offset;
size_t type_offset;
size_t struct_size;
- bool (*check_func)(void *set, const char **error_r);
+ bool (*check_func)(void *set, pool_t pool, const char **error_r);
};
ARRAY_DEFINE_TYPE(setting_parser_info, struct setting_parser_info);
const char *bin_path, const char *config_path,
const char *service);
/* Call all check_func()s to see if currently parsed settings are valid. */
-bool settings_parser_check(struct setting_parser_context *ctx,
+bool settings_parser_check(struct setting_parser_context *ctx, pool_t pool,
const char **error_r);
/* While parsing values, specifies if STR_VARS strings are already expanded. */
#include <stddef.h>
-static bool mail_storage_settings_check(void *_set, const char **error_r);
-static bool namespace_settings_check(void *_set, const char **error_r);
+static bool mail_storage_settings_check(void *_set, pool_t pool, const char **error_r);
+static bool namespace_settings_check(void *_set, pool_t pool, const char **error_r);
#undef DEF
#define DEF(type, name) \
}
/* <settings checks> */
-static bool mail_storage_settings_check(void *_set, const char **error_r)
+static bool mail_storage_settings_check(void *_set, pool_t pool ATTR_UNUSED,
+ const char **error_r)
{
const struct mail_storage_settings *set = _set;
return TRUE;
}
-static bool namespace_settings_check(void *_set, const char **error_r)
+static bool namespace_settings_check(void *_set, pool_t pool ATTR_UNUSED,
+ const char **error_r)
{
struct mail_namespace_settings *ns = _set;
struct mail_namespace_settings *const *namespaces;
#include <stddef.h>
#include <unistd.h>
-static bool login_settings_check(void *_set, const char **error_r);
+static bool login_settings_check(void *_set, pool_t pool, const char **error_r);
#undef DEF
#define DEF(type, name) \
#endif
}
-static bool login_settings_check(void *_set, const char **error_r)
+static bool login_settings_check(void *_set, pool_t pool ATTR_UNUSED,
+ const char **error_r)
{
struct login_settings *set = _set;
settings_parser_get_error(parser));
}
- if (settings_parser_check(parser, &error) < 0)
+ if (settings_parser_check(parser, settings_pool, &error) < 0)
i_fatal("Invalid settings: %s", error);
set = settings_parser_get(parser);
#include <stdlib.h>
#include <unistd.h>
-static bool pop3_settings_check(void *_set, const char **error_r);
+static bool pop3_settings_check(void *_set, pool_t pool, const char **error_r);
#undef DEF
#undef DEFLIST
}
/* <settings checks> */
-static bool pop3_settings_check(void *_set, const char **error_r)
+static bool pop3_settings_check(void *_set, pool_t pool ATTR_UNUSED,
+ const char **error_r)
{
struct pop3_settings *set = _set;
if (value != NULL)
parse_expand_vars(parser, value);
- if (settings_parser_check(parser, &error) < 0)
+ if (settings_parser_check(parser, settings_pool, &error) < 0)
i_fatal("Invalid settings: %s", error);
sets = settings_parser_get_list(parser);