]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
get the correct request, too
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jul 2022 20:09:02 +0000 (16:09 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jul 2022 20:09:02 +0000 (16:09 -0400)
src/lib/unlang/edit.c

index da88e941e5111e027cf6191f835b517d85228077..75c362aa51029bdd08553beaf11928271f90d3d2 100644 (file)
@@ -208,6 +208,7 @@ static int template_realize(TALLOC_CTX *ctx, fr_value_box_list_t *list, request_
 
 /** Remove VPs for laziness
  *
+ *     @todo - replace this with a dcursor, and remove everything which matches the dcursor.
  */
 static int remove_vps(request_t *request, edit_map_t *current)
 {
@@ -636,6 +637,7 @@ redo:
 
                        } else if (tmpl_find_vp(&current->lhs.vp, request, current->lhs.vpt) < 0) {
                                fr_pair_t *parent;
+                               request_t *other = request;
 
                                /*
                                 *      Get the list.
@@ -663,7 +665,13 @@ redo:
                                 *              // vp is the pair we need to edit.
                                 *      }
                                 */
-                               parent = tmpl_get_list(request, current->lhs.vpt);
+                               if (tmpl_request_ptr(&other, tmpl_request(current->lhs.vpt)) < 0) {
+                                       REDEBUG("Failed to find request for %s", current->lhs.vpt->name);
+                                       goto error;
+                               }
+                               fr_assert(other != NULL);
+
+                               parent = tmpl_get_list(other, current->lhs.vpt);
                                if (!parent) {
                                        REDEBUG("Failed to find list for %s", current->lhs.vpt->name);
                                        goto error;