]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
hoist the attr ref fixups to be more specific
authorAlan T. DeKok <aland@freeradius.org>
Wed, 4 Oct 2023 15:15:35 +0000 (11:15 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 4 Oct 2023 15:15:35 +0000 (11:15 -0400)
src/lib/server/tmpl_tokenize.c

index 3f9c851393a755a1949c281dede417787da698d8..7ec5bd8c96918923c7dafdc05a05bdcc478f252e 100644 (file)
@@ -1732,6 +1732,16 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t
                                }
                        }
                        ar = NULL;
+
+               } else {
+                       /*
+                        *      We had an alias in the same namespace,
+                        *      go add more things in.
+                        */
+                       if (da->parent != our_parent) {
+                               fr_assert(namespace == our_parent);
+                               tmpl_attr_ref_fixup(ctx, vpt, da->parent, our_parent);
+                       }
                }
        }
 
@@ -1756,11 +1766,6 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t
                 *      reference.
                 */
                fr_assert(our_parent != NULL);
-
-               if (da->parent != our_parent) {
-                       tmpl_attr_ref_fixup(ctx, vpt, da->parent, our_parent);
-               }
-
                goto alloc_ar;
        }