]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
if xlat fails, then we return fail, too
authorAlan T. DeKok <aland@freeradius.org>
Wed, 18 Jun 2025 19:22:51 +0000 (15:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 18 Jun 2025 19:22:51 +0000 (15:22 -0400)
revert commit 4086074515

src/lib/unlang/xlat_expr.c

index 8050538a1b80628dc007187171731e4220f49582..a9c70ea5e710c115ba57d1730a6eee1e9a47ef9c 100644 (file)
@@ -1213,6 +1213,15 @@ static xlat_action_t xlat_logical_or_resume(TALLOC_CTX *ctx, fr_dcursor_t *out,
        xlat_logical_rctx_t     *rctx = talloc_get_type_abort(xctx->rctx, xlat_logical_rctx_t);
        bool                    match;
 
+       /*
+        *      If the expansions fails, then we fail the entire thing.
+        */
+       if (!XLAT_RESULT_SUCCESS(&rctx->last_result)) {
+               talloc_free(rctx->box);
+               talloc_free(rctx);
+               return XLAT_ACTION_FAIL;
+       }
+
        /*
         *      Recursively check groups.  i.e. we effectively flatten each list.
         *
@@ -1308,6 +1317,15 @@ static xlat_action_t xlat_logical_and_resume(TALLOC_CTX *ctx, fr_dcursor_t *out,
        xlat_logical_rctx_t     *rctx = talloc_get_type_abort(xctx->rctx, xlat_logical_rctx_t);
        bool                    match;
 
+       /*
+        *      If the expansions fails, then we fail the entire thing.
+        */
+       if (!XLAT_RESULT_SUCCESS(&rctx->last_result)) {
+               talloc_free(rctx->box);
+               talloc_free(rctx);
+               return XLAT_ACTION_FAIL;
+       }
+
        /*
         *      Recursively check groups.  i.e. we effectively flatten each list.
         *