]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
typos, and work around merge issue with hex <=
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Sep 2022 20:59:05 +0000 (16:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 15 Sep 2022 18:41:14 +0000 (14:41 -0400)
src/lib/unlang/edit.c
src/tests/keywords/hex

index c5bf9ec2b1239c355b88624ab469018ad24cce93..bbc203ac130b4b661384ce77ac073c3f87717e87 100644 (file)
@@ -91,6 +91,11 @@ static int tmpl_attr_from_result(TALLOC_CTX *ctx, edit_result_t *out, request_t
        ssize_t slen;
        fr_value_box_t *box = fr_dlist_head(&out->result);
 
+       if (!box) {
+               RWDEBUG("No value found for assignment");
+               return -1;
+       }
+
        /*
         *      Mash all of the results together.
         */
@@ -270,7 +275,6 @@ static int apply_edits_to_list(request_t *request, unlang_frame_state_edit_t *st
                if (fr_type_is_group(da->type)) da = fr_dict_root(request->dict);
 
                children = &current->rhs.pair_list;
-               copy_vps = false;
 
                /*
                 *      For exec, etc., parse the pair list from a string, in the context of the
@@ -1136,8 +1140,6 @@ static int expanded_lhs_value(request_t *request, unlang_frame_state_edit_t *sta
 {
        map_t const *map = current->map;
 
-       fr_assert(current->lhs.vp != NULL);
-
        /*
         *      The LHS isn't an xlat, so just append the expanded value-boxes to the parents result.
         */
@@ -1162,7 +1164,7 @@ static int expanded_lhs_attribute(request_t *request, unlang_frame_state_edit_t
 {
        if (tmpl_from_result(state, &current->lhs, tmpl_da(current->parent->lhs.vpt)->type, request) < 0) return -1;
 
-       return check_lhs(request, state, current);
+       return current->check_lhs(request, state, current);
 }
 
 static int expand_lhs(request_t *request, unlang_frame_state_edit_t *state, edit_map_t *current)
@@ -1177,7 +1179,7 @@ static int expand_lhs(request_t *request, unlang_frame_state_edit_t *state, edit
        if (rcode < 0) return -1;
 
        if (rcode == 1) {
-               current->func = expanded_lhs_attribute;
+               current->func = current->expanded_lhs;
                return 1;
        }
 
@@ -1227,7 +1229,7 @@ static unlang_action_t process_edit(rlm_rcode_t *p_result, request_t *request, u
                }
 
                /*
-                *      Stop if there's no parnt to process.
+                *      Stop if there's no parent to process.
                 */
                if (!state->current->parent) break;
 
index bf65d9bd403dcd4c7a5d8059a3324701f8f709e2..995afd0f0b5b78adbadb7bae8420ea6b6bb7524d 100644 (file)
@@ -1,20 +1,18 @@
 #
 # PRE: if
 #
-&request <= {
-       &Tmp-String-0           = '9870'
-       &Tmp-Octets-0           = 0x39383731
-       &Tmp-IP-Address-0       = 57.56.55.50
-       &Tmp-Integer-0          = 959985460
-       &Tmp-Cast-IfId          = '0000:0000:3938:3737'
-       &Tmp-Cast-IPv6Addr      = '::3938:3738'
-       &Tmp-Cast-IPv6Prefix    = '::3938:3739/128'
-       &Tmp-Cast-Byte          = 58
-       &Tmp-Cast-Short         = 14139
-       &Tmp-Cast-Ether         = 00:00:39:38:37:3c
-       &Tmp-Cast-Integer64     = 1152921505566832445
-       &Tmp-Cast-IPv4Prefix    = 57.56.55.62/32
-}
+&Tmp-String-0          := '9870'
+&Tmp-Octets-0          := 0x39383731
+&Tmp-IP-Address-0      := 57.56.55.50
+&Tmp-Integer-0         := 959985460
+&Tmp-Cast-IfId         := '0000:0000:3938:3737'
+&Tmp-Cast-IPv6Addr     := '::3938:3738'
+&Tmp-Cast-IPv6Prefix   := '::3938:3739/128'
+&Tmp-Cast-Byte         := 58
+&Tmp-Cast-Short                := 14139
+&Tmp-Cast-Ether                := 00:00:39:38:37:3c
+&Tmp-Cast-Integer64    := 1152921505566832445
+&Tmp-Cast-IPv4Prefix   := 57.56.55.62/32
 
 ok  # break up edit sections