]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
cast values, not copy
authorAlan T. DeKok <aland@freeradius.org>
Wed, 10 Aug 2022 13:26:09 +0000 (09:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 10 Aug 2022 13:29:30 +0000 (09:29 -0400)
which lets the parser return uint8, and then we assign that
value to a uint32 attribute.

src/lib/unlang/edit.c
src/tests/keywords/edit-leaf-star

index 3c134eaeeff9e4a2e98eed34a6c0c595ab014985..c5f25ec5a1ca896691c25c03254e2cb47b097a84 100644 (file)
@@ -679,7 +679,7 @@ redo:
                                MEM(vp = fr_pair_afrom_da(current, current->parent->lhs.vp->da));
 
                                if (tmpl_is_data(current->lhs.vpt)) {
-                                       if (fr_value_box_copy(vp, &vp->data, tmpl_value(current->lhs.vpt)) < 0) goto error;
+                                       if (fr_value_box_cast(vp, &vp->data, vp->da->type, vp->da, tmpl_value(current->lhs.vpt)) < 0) goto error;
 
                                } else {
                                        fr_pair_t *ref;
index 270c29e3a78215387289a83f8d86a227290960f7..3e0b2ccf42af53211f82efc9ef2e51cb9a83b85b 100644 (file)
@@ -1,13 +1,7 @@
 #
 #  PRE: edit
 #
-&request += {
-       &Tmp-Integer-0 = 1
-       &Tmp-Integer-0 = 3
-       &Tmp-Integer-0 = 5
-       &Tmp-Integer-0 = 7
-       &Tmp-Integer-0 = 11
-}
+&request.Tmp-Integer-0 := { 1, 3, 5, 7, 11 }
 
 &Tmp-Integer-1 := 0