From: Alan T. DeKok Date: Tue, 11 May 2021 12:28:45 +0000 (-0400) Subject: Revert "don't search through all dicts if allow_foreign==false" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfea2964a06ef8a734276196149342794b16afa4;p=thirdparty%2Ffreeradius-server.git Revert "don't search through all dicts if allow_foreign==false" This reverts commit 1da442063f095f50e676a1a1eeeb68a00b018548. --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 8eba849df75..1ffe1b97f76 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -1456,17 +1456,16 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t name, p_rules ? p_rules->terminals : NULL); /* - * Allow fallback to internal attributes if - * that's allowed, AND the parent is at the - * top-level namespace, or the parent is a group. + * Allow fallback to internal attributes + * if the parent was a group, and we're + * allowing internal resolution. * * Discard any errors here... It's more * useful to have the original. */ if (!da && !vpt->rules.disallow_internal && - ((our_parent == namespace) || - ((ar = fr_dlist_tail(&vpt->data.attribute.ar)) && - (ar->type == TMPL_ATTR_TYPE_NORMAL) && (ar->ar_da->type == FR_TYPE_GROUP)))) { + (ar = fr_dlist_tail(&vpt->data.attribute.ar)) && + (ar->type == TMPL_ATTR_TYPE_NORMAL) && (ar->ar_da->type == FR_TYPE_GROUP)) { (void)fr_dict_attr_by_name_substr(NULL, &da, fr_dict_root(fr_dict_internal()), name, @@ -2004,13 +2003,9 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err, */ if ((list_len == 0) || (fr_sbuff_next_if_char(&our_name, '.') && fr_sbuff_is_in_charset(&our_name, fr_dict_attr_allowed_chars))) { - fr_dict_attr_t const *parent = t_rules->attr_parent; - - if (!parent && !t_rules->allow_foreign && t_rules->dict_def) parent = fr_dict_root(t_rules->dict_def); - ret = tmpl_attr_afrom_attr_substr(vpt, err, vpt, - parent, parent, + t_rules->attr_parent, t_rules->attr_parent, &our_name, p_rules, t_rules, 0); if (ret < 0) goto error; diff --git a/src/tests/keywords/update-group-error b/src/tests/keywords/update-group-error index be9530977fc..41852a64fbe 100644 --- a/src/tests/keywords/update-group-error +++ b/src/tests/keywords/update-group-error @@ -7,7 +7,7 @@ update reply { # # This is a string, so it's NOT allowed. # - &Tmp-String-1 := { # ERROR - Tmp-String-2 := "1.0" + &Tmp-String-1 := { + Tmp-String-2 := "1.0" # ERROR } }