Skip to content

Commit

Permalink
Setting local variables from mapping sections does seem to work...
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jan 17, 2024
1 parent 3a5ca15 commit bc078d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/lib/server/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -967,12 +967,6 @@ static int _map_afrom_cs(TALLOC_CTX *ctx, map_list_t *out, map_t *parent, CONF_S
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);

/*
Expand Down
10 changes: 9 additions & 1 deletion src/tests/keywords/map
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bc078d2

Please sign in to comment.