]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More convert 'update' to 'edit' (#4724)
authorJorge Pereira <jpereira@users.noreply.github.com>
Wed, 21 Sep 2022 18:18:37 +0000 (19:18 +0100)
committerGitHub <noreply@github.com>
Wed, 21 Sep 2022 18:18:37 +0000 (14:18 -0400)
* More convert 'update' to 'edit' against EAPOL tests

* More convert 'update' to 'edit' against bin tests

* More convert 'update' to 'edit' against TACACS tests

* More convert 'update' to 'edit' against AUTH tests

* More convert 'update' to 'edit' against DIGEST tests

* More convert 'update' to 'edit' against PERFORMANCE tests

* More convert 'update' to 'edit' against RADCLIENT tests

* More convert 'update' to 'edit' against VMPS tests

* More convert 'update' to 'edit' against XLAT tests

22 files changed:
src/tests/auth/chap
src/tests/auth/chap_header
src/tests/auth/chap_mac_auth
src/tests/auth/chap_mac_auth_2
src/tests/auth/digest
src/tests/auth/md5_password
src/tests/auth/password_with_header
src/tests/auth/password_without_header
src/tests/auth/unit_test_module.conf
src/tests/bin/unit_test_module.conf
src/tests/digest/config/digest.conf
src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime
src/tests/eapol_test/config/aka/sites-enabled/aka
src/tests/eapol_test/config/servers.conf
src/tests/eapol_test/config/sim/sites-enabled/sim
src/tests/eapol_test/config/tls/sites-enabled/tls
src/tests/performance/ack.conf
src/tests/performance/proxy.conf
src/tests/radclient/config/radiusd.conf
src/tests/tacacs/config/radiusd.conf
src/tests/vmps/config/radiusd.conf
src/tests/xlat/unit_test_module.conf

index e8ce87a0c0432bf6aa867416d49234478cac303e..580f197e1766b0873e1e4eb82be6d2d79ea1f4ab 100644 (file)
@@ -5,6 +5,4 @@
 #
 #  Set CHAP-Password
 #
-update request {
-       &CHAP-Password := "%(chap_password:%{request.CHAP-Password})"
-}
+&CHAP-Password := "%(chap_password:%{CHAP-Password})"
index 685457855b922ed93641ccd53947a07b4b50fffd..58fab442478ac0c38bf30233b4e2f4b326c61da5 100644 (file)
@@ -1,14 +1,13 @@
 #
 #  over-ride password set in radiusd.conf
 #
-update control {
-       &Password.Cleartext -= 'hello'
-       &Password.With-Header := 'oracle01'
+&control -= {
+       &Password.Cleartext == 'hello'
 }
 
+&control.Password.With-Header := 'oracle01'
+
 #
 #  Set CHAP-Password
 #
-update request {
-       &CHAP-Password := "%(chap_password:%{request.CHAP-Password})"
-}
+&request.CHAP-Password := "%(chap_password:%{request.CHAP-Password})"
index 1decad59c5797214c28834a76fd00896f6da8e27..b40c918750343411fc4ac57479cd2ff2e5f5c364 100644 (file)
@@ -1,3 +1 @@
-update control {
-       &Password.Cleartext := &User-Name
-}
+&control.Password.Cleartext := &User-Name
index 1decad59c5797214c28834a76fd00896f6da8e27..b40c918750343411fc4ac57479cd2ff2e5f5c364 100644 (file)
@@ -1,3 +1 @@
-update control {
-       &Password.Cleartext := &User-Name
-}
+&control.Password.Cleartext := &User-Name
index 7d7d5e2ae7ebf74091985c5e1b147dd8ec3958b7..7919afda7d2e991625e914a359d9f3be329906ea 100644 (file)
@@ -1,3 +1 @@
-update control {
-       &Password.Cleartext := "zanzibar"
-}
+&control.Password.Cleartext := "zanzibar"
index 1e8c0d43eae4930ffaeb39aa0db443e80fef020d..a0c540e60bb3c6bec5f298b2473f4777ea8e0aa0 100644 (file)
@@ -1,7 +1,5 @@
 #
 #  over-ride password set in radiusd.conf
 #
-update control {
-       &Password.Cleartext -= ANY
-       &Password.With-Header := '{md5}5d41402abc4b2a76b9719d911017c592'
-}
+&control -= &Password.Cleartext[*]
+&control.Password.With-Header := '{md5}5d41402abc4b2a76b9719d911017c592'
index 02f1e4de69ad245e1f196885d735e5265b03060e..678fec7079bff400f07f5f602232b37e6e325185 100644 (file)
@@ -1,7 +1,8 @@
 #
 #  over-ride password set in radiusd.conf
 #
-update control {
-       &Password.Cleartext -= 'hello'
-       &Password.With-Header := '{clear}hello'
+&control -= {
+       &Password.Cleartext == 'hello'
 }
+
+&control.Password.With-Header := '{clear}hello'
index 6fe3abebb0912e2f5760d656364c3bc4f1714464..db814b612c32c3ed8e0a493c4215adfcf9ff7c9c 100644 (file)
@@ -1,7 +1,8 @@
 #
 #  over-ride password set in radiusd.conf
 #
-update control {
-       &Password.Cleartext -= 'hello'
-       &Password.With-Header := 'hello'
+&control -= {
+       &Password.Cleartext == 'hello'
 }
+
+&control.Password.With-Header := 'hello'
index b103cc095990c8a5f732ee55784be9ecaed4351b..4eaebaaacacdeb33a96237c768b76a0a0164020c 100644 (file)
@@ -31,9 +31,7 @@ server default {
        }
 
        recv Access-Request {
-               update control {
-                       &Password.Cleartext := 'hello'
-               }
+               &control.Password.Cleartext := 'hello'
 
                #
                # Include the test file specified by the
index a734581aa32b22c071c371f4ae74a309486d2cfb..4161b9cb1544747194c203b2f947ebe79d5db398 100644 (file)
@@ -16,9 +16,7 @@ server default {
        }
 
        recv Access-Request {
-               update control {
-                       &Auth-Type := accept
-               }
+               &control.Auth-Type := accept
        }
 
        recv CoA-Request {
index 3f9e7ac1a172e3ed1cc0cd2033cd8419410faeed..a4f744d3ae41172ebf81d18f90c4c5f6be4b2071 100644 (file)
@@ -32,9 +32,7 @@ security {
 policy {
        files.authorize {
                if (&User-Name == "bob") {
-                       update control {
-                               &Password.Cleartext := "bob"
-                       }
+                       &control.Password.Cleartext := "bob"
                }
        }
        $INCLUDE ${maindir}/policy.d/
@@ -147,31 +145,20 @@ recv Access-Request {
                #
                if (&Digest-Response) {
                        if (&Vendor-Specific.Test.Test-Number == "1") {
-                               update control {
-                                       &Password.Cleartext := "zanzibar"
-                               }
+                               &control.Password.Cleartext := "zanzibar"
                        }
                        elsif (&Vendor-Specific.Test.Test-Number == "2") {
-                               update control {
-                                       &Digest-Attributes.HA1 := 12af60467a33e8518da5c68bbff12b11
-                               }
+                               &control.Digest-Attributes.HA1 := 12af60467a33e8518da5c68bbff12b11
                        }
                }
                else {
-                       update control {
-                               &Password.Cleartext := "bob"
-                       }
+                       &control.Password.Cleartext := "bob"
                }
        }
 
        if (&User-Name =~ /^(.*)@test\.example\.com$/) {
-               update request {
-                       &Stripped-User-Name := "%{1}"
-               }
-
-               update control {
-                       &Password.Cleartext := "bob"
-               }
+               &Stripped-User-Name := "%{1}"
+               &control.Password.Cleartext := "bob"
        }
 
        chap
index f77c8c71a4d464652fae475ab502fe3d22d3e454..a7580d9f5ba5959b9908d9f6ee21ebed1d903d3c 100644 (file)
@@ -8,12 +8,8 @@ server eap-aka-prime {
        recv Identity-Response {
                "%(debug_attr:&session-state.)"
                if (!&session-state.Tmp-String-0) {
-                       update reply {
-                               &Any-ID-Req := yes
-                       }
-                       update session-state {
-                               &Tmp-String-0 := yes
-                       }
+                       &reply.Any-ID-Req := yes
+                       &session-state.Tmp-String-0 := yes
                }
                ok
        }
@@ -23,22 +19,18 @@ server eap-aka-prime {
        }
 
        send Challenge-Request {
-                update control {
-                        &Sim-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
-                        &Sim-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
-                        &Sim-SQN := 3
-                }
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+                &control.SIM-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
+                &control.SIM-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
+                &control.SIM-SQN := 3
+
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
        }
 
        send Reauthentication-Request {
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
+
                ok
        }
 
index bc66dd01de8d61853a8bc7f7e2e1b4317b6fcfbf..c5d03e6202e21b8ff0a161f6e6e9fe7db6cd8b42 100644 (file)
@@ -9,12 +9,8 @@ server eap-aka {
        recv Identity-Response {
                "%(debug_attr:&session-state.)"
                if (!&session-state.Tmp-String-0) {
-                       update reply {
-                               &Any-ID-Req := yes
-                       }
-                       update session-state {
-                               &Tmp-String-0 := yes
-                       }
+                       &reply.Any-ID-Req := yes
+                       &session-state.Tmp-String-0 := yes
                }
                ok
        }
@@ -24,22 +20,18 @@ server eap-aka {
        }
 
        send Challenge-Request {
-                update control {
-                        &Sim-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
-                        &Sim-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
-                        &Sim-SQN := 3
-                }
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+                &control.SIM-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
+                &control.SIM-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
+                &control.SIM-SQN := 3
+
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
        }
 
        send Reauthentication-Request {
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
+
                ok
        }
 
index d8b807eb61a5f7b9eef0a6c4ee29606310dfb2f9..6513acd7d764d6b7f8c08c269a3fbe56390ec152 100644 (file)
@@ -108,9 +108,7 @@ policy {
        files.authorize {
                split_username_nai
                if (&Stripped-User-Name == "bob") {
-                       update control {
-                               &Password.Cleartext := "bob"
-                       }
+                       &control.Password.Cleartext := "bob"
                }
        }
 
@@ -135,9 +133,7 @@ server test {
 
        recv Access-Request {
                if (&User-Name =~ /with.*client.*cert/) {
-                       update control {
-                               &EAP-TLS-Require-Client-Cert := yes
-                       }
+                       &control.EAP-TLS-Require-Client-Cert := yes
                }
                files
                eap
index 75aa6bc83dc4c3d18911527a5f267201b388255d..8028affe7f3cb9feac6c90fdab3a8a5762636220 100644 (file)
@@ -4,12 +4,8 @@ server eap-sim {
        recv Identity-Response {
                "%(debug_attr:&session-state.)"
                if (!&session-state.Tmp-String-0) {
-                       update reply {
-                               &Any-ID-Req := yes
-                       }
-                       update session-state {
-                               &Tmp-String-0 := yes
-                       }
+                       &reply.Any-ID-Req := yes
+                       &session-state.Tmp-String-0 := yes
                }
                ok
        }
@@ -19,23 +15,20 @@ server eap-sim {
        }
 
        send Challenge-Request {
-                update control {
-                        &Sim-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
-                        &Sim-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
-                        &Sim-SQN := 3
-                }
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+                &control.SIM-Ki  := 0x465b5ce8b199b49faa5f0a2ee238a6bc
+                &control.SIM-Opc := 0xcd63cb71954a9f4e48a5994e37a02baf
+                &control.SIM-SQN := 3
+
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
+
                ok
        }
 
        send Reauthentication-Request {
-               update reply {
-                       &Encr-Data.Next-Reauth-Id := ""
-                       &Encr-Data.Next-Pseudonym := ""
-               }
+               &reply.Encr-Data.Next-Reauth-Id := ""
+               &reply.Encr-Data.Next-Pseudonym := ""
+
                ok
        }
 
index d975a806d0a00be8634f56b28589cfd5d9031cb4..e7f5d988041b44f7797cbc4899e8a8cd9ba1eb45 100644 (file)
@@ -2,9 +2,8 @@ server eap-tls-test {
        namespace = tls
 
        load session {
-               update control {
-                       &control.Cache-Allow-Insert := no
-               }
+               &control.Cache-Allow-Insert := no
+
                cache_tls_session
        }
 
@@ -13,11 +12,10 @@ server eap-tls-test {
        }
 
        clear session {
-               update control {
-                       &control.Cache-Allow-Insert := no
-                       &control.Cache-Allow-Merge := no
-                       &control.Cache-TTL := 0
-               }
+               &control.Cache-Allow-Insert := no
+               &control.Cache-Allow-Merge := no
+               &control.Cache-TTL := 0
+
                cache_tls_session
        }
 
index 78447fd0ea968e558ed353467cb7d8ec1e60215a..039473a26a3599fe5713d460a2af4efab6417ba7 100644 (file)
@@ -44,9 +44,7 @@ server default {
                secret = testing123
        }
        recv Access-Request {
-               update control {
-                       &Auth-Type := Accept
-               }
+               &control.Auth-Type := Accept
        }
        send Access-Accept {
        }
index e5dab434b8a3949aa9fcf7ae999f6ea7146c9d2b..9eff94dbc0f3370baaa0de5289a195de21fc9f1b 100644 (file)
@@ -45,9 +45,7 @@ server default {
        }
 
        recv Access-Request {
-               update control {
-                       &Auth-Type := proxy
-               }
+               &control.Auth-Type := proxy
        }
        authenticate proxy {
                radius_auth
@@ -59,9 +57,7 @@ server default {
 
        recv Accounting-Request {
                if (!&Event-Timestamp) {
-                       update request {
-                               &Event-Timestamp := "%l"
-                       }
+                       &Event-Timestamp = "%l" # only sets it if there's no Event-Timestamp
                }
                radius_acct
        }
index 3bcf6e3141507fef47107a82c39be4f52b590f13..4daf7f6866bae8c6924d2cdfd19cd18935057ef3 100644 (file)
@@ -32,9 +32,7 @@ security {
 policy {
        files.authorize {
                if (&User-Name == "bob") {
-                       update control {
-                               &Password.Cleartext := "bob"
-                       }
+                       &control.Password.Cleartext := "bob"
                }
        }
        $INCLUDE ${maindir}/policy.d/
@@ -112,13 +110,10 @@ server test {
                #  Ensure that we can send unknown attributes back.
                #
                if (&NAS-Identifier == "auth_4") {
-                       update reply {
-                               &Class := 0x483d342c493d34
-                       }
-
-                       update reply {
-                               &raw.26 := &reply.Class
-                               &raw.26 += 0x483d342c493d43
+                       &reply.Class := 0x483d342c493d34
+                       &reply += {
+                               &raw.26 = &reply.Class
+                               &raw.26 = 0x483d342c493d43
                        }
                }
 
index 8b2e5afdf2f5043d3b0644bf4236b723bcf340e1..38b057b4d484dd3326aae0f9c6a244a96cc8442f 100644 (file)
@@ -32,9 +32,7 @@ security {
 policy {
        files.authorize {
                if (&User-Name == "bob") {
-                       update control {
-                               &Password.Cleartext := "bob"
-                       }
+                       &control.Password.Cleartext := "bob"
                }
        }
        $INCLUDE ${maindir}/policy.d/
@@ -115,68 +113,53 @@ server test {
 
        recv Authentication-Start {
                if (&User-Name == "tapioca") {
-                       update reply {
-                               &Authentication-Status := Pass
-                               &Server-Message := "Authentication-Start accepted"
-                       }
+                       &reply.Authentication-Status := Pass
+                       &reply.Server-Message := "Authentication-Start accepted"
+
                        ok
 
                } else {
-                       update reply {
-                               &Authentication-Status := Fail
-                               &Server-Message := "Authentication-Start failed for %{User-Name}"
-                       }
+                       &reply.Authentication-Status := Fail
+                       &reply.Server-Message := "Authentication-Start failed for %{User-Name}"
                }
        }
 
        send Authentication-Start-Reply {
-               update reply {
-                       &Data := "Authentication-Data"
-               }
+               &reply.Data := "Authentication-Data"
        }
 
        recv Authentication-Continue {
                if (&User-Name == "tapioca") {
-                       update reply {
-                               &Authentication-Status := Pass
-                               &Server-Message := "Authentication-Cont accepted"
-                       }
+                       &reply.Authentication-Status := Pass
+                       &reply.Server-Message := "Authentication-Cont accepted"
+
                        ok
 
                } else {
-                       update reply {
-                               &Authentication-Status := Fail
-                               &Server-Message := "Authentication-Cont failed for %{User-Name}"
-                       }
+                       &reply.Authentication-Status := Fail
+                       &reply.Server-Message := "Authentication-Cont failed for %{User-Name}"
                }
        }
 
        send Authentication-Continue-Reply {
-               update reply {
-                       &Data := "Authentication-Data"
-               }
+               &reply.Data := "Authentication-Data"
        }
 
        recv Authorization-Request {
                if (&User-Name == "tapioca") {
-                       update reply {
-                               &Authorization-Status := Pass-Add
-                               &Server-Message := "Authorization-Request accepted"
-                       }
+                       &reply.Authorization-Status := Pass-Add
+                       &reply.Server-Message := "Authorization-Request accepted"
+
                        ok
 
                } else {
-                       update reply {
-                               &Authorization-Status := Error
-                               &Server-Message := "Authorization-Request failed for %{User-Name}"
-                       }
+                       &reply.Authorization-Status := Error
+                       &reply.Server-Message := "Authorization-Request failed for %{User-Name}"
                }
        }
 
        send Authorization-Response {
-               update reply {
-                       &Data := "Authorization-Data"
-               }
+               &reply.Data := "Authorization-Data"
        }
 
        recv Accounting-Request {
@@ -188,29 +171,21 @@ server test {
 
        #       First packet for a session
        accounting Start {
-               update reply {
-                       &Server-Message := "Accounting-Start Section"
-               }
+               &reply.Server-Message := "Accounting-Start Section"
        }
 
        #       Updates a session
        accounting Watchdog {
-               update reply {
-                       &Server-Message := "Accounting-Watchdog Section"
-               }
+               &reply.Server-Message := "Accounting-Watchdog Section"
        }
 
        #       Stops a session
        accounting Stop {
-               update reply {
-                       &Server-Message := "Accounting-Stop Section"
-               }
+               &reply.Server-Message := "Accounting-Stop Section"
        }
 
        send Accounting-Reply {
-               update reply {
-                       &Accounting-Status := Success
-                       &Data := 0x12
-               }
+               &reply.Accounting-Status := Success
+               &reply.Data := 0x12
        }
 }
index 611807789420c9c17039ec8c5ef4f9cacc176a24..668b701da8addb9cf889f07b231ee25d54c136eb 100644 (file)
@@ -99,22 +99,16 @@ server vmps {
                #       Validate reply
                #
                if ("%{VLAN-Name}" == "Kalos0") {
-                       update reply {
-                               &Error-Code := No-Error
-                       }
+                       &reply.Error-Code := No-Error
                } else {
-                       update reply {
-                               &Error-Code := Deny
-                       }
+                       &reply.Error-Code := Deny
                }
        }
 
        send Join-Response {
-               update reply {
-                       &Packet-Type = Join-Response
-                       &Cookie = &MAC-Address
-                       &VLAN-Name := &VLAN-Name
-               }
+               &reply.Packet-Type = Join-Response
+               &reply.Cookie = &MAC-Address
+               &reply.VLAN-Name := &VLAN-Name
        }
 
        recv Reconfirm-Request {
index c17c7934173591e5c4d476a45da64c532674f8db..03bd37fda18a75bf7755b1498ee23da7d5401903 100644 (file)
@@ -29,9 +29,7 @@ server default {
        }
 
        recv Access-Request {
-               update control {
-                       &Password.Cleartext := 'hello'
-               }
+               &control.Password.Cleartext := 'hello'
 
                pap
        }