]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
handle ALIAS attributes when parsing
authorAlan T. DeKok <aland@freeradius.org>
Mon, 27 Oct 2025 21:32:47 +0000 (17:32 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 28 Oct 2025 13:07:53 +0000 (09:07 -0400)
so that we create the full tree, and not a partial one

src/lib/util/pair_legacy.c

index 3eed1c66694e5b606879dae0ad4618bb347d058f..465d9195631deb6de7b4aaf311c6d26ac25fa9ee 100644 (file)
@@ -519,8 +519,19 @@ redo:
                        goto leaf;
                } else {
                leaf:
-                       if (fr_pair_append_by_da(relative->ctx, &vp, relative->list, da) < 0) {
-                               return fr_sbuff_error(&our_in);
+                       /*
+                        *      In the common case, we jump ahead one level.
+                        *
+                        *      But for ALIAS, we may jump ahead multiple levels.
+                        */
+                       if ((relative->da->depth + 1) == da->depth) {
+                               if (fr_pair_append_by_da(relative->ctx, &vp, relative->list, da) < 0) {
+                                       return fr_sbuff_error(&our_in);
+                               }
+                       } else {
+                               vp = fr_pair_afrom_da_depth_nested(relative->ctx, relative->list, da,
+                                                                  relative->da->depth);
+                               if (!vp) return fr_sbuff_error(&our_in);
                        }
                }