From: Alan T. DeKok Date: Mon, 11 Nov 2024 21:15:01 +0000 (-0500) Subject: allow actions {...} in more sections X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de99e6d7b26c30605158e0f57f96f8ffa93ce4fa;p=thirdparty%2Ffreeradius-server.git allow actions {...} in more sections and document why they can't be in redundant, etc. --- diff --git a/doc/antora/modules/reference/pages/unlang/actions.adoc b/doc/antora/modules/reference/pages/unlang/actions.adoc index 553eadea4cd..b27b7887fa6 100644 --- a/doc/antora/modules/reference/pages/unlang/actions.adoc +++ b/doc/antora/modules/reference/pages/unlang/actions.adoc @@ -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`, diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index dd5f86838f8..cf8c60b34cf 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -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;