tmpl_attr_list_presence_t list_presence; //!< Whether the attribute reference can
///< have a list, forbid it, or require it.
+ CONF_ITEM *ci; //!< for migration support and various warnings
+
uint8_t allow_unknown:1; //!< Allow unknown attributes i.e. attributes
///< defined by OID string.
#include <freeradius-devel/util/base16.h>
#include <freeradius-devel/util/skip.h>
-
/*
* For xlat_exp_head_alloc(), because xlat_copy() doesn't create an output head.
*/
/*
* '&' prefix is ignored.
*/
- (void) fr_sbuff_next_if_char(&our_name, '&');
+ if (fr_sbuff_next_if_char(&our_name, '&') && check_config && at_rules->ci) {
+ cf_log_warn(at_rules->ci, "Using '&' is no longer necessary when referencing attributes, and should be deleted.");
+ }
/*
* We parsed the tmpl as User-Name, but NOT %{User-Name}.
*/
t_rules = *(unlang_ctx->rules);
t_rules.attr.allow_unknown = true;
+ fr_assert(t_rules.attr.ci == cf_pair_to_item(cp));
RULES_VERIFY(&t_rules);
edit = talloc_zero(parent, unlang_edit_t);
char const *skip_else = NULL;
unlang_compile_ctx_t *unlang_ctx;
unlang_compile_ctx_t unlang_ctx2;
- tmpl_rules_t t_rules;
+ tmpl_rules_t t_rules, t2_rules; /* yes, it does */
c = unlang_group_to_generic(g);
* by a variable definition.
*/
unlang_compile_ctx_copy(&unlang_ctx2, unlang_ctx_in);
+ t2_rules = *(unlang_ctx_in->rules);
+
unlang_ctx = &unlang_ctx2;
+ unlang_ctx2.rules = &t2_rules;
+
t_rules = *unlang_ctx_in->rules;
/*
while ((ci = cf_item_next(g->cs, ci))) {
if (cf_item_is_data(ci)) continue;
+ t_rules.attr.ci = ci;
+ t2_rules.attr.ci = ci;
+
/*
* Sections are keywords, or references to
* modules with updated return codes.
unlang_compile_ctx_t unlang_ctx2;
unlang_t *c;
+ UPDATE_CTX2;
+
/*
* module.c takes care of ensuring that this is:
*
* if it was found here.
*/
if (cf_section_name2(subcs)) {
- UPDATE_CTX2;
-
if (policy) {
cf_log_err(subcs, "Unexpected second name in policy");
return NULL;
c = compile_item(parent, &unlang_ctx2, cf_section_to_item(subcs));
} else {
- UPDATE_CTX2;
-
/*
* We have:
*
.attr = {
.dict_def = xr_rules.tr_rules->dict_def,
.list_def = request_attr_request,
+ .ci = cf_section_to_item(cs),
.allow_unresolved = false,
.allow_unknown = false,
.allow_wildcard = true,
- },
+ },
.literals_safe_for = unlang_ctx->rules->literals_safe_for,
};