]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print out the thing we looked up, too
authorAlan T. DeKok <aland@freeradius.org>
Sat, 26 Apr 2025 16:37:54 +0000 (12:37 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 26 Apr 2025 16:55:55 +0000 (12:55 -0400)
src/lib/unlang/xlat_builtin.c
src/tests/keywords/if-failed-xlat
src/tests/keywords/if-regex-match-named

index cea92388597d20c4aebdfb966a0e3547a9a8ef86..42c5776b1eda8a4e4e69d4c22b6aa5cf3eba519a 100644 (file)
@@ -2848,7 +2848,7 @@ static xlat_action_t xlat_func_regex(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
                MEM(vb = fr_value_box_alloc_null(ctx));
                if (regex_request_to_sub(vb, vb, request, idx.vb_uint32) < 0) {
-                       REDEBUG2("No previous numbered regex capture group");
+                       REDEBUG2("No previous numbered regex capture group '%u'", idx.vb_uint32);
                        talloc_free(vb);
                        return XLAT_ACTION_FAIL;
                }
@@ -2874,7 +2874,7 @@ static xlat_action_t xlat_func_regex(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
                MEM(vb = fr_value_box_alloc_null(ctx));
                if (regex_request_to_sub_named(vb, vb, request, arg->vb_strvalue) < 0) {
-                       REDEBUG2("No previous named regex capture group");
+                       REDEBUG2("No previous named regex capture group '%s'", arg->vb_strvalue);
                        talloc_free(vb);
                        return XLAT_ACTION_FAIL;
                }
index 79b70d84c95dd1d181b5d9b20a43932791cc2444..420b55d9bf6f12a0d5fccd8550bdc356825446c9 100644 (file)
@@ -10,7 +10,7 @@ if (%regex('foo')) {
        test_fail
 }
 
-if (!(Module-Failure-Message[*] == "No previous named regex capture group")) {
+if (Module-Failure-Message[*] != "No previous named regex capture group 'foo'") {
        test_fail
 }
 }
index 52f25137d1b258e7de7caea4b65392984a1dcc92..714f4e8f8aa03f18d705c013d330cf9f96bee0b6 100644 (file)
@@ -25,7 +25,7 @@ if (%regex('foo')) {
        test_fail
 }
 
-if (!(Module-Failure-Message[*] == "No previous named regex capture group")) {
+if (!(Module-Failure-Message[*] == "No previous named regex capture group 'foo'")) {
        test_fail
 }
 
@@ -36,7 +36,7 @@ if (%regex(Port-Limit)) {
        test_fail
 }
 
-if (!(Module-Failure-Message[*] == "No previous numbered regex capture group")) {
+if (!(Module-Failure-Message[*] == "No previous numbered regex capture group '1'")) {
        test_fail
 }