From 44eafeee62e6982131c62df6f74335114ca53024 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 26 Aug 2024 12:41:52 +0200 Subject: Adding upstream version 3.2.5+dfsg. Signed-off-by: Daniel Baumann --- raddb/mods-config/sql/counter/sqlite/dailycounter.conf | 2 +- raddb/mods-config/sql/counter/sqlite/expire_on_login.conf | 2 +- raddb/mods-config/sql/counter/sqlite/monthlycounter.conf | 2 +- raddb/mods-config/sql/counter/sqlite/weeklycounter.conf | 2 +- raddb/mods-config/sql/cui/mysql/schema.sql | 2 +- raddb/mods-config/sql/dhcp/mysql/queries.conf | 2 +- raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql | 2 +- raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql | 2 +- raddb/mods-config/sql/ippool/mongo/queries.conf | 12 ------------ raddb/mods-config/sql/ippool/oracle/queries.conf | 5 ----- raddb/mods-config/sql/ippool/sqlite/schema.sql | 2 +- raddb/mods-config/sql/main/mongo/queries.conf | 10 +++++----- raddb/mods-config/sql/main/mssql/queries.conf | 2 +- raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql | 2 +- raddb/mods-config/sql/main/mysql/process-radacct.sql | 2 +- raddb/mods-config/sql/main/postgresql/queries.conf | 2 +- raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql | 2 +- 17 files changed, 19 insertions(+), 36 deletions(-) (limited to 'raddb/mods-config/sql') diff --git a/raddb/mods-config/sql/counter/sqlite/dailycounter.conf b/raddb/mods-config/sql/counter/sqlite/dailycounter.conf index 9a2ec38..b95afdf 100644 --- a/raddb/mods-config/sql/counter/sqlite/dailycounter.conf +++ b/raddb/mods-config/sql/counter/sqlite/dailycounter.conf @@ -5,7 +5,7 @@ # below # query = "\ - SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \ + SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \ FROM radacct \ WHERE username = '%{${key}}' \ AND (strftime('%%s', acctstarttime) + acctsessiontime) > %%b" diff --git a/raddb/mods-config/sql/counter/sqlite/expire_on_login.conf b/raddb/mods-config/sql/counter/sqlite/expire_on_login.conf index f4e95a5..6c1c086 100644 --- a/raddb/mods-config/sql/counter/sqlite/expire_on_login.conf +++ b/raddb/mods-config/sql/counter/sqlite/expire_on_login.conf @@ -1,5 +1,5 @@ query = "\ - SELECT GREATEST(strftime('%%s', NOW()) - strftime('%%s', acctstarttime), 0) AS expires \ + SELECT MAX(strftime('%%s', NOW()) - strftime('%%s', acctstarttime), 0) AS expires \ FROM radacct \ WHERE username = '%{${key}}' \ ORDER BY acctstarttime \ diff --git a/raddb/mods-config/sql/counter/sqlite/monthlycounter.conf b/raddb/mods-config/sql/counter/sqlite/monthlycounter.conf index 5262097..3f5d427 100644 --- a/raddb/mods-config/sql/counter/sqlite/monthlycounter.conf +++ b/raddb/mods-config/sql/counter/sqlite/monthlycounter.conf @@ -5,7 +5,7 @@ # below # query = "\ - SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \ + SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \ FROM radacct \ WHERE username = '%{${key}}' AND \ (strftime('%%s', acctstarttime) + acctsessiontime) > %%b" diff --git a/raddb/mods-config/sql/counter/sqlite/weeklycounter.conf b/raddb/mods-config/sql/counter/sqlite/weeklycounter.conf index 06ce3b6..90a8566 100644 --- a/raddb/mods-config/sql/counter/sqlite/weeklycounter.conf +++ b/raddb/mods-config/sql/counter/sqlite/weeklycounter.conf @@ -5,7 +5,7 @@ # below # query = "\ - SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \ + SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \ FROM radacct \ WHERE username = '%{${key}}' \ AND (strftime('%%s', acctstarttime) + acctsessiontime) > %%b" diff --git a/raddb/mods-config/sql/cui/mysql/schema.sql b/raddb/mods-config/sql/cui/mysql/schema.sql index da9b2f7..01cc615 100644 --- a/raddb/mods-config/sql/cui/mysql/schema.sql +++ b/raddb/mods-config/sql/cui/mysql/schema.sql @@ -1,4 +1,4 @@ -CREATE TABLE `cui` ( +CREATE TABLE IF NOT EXISTS `cui` ( `clientipaddress` varchar(46) NOT NULL default '', `callingstationid` varchar(50) NOT NULL default '', `username` varchar(64) NOT NULL default '', diff --git a/raddb/mods-config/sql/dhcp/mysql/queries.conf b/raddb/mods-config/sql/dhcp/mysql/queries.conf index a28037b..b0254e5 100644 --- a/raddb/mods-config/sql/dhcp/mysql/queries.conf +++ b/raddb/mods-config/sql/dhcp/mysql/queries.conf @@ -69,7 +69,7 @@ authorize_group_reply_query = "\ ORDER BY id" group_membership_query = "\ - SELECT groupnme \ + SELECT groupname \ FROM ${dhcpgroup_table} \ WHERE identifier='%{SQL-User-Name}' AND context = '%{control:DHCP-SQL-Option-Context}' \ ORDER BY priority" diff --git a/raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql b/raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql index d8b1219..f996ba3 100644 --- a/raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql +++ b/raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql @@ -5,7 +5,7 @@ -- that is much faster. -- -CREATE TABLE dhcpippool ( +CREATE TABLE IF NOT EXISTS dhcpippool ( id int unsigned NOT NULL auto_increment, pool_name varchar(30) NOT NULL, framedipaddress varchar(15) NOT NULL default '', diff --git a/raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql b/raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql index 339d58d..f7af667 100644 --- a/raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql +++ b/raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql @@ -9,7 +9,7 @@ CREATE TABLE dhcpstatus ( INSERT INTO dhcpstatus (status_id, status) VALUES (1, 'dynamic'), (2, 'static'), (3, 'declined'), (4, 'disabled'); CREATE TABLE dhcpippool ( - id int(11) PRIMARY KEY, + id INTEGER PRIMARY KEY, pool_name varchar(30) NOT NULL, framedipaddress varchar(15) NOT NULL default '', pool_key varchar(30) NOT NULL default '', diff --git a/raddb/mods-config/sql/ippool/mongo/queries.conf b/raddb/mods-config/sql/ippool/mongo/queries.conf index 9d7d070..eedf0a0 100644 --- a/raddb/mods-config/sql/ippool/mongo/queries.conf +++ b/raddb/mods-config/sql/ippool/mongo/queries.conf @@ -22,12 +22,6 @@ # parser. # -# -# TBD -# -on_begin = "" -off_begin = "" - allocate_begin = "" # @@ -92,17 +86,11 @@ allocate_clear = "db.mypool_collection.findAndModify( \ allocate_commit = "" -start_begin = "" start_update = "" -start_commit = "" -stop_begin = "" stop_clear = "" -stop_commit = "" -alive_begin = "" alive_update = "" -alive_commit = "" on_clear = "" off_clear = "" diff --git a/raddb/mods-config/sql/ippool/oracle/queries.conf b/raddb/mods-config/sql/ippool/oracle/queries.conf index 1a64b28..9704f56 100644 --- a/raddb/mods-config/sql/ippool/oracle/queries.conf +++ b/raddb/mods-config/sql/ippool/oracle/queries.conf @@ -13,11 +13,6 @@ skip_locked = "" allocate_begin = "commit" -start_begin = "commit" -alive_begin = "commit" -stop_begin = "commit" -on_begin = "commit" -off_begin = "commit" # # Attempt to allocate the address a client previously had. This is based on pool_key diff --git a/raddb/mods-config/sql/ippool/sqlite/schema.sql b/raddb/mods-config/sql/ippool/sqlite/schema.sql index b020c62..4dc25d1 100644 --- a/raddb/mods-config/sql/ippool/sqlite/schema.sql +++ b/raddb/mods-config/sql/ippool/sqlite/schema.sql @@ -2,7 +2,7 @@ -- Table structure for table 'radippool' -- CREATE TABLE radippool ( - id int(11) PRIMARY KEY, + id INTEGER PRIMARY KEY, pool_name varchar(30) NOT NULL, framedipaddress varchar(15) NOT NULL default '', nasipaddress varchar(15) NOT NULL default '', diff --git a/raddb/mods-config/sql/main/mongo/queries.conf b/raddb/mods-config/sql/main/mongo/queries.conf index 732e1e8..a496932 100644 --- a/raddb/mods-config/sql/main/mongo/queries.conf +++ b/raddb/mods-config/sql/main/mongo/queries.conf @@ -91,7 +91,7 @@ authorize_check_query = "db.${authcheck_table}.aggregate([ \ 'op': ':=' \ } \ } \ -])" \ +])" # TBD: fill in things here authorize_reply_query = "" @@ -150,7 +150,7 @@ accounting { }, \ '$push': { \ 'events_data': { \ - 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \ + 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \ 'event_type': 'Accounting-Start', \ 'event_time': '%{Packet-Original-Timestamp}', \ 'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \ @@ -202,7 +202,7 @@ accounting { }, \ '$push': { \ 'events_data': { \ - 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \ + 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \ 'event_type': 'Accounting-Interim-Update', \ 'event_time': '%{Packet-Original-Timestamp}', \ 'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \ @@ -214,7 +214,7 @@ accounting { 'closed': false, \ 'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \ } \ - }, + }, \ 'upsert': true \ })" # End Interim-Update @@ -235,7 +235,7 @@ accounting { }, \ '$push': { \ 'events_data': { \ - 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \ + 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \ 'event_type': 'Accounting-Stop', \ 'event_time': '%{Packet-Original-Timestamp}', \ 'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \ diff --git a/raddb/mods-config/sql/main/mssql/queries.conf b/raddb/mods-config/sql/main/mssql/queries.conf index 1978463..d83a27d 100644 --- a/raddb/mods-config/sql/main/mssql/queries.conf +++ b/raddb/mods-config/sql/main/mssql/queries.conf @@ -373,7 +373,7 @@ accounting { UPDATE ${....acct_table1} \ SET \ AcctStartTime = ${....event_timestamp}, \ - AcctUpdateTime = ${....event_timestamp }, \ + AcctUpdateTime = ${....event_timestamp}, \ AcctStartDelay = '%{%{Acct-Delay-Time}:-0}', \ ConnectInfo_start = '%{Connect-Info}' \ WHERE AcctUniqueId = '%{Acct-Unique-Session-ID}' \ diff --git a/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql b/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql index e32224a..bc2e7da 100644 --- a/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql +++ b/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql @@ -3,7 +3,7 @@ # which replaces the "radpostauth" table. # -CREATE TABLE wimax ( +CREATE TABLE IF NOT EXISTS wimax ( id int(11) NOT NULL auto_increment, username varchar(64) NOT NULL default '', authdate timestamp NOT NULL, diff --git a/raddb/mods-config/sql/main/mysql/process-radacct.sql b/raddb/mods-config/sql/main/mysql/process-radacct.sql index 8902338..0696603 100644 --- a/raddb/mods-config/sql/main/mysql/process-radacct.sql +++ b/raddb/mods-config/sql/main/mysql/process-radacct.sql @@ -45,7 +45,7 @@ -- +----------------+----------------+-----------------+ -- 7 rows in set (0.000 sec) -- -CREATE TABLE data_usage_by_period ( +CREATE TABLE IF NOT EXISTS data_usage_by_period ( username VARCHAR(64), period_start DATETIME, period_end DATETIME, diff --git a/raddb/mods-config/sql/main/postgresql/queries.conf b/raddb/mods-config/sql/main/postgresql/queries.conf index 18a1ed0..80953e0 100644 --- a/raddb/mods-config/sql/main/postgresql/queries.conf +++ b/raddb/mods-config/sql/main/postgresql/queries.conf @@ -534,7 +534,7 @@ accounting { '%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}', \ NULLIF('%{%{NAS-Port-ID}:-%{NAS-Port}}', ''), \ '%{NAS-Port-Type}', \ - ${....event_timestamp}, \ + TO_TIMESTAMP(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \ ${....event_timestamp}, \ NULL, \ %{%{Acct-Session-Time}:-NULL}, \ diff --git a/raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql b/raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql index 8a33dc1..bca2ba8 100644 --- a/raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql +++ b/raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql @@ -1,4 +1,4 @@ -CREATE TABLE `moonshot_targeted_ids` ( +CREATE TABLE IF NOT EXISTS `moonshot_targeted_ids` ( `gss_acceptor` varchar(254) NOT NULL default '', `namespace` varchar(36) NOT NULL default '', `username` varchar(64) NOT NULL default '', -- cgit v1.2.3