]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow non-operators for "limit" and "timeout", too
authorAlan T. DeKok <aland@freeradius.org>
Sun, 20 Jul 2025 12:45:32 +0000 (14:45 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 20 Jul 2025 12:50:15 +0000 (14:50 +0200)
src/lib/server/cf_file.c
src/tests/keywords/limit-fail [new file with mode: 0644]

index 0f25481ff1a79a7b51a1073eb49e32f96273a6c6..a1ee38f160ea7d6a8d1862baa87205fb54fc6d91 100644 (file)
@@ -2659,7 +2659,9 @@ check_for_eol:
                 *      'case ::foo' is allowed.  For generality, we just expect that the second argument to
                 *      'case' is not an operator.
                 */
-               if (strcmp(buff[1], "case") == 0) {
+               if ((strcmp(buff[1], "case") == 0) ||
+                   (strcmp(buff[1], "limit") == 0) ||
+                   (strcmp(buff[1], "timeout") == 0)) {
                        break;
                }
 
diff --git a/src/tests/keywords/limit-fail b/src/tests/keywords/limit-fail
new file mode 100644 (file)
index 0000000..ef73bcf
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# PRE: limit
+#
+try {
+       limit %test.fail() {
+               success
+       }
+}
+catch fail {
+       success
+}
+