.attr = {
.dict_def = cc->tmpl_rules.attr.dict_def ?
cc->tmpl_rules.attr.dict_def : cc->config->dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unresolved = cc->tmpl_rules.attr.allow_unresolved
},
});
.dict_def = cc->tmpl_rules.attr.dict_def ?
cc->tmpl_rules.attr.dict_def : cc->config->dict,
.allow_unresolved = cc->tmpl_rules.attr.allow_unresolved,
+ .list_def = PAIR_LIST_REQUEST,
.list_as_attr = true,
}
});
.dict_def = cc->tmpl_rules.attr.dict_def ?
cc->tmpl_rules.attr.dict_def : cc->config->dict,
.allow_unresolved = cc->tmpl_rules.attr.allow_unresolved,
+ .list_def = PAIR_LIST_REQUEST,
.list_as_attr = true,
},
});
.attr = {
.dict_def = cc->tmpl_rules.attr.dict_def ?
cc->tmpl_rules.attr.dict_def : cc->config->dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unresolved = cc->tmpl_rules.attr.allow_unresolved
},
});
cc->fuzzer_dir = -1;
+ cc->tmpl_rules.attr.list_def = PAIR_LIST_REQUEST;
+
return cc;
}
tmpl_rules_t parse_rules = {
.attr = {
.dict_def = dict_radius,
+ .list_def = PAIR_LIST_REQUEST,
.allow_foreign = false, /* tests are in the RADIUS dictionary */
}
};
&(tmpl_rules_t) {
.attr = {
.dict_def = dict_protocol,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unresolved = true,
}
- }
+ }
);
if (slen <= 0) {
talloc_free(xlat_ctx);
t_rules = (tmpl_rules_t) {
.attr = {
.dict_def = dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unresolved = true,
.allow_unknown = true
}
tmpl_t *vpt;
static tmpl_rules_t rules = {
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.allow_unknown = true,
.allow_unresolved = true,
.allow_foreign = true
&(tmpl_rules_t) {
.attr = {
.dict_def = dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unknown = false,
.allow_unresolved = false,
.allow_foreign = (dict == NULL)
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_NO
}
});
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_NO
}
});
static inline CC_HINT(always_inline)
int _tmpl_setup_and_cursor_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *vars, request_t *request, char const *ref)
{
- tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){.attr = {.dict_def = test_dict}});
- TEST_CHECK(vars->vpt!= NULL);
- TEST_MSG("Failed creating tmpl from %s: %s", ref, fr_strerror());
- if (!vars->vpt) {
- *vp_out = NULL;
+ tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){
+ .attr = {
+ .dict_def = test_dict,
+ .list_def = PAIR_LIST_REQUEST,
+ }});
+ TEST_CHECK(vars->vpt!= NULL);
+ TEST_MSG("Failed creating tmpl from %s: %s", ref, fr_strerror());
+ if (!vars->vpt) {
+ *vp_out = NULL;
return -1;
}
static inline CC_HINT(always_inline)
int _tmpl_setup_and_cursor_build_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *vars, request_t *request, char const *ref)
{
- tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){.attr = {.dict_def = test_dict}});
- TEST_CHECK(vars->vpt!= NULL);
- TEST_MSG("Failed creating tmpl from %s: %s", ref, fr_strerror());
- if (!vars->vpt) {
- *vp_out = NULL;
+ tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){
+ .attr = {
+ .dict_def = test_dict,
+ .list_def = PAIR_LIST_REQUEST,
+ }});
+ TEST_CHECK(vars->vpt!= NULL);
+ TEST_MSG("Failed creating tmpl from %s: %s", ref, fr_strerror());
+ if (!vars->vpt) {
+ *vp_out = NULL;
return -1;
}
* Defaults are used if a NULL rules pointer is passed to the parsing function.
*/
static tmpl_rules_t const default_rules = {
-
+ .attr = {
+ .list_def = PAIR_LIST_REQUEST,
+ },
};
fr_type_to_str(da->type));
}
- if (!vpt->rules.attr.list_as_attr && (tmpl_list(vpt) >= PAIR_LIST_UNKNOWN)) {
+ if (!vpt->rules.attr.list_as_attr && ((tmpl_list(vpt) == PAIR_LIST_UNKNOWN) || tmpl_list(vpt) > PAIR_LIST_STATE)) {
fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_ATTR "
"attribute \"%s\" has invalid list (%i)",
file, line, tmpl_attr_tail_da(vpt)->name, tmpl_list(vpt));
.attr = {
.dict_def = dict,
.prefix = TMPL_ATTR_REF_PREFIX_NO,
+ .list_def = PAIR_LIST_REQUEST,
.disallow_qualifiers = true, /* for now, until more tests are made */
/*
.attr = {
.dict_def = dict,
.prefix = TMPL_ATTR_REF_PREFIX_YES,
+ .list_def = PAIR_LIST_REQUEST,
.disallow_qualifiers = true, /* for now, until rlm_files supports it */
}
};
* the process module.
*/
if (process->compile_list) {
- tmpl_rules_t parse_rules;
+ tmpl_rules_t parse_rules = {
+ .attr = {
+ .dict_def = *(process->dict),
+ .list_def = PAIR_LIST_REQUEST,
+ },
+ };
- memset(&parse_rules, 0, sizeof(parse_rules));
- parse_rules.attr.dict_def = *(process->dict);
fr_assert(parse_rules.attr.dict_def != NULL);
if (virtual_server_compile_sections(server_cs, process->compile_list, &parse_rules,
NULL,
&(tmpl_rules_t){
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.allow_unknown = true
}
});
unlang_t *c;
char const *name1, *name2;
+ fr_assert(unlang_ctx->rules != NULL);
+ fr_assert(unlang_ctx->rules->attr.list_def != PAIR_LIST_UNKNOWN);
/*
* We always create a group, even if the section is empty.
*/
tmpl_rules_t t_rules = (tmpl_rules_t) {
.attr = {
.dict_def = xr_rules.tr_rules->dict_def,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unresolved = true,
.allow_unknown = true
}
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_NO
}
});
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) return -4;
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) {
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) {
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) {
tmpl_rules_t attr_rules = {
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
};
},
&(tmpl_rules_t){
.attr = {
+ .dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unknown = false,
.allow_unresolved = false,
.allow_foreign = false,
- .dict_def = request->dict
},
.at_runtime = true
}) < 0) {
},
&(tmpl_rules_t){
.attr = {
+ .dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.allow_unknown = false,
.allow_unresolved = false,
.allow_foreign = false,
- .dict_def = request->dict
},
.at_runtime = true
}) < 0) {
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) {
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
}) <= 0) {
NULL,
&(tmpl_rules_t){
.attr = {
- .dict_def = request->dict
+ .dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
}
});
if (len == 0) {
/* Strict rules for the update map as it's processed with limited functionality */
.attr = {
.dict_def = dict_ldap_sync,
+ .list_def = PAIR_LIST_REQUEST,
.allow_foreign = false,
.allow_unknown = false,
.allow_unresolved = false,
&(tmpl_rules_t){
.attr = {
.dict_def = request->dict,
+ .list_def = PAIR_LIST_REQUEST,
.prefix = TMPL_ATTR_REF_PREFIX_AUTO
}
});
{
tmpl_rules_t parse_rules = {
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.allow_foreign = true /* Because we don't know where we'll be called */
}
};
T_BACK_QUOTED_STRING, NULL,
&(tmpl_rules_t) {
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.allow_foreign = true,
.allow_unresolved = false,
.allow_unknown = false
&json_arg_parse_rules,
&(tmpl_rules_t){
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.dict_def = request->dict
}
});
{
tmpl_rules_t parse_rules = {
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.allow_foreign = true /* Because we don't know where we'll be called */
}
};
NULL,
&(tmpl_rules_t){
.attr = {
+ .list_def = PAIR_LIST_REQUEST,
.dict_def = request->dict,
.allow_unknown = true,
.allow_unresolved = false,