From: Alan T. DeKok Date: Mon, 10 Mar 2025 01:23:28 +0000 (-0400) Subject: quote bare words in function arguments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4e4a8b2b6185380851862a5ef2e714f8046fd6;p=thirdparty%2Ffreeradius-server.git quote bare words in function arguments --- diff --git a/src/tests/modules/always/set_rcode.unlang b/src/tests/modules/always/set_rcode.unlang index 1a2eeabbfe..548a51e665 100644 --- a/src/tests/modules/always/set_rcode.unlang +++ b/src/tests/modules/always/set_rcode.unlang @@ -3,7 +3,7 @@ # if (%db_status('notfound') != "alive") { reply += { - Reply-Message = "Failure in test at line %interpreter(...line)" + Reply-Message = "Failure in test at line %interpreter('...line')" } } @@ -13,7 +13,7 @@ if (%db_status('notfound') != "alive") { db_status if (!notfound) { reply += { - Reply-Message = "Failure in test at line %interpreter(...line)" + Reply-Message = "Failure in test at line %interpreter('...line')" } } @@ -23,7 +23,7 @@ if (!notfound) { # if (%db_status() != "notfound") { reply += { - Reply-Message = "Failure in test at line %interpreter(...line)" + Reply-Message = "Failure in test at line %interpreter('...line')" } } diff --git a/src/tests/modules/always/set_status_revive.unlang b/src/tests/modules/always/set_status_revive.unlang index 13e6d24645..a86f98ece6 100644 --- a/src/tests/modules/always/set_status_revive.unlang +++ b/src/tests/modules/always/set_status_revive.unlang @@ -7,7 +7,7 @@ db_status { } if (!fail) { reply += { - Reply-Message = "Failure in test at line %interpreter(...line)" + Reply-Message = "Failure in test at line %interpreter('...line')" } } diff --git a/src/tests/modules/cipher/valid.unlang b/src/tests/modules/cipher/valid.unlang index f732b35183..a7a9ac70e4 100644 --- a/src/tests/modules/cipher/valid.unlang +++ b/src/tests/modules/cipher/valid.unlang @@ -1,8 +1,8 @@ date test_date1 date test_date2 -test_date1 := "%cipher_rsa.certificate(notBefore)" -test_date2 := "%cipher_rsa.certificate(notAfter)" +test_date1 := %cipher_rsa.certificate('notBefore') +test_date2 := %cipher_rsa.certificate('notAfter') # Check the cert validity period is 30 days if !((test_date2 - test_date1) == ((time_delta) (86400 * 60))) { diff --git a/src/tests/modules/dict/map.unlang b/src/tests/modules/dict/map.unlang index 01cd2025bc..15a7b935ef 100644 --- a/src/tests/modules/dict/map.unlang +++ b/src/tests/modules/dict/map.unlang @@ -2,25 +2,25 @@ Vendor-Specific.FreeRADIUS.Proxied-To := 127.0.0.1 Reply-Message := 'foo' -if (%dict.attr.by_num(1) != 'User-Name') { +if (%dict.attr.by_num('1') != 'User-Name') { test_fail } -if (%dict.attr.by_oid(1) != 'User-Name') { +if (%dict.attr.by_oid('1') != 'User-Name') { test_fail } # Should fail -if (%dict.attr.by_oid(26) != 'Vendor-Specific') { +if (%dict.attr.by_oid('26') != 'Vendor-Specific') { test_fail } # Should fail -if (%dict.attr.by_oid(26.11344) != 'FreeRADIUS') { +if (%dict.attr.by_oid('26.11344') != 'FreeRADIUS') { test_fail } -if (%dict.attr.by_oid(26.11344.1) != 'Proxied-To') { +if (%dict.attr.by_oid('26.11344.1') != 'Proxied-To') { test_fail } diff --git a/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang b/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang index 0a6d7cded6..08dbe06a4f 100644 --- a/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang +++ b/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang @@ -1,11 +1,11 @@ string test_string string result_string -if (%aka_sim_id_method("%{User-Name}") != 'AKA') { +if (%aka_sim_id_method(%{User-Name}) != 'AKA') { test_fail } -if (%aka_sim_id_type("%{User-Name}") != 'permanent') { +if (%aka_sim_id_type(%{User-Name}) != 'permanent') { test_fail } @@ -18,21 +18,21 @@ control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{test_string},6) # # 0.2 - Can we get the EAP method from the encrypted blob correctly? # -if (%aka_sim_id_method("%{control.User-Name}") != 'AKA') { +if (%aka_sim_id_method(%{control.User-Name}) != 'AKA') { test_fail } # # 0.3 - Can we identify the encrypted blob correctly? # -if (%aka_sim_id_type("%{control.User-Name}") != 'pseudonym') { +if (%aka_sim_id_type(%{control.User-Name}) != 'pseudonym') { test_fail } # # 0.4 - We should refuse to re-encrypt an encrypted NAI # -if ("%3gpp_temporary_id_encrypt(%{control.User-Name},%{test_string},6)" != '') { +if (%3gpp_temporary_id_encrypt(%{control.User-Name}, %{test_string}, 6) != '') { test_fail } @@ -50,7 +50,7 @@ if (result_string != User-Name) { # if (User-Name =~ /^[0-9](.*)/) { request += { - User-Name = "%{1}" + User-Name = %{1} EAP-Type = ::AKA } } @@ -60,20 +60,20 @@ if (User-Name =~ /^[0-9](.*)/) { # test_string := '1420032219455259' control += { - User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},6) + User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]}, %{test_string}, 6) } # # 1.2 - Can we identify the encrypted blob correctly? # -if (%aka_sim_id_type("%{control.User-Name[1]}") != 'pseudonym') { +if (%aka_sim_id_type(%{control.User-Name[1]}) != 'pseudonym') { test_fail } # # 1.3 - We should refuse to re-encrypt an encrypted NAI # -if ("%3gpp_temporary_id_encrypt(%{control.User-Name[1]},%{test_string},6)" != '') { +if (%3gpp_temporary_id_encrypt(%{control.User-Name[1]},%{test_string},6) != '') { test_fail } @@ -91,27 +91,27 @@ if (result_string != "0%{User-Name[1]}") { # test_string := '1420032219455259' control += { - User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},6,fastauth) + User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{test_string},6,'fastauth') } # # 2.2 - Can we identify the encrypted blob correctly? # -if (%aka_sim_id_type("%{control.User-Name[2]}") != 'fastauth') { +if (%aka_sim_id_type(%{control.User-Name[2]}) != 'fastauth') { test_fail } # # 2.3 - We should refuse to re-encrypt an encrypted NAI # -if ("%3gpp_temporary_id_encrypt(%{control.User-Name[2]},%{test_string},6,fastauth)" != '') { +if (%3gpp_temporary_id_encrypt(%{control.User-Name[2]}, %{test_string}, 6, 'fastauth') != '') { test_fail } # # 2.4 - Get the original IMSI back again # -result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[2]},%{test_string}) +result_string := %3gpp_temporary_id_decrypt(%{control.User-Name[2]}, %{test_string}) if (result_string != "0%{User-Name[1]}") { test_fail diff --git a/src/tests/modules/json/regression03.unlang b/src/tests/modules/json/regression03.unlang index a826f478a2..7f36fead1c 100644 --- a/src/tests/modules/json/regression03.unlang +++ b/src/tests/modules/json/regression03.unlang @@ -1,5 +1,5 @@ # Verify parsing works correctly with an unquoted xlat -map json %test.passthrough("{ \"foo\":\"bar\" }",{}) { +map json %test.passthrough("{ \"foo\":\"bar\" }", '{}') { Filter-Id := '$.foo' } diff --git a/src/tests/modules/test/trigger.unlang b/src/tests/modules/test/trigger.unlang index e065cdc77f..26dedf1237 100644 --- a/src/tests/modules/test/trigger.unlang +++ b/src/tests/modules/test/trigger.unlang @@ -1,4 +1,4 @@ -if (%test_trigger(test) == false) { +if (%test_trigger('test') == false) { test_fail } diff --git a/src/tests/modules/unit_test_module.conf b/src/tests/modules/unit_test_module.conf index a77e87bb72..57d1d1986d 100644 --- a/src/tests/modules/unit_test_module.conf +++ b/src/tests/modules/unit_test_module.conf @@ -63,7 +63,7 @@ policy { test_fail { reply += { - Reply-Message = "Failure in test at line %interpreter(...line)" + Reply-Message = "Failure in test at line %interpreter('...line')" } reject } @@ -72,7 +72,7 @@ policy { # Outputs the contents of the control list in debugging (-X) mode # debug_control { - if("%debug_attr(control)" == '') { + if("%debug_attr('control')" == '') { noop } } @@ -81,7 +81,7 @@ policy { # Outputs the contents of the request list in debugging (-X) mode # debug_request { - if("%debug_attr(request)" == '') { + if("%debug_attr('request')" == '') { noop } } @@ -90,7 +90,7 @@ policy { # Outputs the contents of the reply list in debugging (-X) mode # debug_reply { - if("%debug_attr(reply)" == '') { + if("%debug_attr('reply')" == '') { noop } } @@ -99,7 +99,7 @@ policy { # Outputs the contents of the session state list in debugging (-X) mode # debug_session_state { - if("%debug_attr(session-state)" == '') { + if("%debug_attr('session-state')" == '') { noop } }