]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
almost final cleanups
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jul 2022 18:28:45 +0000 (14:28 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jul 2022 18:28:45 +0000 (14:28 -0400)
src/lib/unlang/edit.c

index 36b87b3665287d91b6f6ff91718deabb9a4ce9b2..8fa393be1e5daecf8a9886b4d35d1bb87a49b37f 100644 (file)
@@ -563,11 +563,13 @@ assign:
 static unlang_action_t process_edit(rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 {
        unlang_frame_state_edit_t       *state = talloc_get_type_abort(frame->state, unlang_frame_state_edit_t);
-       edit_map_t                      *current = state->current;
+       edit_map_t                      *current;
        map_t const                     *map;
        int                             rcode;
 
 redo:
+       current = state->current;
+
        /*
         *      Iterate over the maps, expanding the LHS and RHS.
         */
@@ -670,6 +672,8 @@ redo:
                                /*
                                 *      Add the new VP to the parent.  The edit list code is safe for multiple
                                 *      edits of the same VP, so we don't have to do anything else here.
+                                *
+                                *      @todo - this works for only one level.  We really need to support multiple levels. :(
                                 */
                                MEM(current->lhs.vp = fr_pair_afrom_da(parent, tmpl_da(current->lhs.vpt)));
                                if (fr_edit_list_insert_pair_tail(state->el, &parent->vp_group, current->lhs.vp) < 0) goto error;
@@ -756,7 +760,7 @@ redo:
                        if (!current->lhs.vp) goto error;
 #endif
 
-                       if (templatize_rhs(state, &current->rhs, current->lhs.vp, request) < 0) goto error;
+                       if (map->rhs && (templatize_rhs(state, &current->rhs, current->lhs.vp, request) < 0)) goto error;
 
                        current->state = UNLANG_EDIT_CHECK_RHS;
                        FALL_THROUGH;