return slen;
}
-static ssize_t command_tmpl_rule_disallow_internal(UNUSED TALLOC_CTX *ctx, tmpl_rules_t *rules, fr_sbuff_t *value)
-{
- bool res;
- ssize_t slen;
-
- slen = fr_sbuff_out_bool(&res, value);
- rules->attr.disallow_internal = res;
- return slen;
-}
-
static ssize_t command_tmpl_rule_disallow_qualifiers(UNUSED TALLOC_CTX *ctx, tmpl_rules_t *rules, fr_sbuff_t *value)
{
bool res;
{ L("allow_unknown"), (void *)command_tmpl_rule_allow_unknown },
{ L("allow_unresolved"), (void *)command_tmpl_rule_allow_unresolved },
{ L("attr_parent"), (void *)command_tmpl_rule_attr_parent },
- { L("disallow_internal"), (void *)command_tmpl_rule_disallow_internal },
{ L("disallow_qualifiers"), (void *)command_tmpl_rule_disallow_qualifiers },
{ L("list_def"), (void *)command_tmpl_rule_list_def },
{ L("request_def"), (void *)command_tmpl_rule_request_def }
{ L("tmpl-rules "), &(command_entry_t){
.func = command_tmpl_rules,
- .usage = "tmpl-rule [allow_foreign=yes] [allow_unknown=yes|no] [allow_unresolved=yes|no] [attr_parent=<oid>] [disallow_internal=yes|no] [disallow_qualifiers=yes|no] [list_def=request|reply|control|session-state] [request_def=current|outer|parent]",
+ .usage = "tmpl-rule [allow_foreign=yes] [allow_unknown=yes|no] [allow_unresolved=yes|no] [attr_parent=<oid>] [disallow_qualifiers=yes|no] [list_def=request|reply|control|session-state] [request_def=current|outer|parent]",
.description = "Alter the tmpl parsing rules for subsequent tmpl parsing commands in the same command context"
}},
{ L("touch "), &(command_entry_t){
* result in a parse error.
* - allow_unresolved - If false unknown attribute names
* result in a parse error.
- * - disallow_internal - If an attribute resolves in the
- * internal dictionary then that results in a parse
- * error.
* - allow_foreign - If an attribute resolves in a dictionary
* that does not match the parent
* (exception being FR_TYPE_GROUP) then that results
(void)fr_dict_attr_search_by_qualified_name_substr(&dict_err, &da,
at_rules->dict_def,
name, p_rules ? p_rules->terminals : NULL,
- !at_rules->disallow_internal,
+ true,
at_rules->allow_foreign);
/*
* We can't know which dictionary the
* Discard any errors here... It's more
* useful to have the original.
*/
- if (!da && !vpt->rules.attr.disallow_internal) {
+ if (!da) {
ar = tmpl_attr_list_tail(&vpt->data.attribute.ar);
if (!ar || ((ar->type == TMPL_ATTR_TYPE_NORMAL) && (ar->ar_da->type == FR_TYPE_GROUP))) {
fr_dict_attr_t const *internal_root = fr_dict_root(fr_dict_internal());
* function.
*/
if (!namespace && at_rules->dict_def) our_parent = namespace = fr_dict_root(at_rules->dict_def);
- if (!namespace && !at_rules->disallow_internal) our_parent = namespace = fr_dict_root(fr_dict_internal());
+ if (!namespace) our_parent = namespace = fr_dict_root(fr_dict_internal());
if (!namespace) {
fr_strerror_const("Attribute references must be qualified with a protocol when used here");
if (err) *err = TMPL_ATTR_ERROR_UNQUALIFIED_NOT_ALLOWED;
/*
* Attribute location (dictionary) checks
*/
- if (!at_rules->allow_foreign || at_rules->disallow_internal) {
+ if (!at_rules->allow_foreign) {
fr_dict_t const *found_in = fr_dict_by_da(da);
fr_dict_t const *dict_def = at_rules->dict_def ? at_rules->dict_def : fr_dict_internal();
*/
if (!our_parent) our_parent = fr_dict_root(dict_def);
- /*
- * Even if allow_foreign is false, if disallow_internal is not
- * true, we still allow the resolution.
- */
- if (at_rules->disallow_internal && (found_in == fr_dict_internal())) {
- fr_strerror_const("Internal attributes not allowed here");
- if (err) *err = TMPL_ATTR_ERROR_INTERNAL_NOT_ALLOWED;
- fr_sbuff_set(name, &m_s);
- goto error;
- }
-
/*
* Check that the attribute we resolved was from an allowed
* dictionary.
* #tmpl_t will be produced.
* - allow_foreign If true, allow attribute names to be qualified
* with a protocol outside of the passed dict_def.
- * - disallow_internal If true, don't allow fallback to internal
- * attributes.
* - disallow_filters
*
* @see REMARKER to produce pretty error markers from the return value.
&FR_SBUFF_IN(ar->ar_unresolved,
talloc_array_length(ar->ar_unresolved) - 1),
NULL,
- !vpt->rules.attr.disallow_internal,
+ true,
vpt->rules.attr.allow_foreign);
if (!da) return -2; /* Can't resolve, maybe the caller can resolve later */
* in the internal dictionary.
*/
if (!da) {
- if (!vpt->rules.attr.disallow_internal && prev && (prev->ar_da->type == FR_TYPE_GROUP)) {
+ if (prev && (prev->ar_da->type == FR_TYPE_GROUP)) {
(void)fr_dict_attr_by_name_substr(NULL,
&da,
fr_dict_root(fr_dict_internal()),