]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix "success" policy to use new edit sections
authorAlan T. DeKok <aland@freeradius.org>
Wed, 1 Feb 2023 02:56:08 +0000 (21:56 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 1 Feb 2023 02:56:08 +0000 (21:56 -0500)
we don't need to do "if" checks for parent, we can just use
the "=" operator, and let that fail-safe.

We also revert the "subrequest" test to the previous version.

The next step is to figure out why changing the xlat expansions
broke the "success" policy.  But we can check that tomorrow,
once the CI tests pass again.

src/tests/keywords/policy.conf
src/tests/keywords/subrequest

index 38fda3baa35afca14a0f309cc587eaf70a1686ec..06b075d7cc834e5e45ff0306de37c1cd67570619 100644 (file)
@@ -53,17 +53,8 @@ with.dots {
 #  Set the test to successful, but only if there are no failures.
 #
 success {
-       if (!&reply.Result-Status) {
-               &reply += {
-                       &Result-Status = "success"
-               }
-       }
-
-       if (&parent.request && !&parent.reply.Result-Status) {
-               &parent.reply += {
-                       &Result-Status = "success"
-               }
-       }
+       &parent.reply.Result-Status = "success"
+       &reply.Result-Status = "success"
 
        ok
 }
index a764acc481306a9349e97cc9d0ec3698ce8fa1cb..83e2675dad29a991722846a5f8400d5acf8fa473 100644 (file)
@@ -1,5 +1,6 @@
 subrequest Access-Request {
        &parent.control.User-Name := 'bob'
+       success
 }
 
 if (!&control.User-Name) {
@@ -9,5 +10,3 @@ if (!&control.User-Name) {
 if (!(&control.User-Name == 'bob')) {
        test_fail
 }
-
-success