From: Alan T. DeKok Date: Sat, 30 Sep 2023 23:44:01 +0000 (-0400) Subject: Revert "move to new function syntax" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ff2c53e0424a715e01d39df050d755f65affa93;p=thirdparty%2Ffreeradius-server.git Revert "move to new function syntax" This reverts commit 8486d69f44cd6ac200617b103feb9a0d5c512fd0. rever this until we update alternation syntax, too. The parser keys off of %{ or %( for expansions, and does not like the new function syntax --- diff --git a/raddb/mods-config/perl/example.pl b/raddb/mods-config/perl/example.pl index 8412765af42..3fa1467467f 100644 --- a/raddb/mods-config/perl/example.pl +++ b/raddb/mods-config/perl/example.pl @@ -126,7 +126,7 @@ sub authenticate { return RLM_MODULE_REJECT; } else { # Accept user and set some attribute - if (&radiusd::xlat("%client(group)") eq 'UltraAllInclusive') { + if (&radiusd::xlat("%(client:group)") eq 'UltraAllInclusive') { # User called from NAS with unlim plan set, set higher limits $RAD_REPLY{'h323-credit-amount'} = "1000000"; } else { diff --git a/raddb/mods-config/sql/cui/mysql/queries.conf b/raddb/mods-config/sql/cui/mysql/queries.conf index 7e9ca48ae7d..ce53b4f8b3c 100644 --- a/raddb/mods-config/sql/cui/mysql/queries.conf +++ b/raddb/mods-config/sql/cui/mysql/queries.conf @@ -18,7 +18,7 @@ post-auth { } accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" type { start { query = "\ diff --git a/raddb/mods-config/sql/cui/postgresql/queries.conf b/raddb/mods-config/sql/cui/postgresql/queries.conf index cbad2385cb0..d2959e34a44 100644 --- a/raddb/mods-config/sql/cui/postgresql/queries.conf +++ b/raddb/mods-config/sql/cui/postgresql/queries.conf @@ -20,7 +20,7 @@ post-auth { } accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" type { start { query = "\ diff --git a/raddb/mods-config/sql/cui/sqlite/queries.conf b/raddb/mods-config/sql/cui/sqlite/queries.conf index 158af580e85..eff87b4f361 100644 --- a/raddb/mods-config/sql/cui/sqlite/queries.conf +++ b/raddb/mods-config/sql/cui/sqlite/queries.conf @@ -15,7 +15,7 @@ post-auth { } accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" type { start { query = "\ diff --git a/raddb/mods-config/sql/main/cassandra/queries.conf b/raddb/mods-config/sql/main/cassandra/queries.conf index 63dddb4eee4..f15d4d3f74a 100644 --- a/raddb/mods-config/sql/main/cassandra/queries.conf +++ b/raddb/mods-config/sql/main/cassandra/queries.conf @@ -49,12 +49,12 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. -event_timestamp = "%expr(${event_timestamp_epoch} * 1000)" +event_timestamp = "%{expr:${event_timestamp_epoch} * 1000}" ####################################################################### # Default profile @@ -143,7 +143,7 @@ authorize_group_reply_query = "\ # as INSERTS are really UPSERTS so we can work around it. ####################################################################### accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. @@ -231,7 +231,7 @@ accounting { acctstarttime \ ) VALUES ( \ '%{Acct-Unique-Session-Id}', \ - %expr((${....event_timestamp_epoch} - &Acct-Session-Time) * 1000) \ + %{expr:(${....event_timestamp_epoch} - &Acct-Session-Time) * 1000} \ ) IF NOT EXISTS; \ INSERT INTO ${....acct_table1} ( \ acctuniqueid, \ @@ -269,8 +269,8 @@ accounting { null, \ '%{Acct-Authentic}', \ '%{Connect-Info}', \ - %expr((&Acct-Input-Gigawords << 32) | &Acct-Input-Octets), \ - %expr((&Acct-Output-Gigawords << 32) | &Acct-Output-Octets), \ + %{expr:(&Acct-Input-Gigawords << 32) | &Acct-Input-Octets}, \ + %{expr:(&Acct-Output-Gigawords << 32) | &Acct-Output-Octets}, \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', \ '%{Service-Type}', \ @@ -293,7 +293,7 @@ accounting { acctstarttime \ ) VALUES ( \ '%{Acct-Unique-Session-Id}', \ - %expr((${....event_timestamp_epoch} - &Acct-Session-Time) * 1000) \ + %{expr:(${....event_timestamp_epoch} - &Acct-Session-Time) * 1000} \ ) IF NOT EXISTS; \ INSERT INTO ${....acct_table1} ( \ acctuniqueid, \ @@ -332,8 +332,8 @@ accounting { ${....event_timestamp}, \ '%{Acct-Authentic}', \ '%{Connect-Info}', \ - %expr((&Acct-Input-Gigawords << 32) | &Acct-Input-Octets), \ - %expr((&Acct-Output-Gigawords << 32) | &Acct-Output-Octets), \ + %{expr:(&Acct-Input-Gigawords << 32) | &Acct-Input-Octets}, \ + %{expr:(&Acct-Output-Gigawords << 32) | &Acct-Output-Octets}, \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', \ '%{Service-Type}', \ @@ -370,6 +370,6 @@ post-auth { '%{SQL-User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply.Packet-Type}', \ - '%expr(%l * 1000 + %M / 1000)', \ + '%{expr:%l * 1000 + %M / 1000}', \ '%{reply.Class}')" } diff --git a/raddb/mods-config/sql/main/mssql/queries.conf b/raddb/mods-config/sql/main/mssql/queries.conf index 6689c44431f..f17a5ead1da 100644 --- a/raddb/mods-config/sql/main/mssql/queries.conf +++ b/raddb/mods-config/sql/main/mssql/queries.conf @@ -38,7 +38,7 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. @@ -141,7 +141,7 @@ simul_verify_query = "\ # combination of attributes, or custom 'Acct-Status-Type' values. ####################################################################### accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. @@ -406,6 +406,6 @@ post-auth { '%{User-Name}', \ '%{%{User-Password}:-CHAP-PASSWORD}', \ '%{reply.Packet-Type}', \ - '%S.%expr(%M / 1000)', \ + '%S.%{expr:%M / 1000}', \ '%{reply.Class}')" } diff --git a/raddb/mods-config/sql/main/mysql/queries.conf b/raddb/mods-config/sql/main/mysql/queries.conf index a6a10342955..964ba800449 100644 --- a/raddb/mods-config/sql/main/mysql/queries.conf +++ b/raddb/mods-config/sql/main/mysql/queries.conf @@ -1,4 +1,4 @@ -]# -*- text -*- +# -*- text -*- # # main/mysql/queries.conf-- MySQL configuration for default schema (schema.sql) # @@ -49,7 +49,7 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. @@ -167,7 +167,7 @@ authorize_group_reply_query = "\ # combination of attributes, or custom 'Acct-Status-Type' values. ####################################################################### accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. diff --git a/raddb/mods-config/sql/main/oracle/queries.conf b/raddb/mods-config/sql/main/oracle/queries.conf index 66a6c19780f..df77a5718f9 100644 --- a/raddb/mods-config/sql/main/oracle/queries.conf +++ b/raddb/mods-config/sql/main/oracle/queries.conf @@ -33,7 +33,7 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. @@ -148,7 +148,7 @@ group_membership_query = "\ # combination of attributes, or custom 'Acct-Status-Type' values. ####################################################################### accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. diff --git a/raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf b/raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf index acf702ff3d4..c5cb4c38f04 100644 --- a/raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf +++ b/raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf @@ -25,7 +25,7 @@ sql_user_name = "%{User-Name}" accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. diff --git a/raddb/mods-config/sql/main/postgresql/queries.conf b/raddb/mods-config/sql/main/postgresql/queries.conf index ce82cab5724..9c5e6386d4c 100644 --- a/raddb/mods-config/sql/main/postgresql/queries.conf +++ b/raddb/mods-config/sql/main/postgresql/queries.conf @@ -39,7 +39,7 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. @@ -191,7 +191,7 @@ group_membership_query = "\ ####################################################################### accounting { - reference = "%tolower(type.%{%{Acct-Status-Type}:-none}.query)" + reference = "%{tolower:type.%{%{Acct-Status-Type}:-none}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver. diff --git a/raddb/mods-config/sql/main/sqlite/queries.conf b/raddb/mods-config/sql/main/sqlite/queries.conf index 2b3efb6de00..7f868c15791 100644 --- a/raddb/mods-config/sql/main/sqlite/queries.conf +++ b/raddb/mods-config/sql/main/sqlite/queries.conf @@ -38,7 +38,7 @@ sql_user_name = "%{User-Name}" # distrust the provided Event-Timestamp. #event_timestamp_epoch = "%l" -event_timestamp_epoch = "%{%integer(%{Event-Timestamp}):-%l}" +event_timestamp_epoch = "%{%(integer:%{Event-Timestamp}):-%l}" # event_timestamp is the SQL snippet for converting an epoch timestamp # to an SQL date. @@ -162,7 +162,7 @@ authorize_group_reply_query = "\ # combination of attributes, or custom 'Acct-Status-Type' values. ####################################################################### accounting { - reference = "%tolower(type.%{Acct-Status-Type}.query)" + reference = "%{tolower:type.%{Acct-Status-Type}.query}" # Write SQL queries to a logfile. This is potentially useful for bulk inserts # when used with the rlm_sql_null driver.