]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print rcode if we don't get passed options
authorAlan T. DeKok <aland@freeradius.org>
Tue, 15 Jul 2025 13:04:08 +0000 (09:04 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 15 Jul 2025 14:39:55 +0000 (10:39 -0400)
src/lib/unlang/xlat_expr.c

index a9c70ea5e710c115ba57d1730a6eee1e9a47ef9c..286e59b13bbbdd6ae00da84412fb3140773391f9 100644 (file)
@@ -1629,10 +1629,16 @@ static xlat_action_t xlat_func_expr_rcode(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
        /*
         *      If we have zero args, it's because the instantiation
-        *      function consumed them. om nom nom.
+        *      function consumed them. Unless the user read the debug
+        *      output, and tried to see what the rcode is, in case we
         */
        if (fr_value_box_list_num_elements(args) == 0) {
-               fr_assert(inst->rcode != RLM_MODULE_NOT_SET);
+               if (inst->rcode == RLM_MODULE_NOT_SET) {
+                       RDEBUG("Request rcode is '%s'",
+                              fr_table_str_by_value(rcode_table, request->rcode, "<INVALID>"));
+                       return XLAT_ACTION_DONE;
+               }
+
                rcode = inst->rcode;
        } else {
                XLAT_ARGS(args, &arg_rcode);