From: Alan T. DeKok Date: Thu, 21 Jul 2022 19:10:28 +0000 (-0400) Subject: create LHS vp on merge RHS and union, too. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=102f284a8b7c670b60cc664a7f69de6a3a1da5fd;p=thirdparty%2Ffreeradius-server.git create LHS vp on merge RHS and union, too. nothing MERGE-RHS FOO == foo nothing UNION FOO == foo --- diff --git a/src/lib/unlang/edit.c b/src/lib/unlang/edit.c index c8cdee73715..1dbc838dbfb 100644 --- a/src/lib/unlang/edit.c +++ b/src/lib/unlang/edit.c @@ -646,8 +646,12 @@ redo: /* * Get the list. + * + * When we assign via :=, we create the LHS vp if it doesn't exist. The + * same goes for =, <=, and |=. Other operators require something on the + * LHS, so they will fail if the LHS doesn't exist. */ - if ((map->op != T_OP_SET) && (map->op != T_OP_EQ)) { + if ((map->op != T_OP_SET) && (map->op != T_OP_EQ) && (map->op != T_OP_LE) && (map->op != T_OP_OR_EQ)) { REDEBUG("Failed to find %s", current->lhs.vpt->name); goto error; } @@ -655,10 +659,7 @@ redo: fr_assert(!tmpl_is_list(current->lhs.vpt)); /* - * @todo - compile_edit() always sets list_as_attr, and when that - * happens, the tmpl list is _always_ set to 0 (request). - * - * What we really need is to create a dcursor, and then do something + * @todo - What we really need is to create a dcursor, and then do something * like: * * vp = tmpl_dcursor_init(&err, request, &cc, &cursor, request, vpt);