]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Setting local variables from mapping sections does seem to work...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 17 Jan 2024 17:41:40 +0000 (11:41 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 17 Jan 2024 17:41:40 +0000 (11:41 -0600)
src/lib/server/map.c
src/tests/keywords/map

index 06c6cc198b47b8fbaddc83ad2dc92cae50857008..531ecad85122cb8670670bf1448075ddd51cbd96 100644 (file)
@@ -527,7 +527,7 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
                fr_strerror_const("Invalid operator");
                goto error_adj;
        }
-       
+
        /*
         *      Validate operators for check items.
         *
@@ -967,12 +967,6 @@ do_children:
                        goto error;
                }
 
-               if (tmpl_is_attr(map->lhs) && tmpl_attr_tail_da(map->lhs)->flags.local) {
-                       cf_log_err(ci, "Invalid location for local attribute '%s'", map->lhs->name);
-                       talloc_free(map);
-                       goto error; /* re-do "goto marker" stuff to print out spaces ? */
-               }
-
                MAP_VERIFY(map);
 
                /*
index a5e18c3c3fd6d1a0003a775a977f828efabdf05e..2fb87afb575086241a66a8d334ec8d9fa3fcdb25 100644 (file)
@@ -1,6 +1,14 @@
+string CSV-Result
+
 #
 #  PRE: map-2arg-error map-empty-error map-module-error map-field-error
 #
 map csv &User-Name {
-       &reply.Result-Status := field3
+       &CSV-Result := field3
 }
+
+if (!(&CSV-Result == "success")) {
+       test_fail
+}
+
+success