]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow actions {...} in more sections
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Nov 2024 21:15:01 +0000 (16:15 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 12 Nov 2024 12:28:12 +0000 (07:28 -0500)
and document why they can't be in redundant, etc.

doc/antora/modules/reference/pages/unlang/actions.adoc
src/lib/unlang/compile.c

index 553eadea4cdd89b67b9ec5c9df6f71326e46a997..b27b7887fa6d571d691eb139ccc35ad54fcf420f 100644 (file)
@@ -28,10 +28,15 @@ following keywords:
 * `if`
 * `else`
 * `elsif`
+* `foreach`
 * `group`
+* `limit`
+* `switch`
 * `timeout`
 * `transaction`
 
+The `actions` block cannot be used for `redundant`, `redundant-load-balance`, or `load-balance` keywords.  Those sections already have default actions to take for the various return codes.  Allowing the `actions` block to over-ride those default actions would cause those sections to operate incorrectly.
+
 == Priorities
 
 Higher numbers mean higher priorities.  An rcode of `fail` with priority `3` will over-ride an rcode of `ok` with priority `1`,
index dd5f86838f8b363461c24818360a4efcbf84f6b0..cf8c60b34cffee7d31f4a3768c0437a4e149f02b 100644 (file)
@@ -2014,7 +2014,7 @@ static bool compile_action_subsection(unlang_t *c, CONF_SECTION *cs, CONF_SECTIO
 
        /*
         *      Over-riding the actions can be done in certain limited
-        *      situations.  In other situations (e.g. "switch",
+        *      situations.  In other situations (e.g. "redundant", 
         *      "load-balance"), it doesn't make sense.
         *
         *      Note that this limitation also applies to "retry"
@@ -2029,7 +2029,10 @@ static bool compile_action_subsection(unlang_t *c, CONF_SECTION *cs, CONF_SECTIO
        case UNLANG_TYPE_IF:
        case UNLANG_TYPE_ELSE:
        case UNLANG_TYPE_ELSIF:
+       case UNLANG_TYPE_FOREACH:
        case UNLANG_TYPE_GROUP:
+       case UNLANG_TYPE_LIMIT:
+       case UNLANG_TYPE_SWITCH:
        case UNLANG_TYPE_TIMEOUT:
        case UNLANG_TYPE_TRANSACTION:
                break;