config process runs [ext_]check_func()s, but it can't expand %variables.
So when config sees that there are %variables in a string, it assigns the
value to "set_value_unknown" pointer. The check_func()s can then skip
checking the validity of settings that point to set_value_unknown.
} T_END;
break;
}
- default:
+ default: {
+ const char *value = p->settings[i].str;
+ if (p->info->defines[i].type != SET_STR_NOVARS &&
+ strchr(p->settings[i].str, '%') != NULL) {
+ /* We don't know what the variables would
+ expand to. */
+ value = set_value_unknown;
+ }
(void)settings_parse_keyidx_value_nodup(parser, i,
- p->info->defines[i].key, p->settings[i].str);
+ p->info->defines[i].key, value);
break;
}
+ }
}
return parser;
}
char *error;
};
+const char *set_value_unknown = "UNKNOWN_VALUE_WITH_VARIABLES";
+
#ifdef DEBUG
static const char *boollist_eol_sentry = "boollist-eol";
#endif
const void *ptr2;
const char *error;
+ if (value == set_value_unknown) {
+ /* setting value is unknown - preserve the exact pointer */
+ dup_value = FALSE;
+ }
+
i_free(ctx->error);
while (def->type == SET_ALIAS) {
struct setting_parser_context;
+/* If a string setting value has this pointer, it means the setting isn't
+ actually known because it contained %{variables}. [ext_]check_func() can use
+ this to not give early errors when the variable value isn't known. */
+extern const char *set_value_unknown;
+
struct setting_parser_context *
settings_parser_init(pool_t set_pool, const struct setting_parser_info *root,
enum settings_parser_flags flags);