]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
run the accounting "post-auth" query for sql_session_start
authorAlan T. DeKok <aland@freeradius.org>
Thu, 9 Feb 2023 15:49:15 +0000 (10:49 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 9 Feb 2023 15:51:22 +0000 (10:51 -0500)
Which should make it work again.  However, it's not a good idea
to have admins mangle the default queries.  We should have a
better way of "just doing the right thing"

raddb/mods-config/sql/main/mssql/queries.conf
raddb/mods-config/sql/main/mysql/queries.conf
raddb/mods-config/sql/main/oracle/queries.conf
raddb/mods-config/sql/main/postgresql/queries.conf
raddb/mods-config/sql/main/sqlite/queries.conf
raddb/policy.d/accounting
share/dictionary.freeradius.internal

index 1978463a8e6d9c790c7e56a3b296b275179456d1..c0e8fef8b7f58b6d608da42abaaf3c5343f548a8 100644 (file)
@@ -175,7 +175,7 @@ simul_verify_query = "\
 # combination of attributes, or custom 'Acct-Status-Type' values.
 #######################################################################
 accounting {
-       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}"
+       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Acct-Session-Query}}.query}"
 
        # Write SQL queries to a logfile. This is potentially useful for bulk inserts
        # when used with the rlm_sql_null driver.
index e7c97822db886d798aca7ee861c314a02e7d7088..44e83980ac2c00aad5977585b5326381486591a9 100644 (file)
@@ -1,4 +1,4 @@
-# -*- text -*-
+ -*- text -*-
 #
 #  main/mysql/queries.conf-- MySQL configuration for default schema (schema.sql)
 #
@@ -265,7 +265,7 @@ simul_verify_query = "\
 # combination of attributes, or custom 'Acct-Status-Type' values.
 #######################################################################
 accounting {
-       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}"
+       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Acct-Session-Query}}.query}"
 
        # Write SQL queries to a logfile. This is potentially useful for bulk inserts
        # when used with the rlm_sql_null driver.
index 58c3ba88bc09f27dc60ae6e1829fca6bceb69de0..5a033481609015f1e097ba91710906176dc31c4c 100644 (file)
@@ -225,7 +225,7 @@ group_membership_query = "\
 # combination of attributes, or custom 'Acct-Status-Type' values.
 #######################################################################
 accounting {
-       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}"
+       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Acct-Session-Query}}.query}"
 
        # Write SQL queries to a logfile. This is potentially useful for bulk inserts
        # when used with the rlm_sql_null driver.
index 18a1ed0b6424c8916c9da9673a8560ea2527d4c6..0a1df59ec42ecbf471a994c0f167aa39d4dae4f1 100644 (file)
@@ -282,7 +282,7 @@ group_membership_query = "\
 #######################################################################
 
 accounting {
-       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}"
+       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Acct-Session-Query}}.query}"
 
        # Write SQL queries to a logfile. This is potentially useful for bulk inserts
        # when used with the rlm_sql_null driver.
index 35016f42f9d15f18cf90dd08a03492b671262259..216d8058037398e04f147bd1547ef57a503e102e 100644 (file)
@@ -242,7 +242,7 @@ simul_verify_query = "\
 # combination of attributes, or custom 'Acct-Status-Type' values.
 #######################################################################
 accounting {
-       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}"
+       reference = "%{tolower:type.%{%{Acct-Status-Type}:-%{Acct-Session-Query}}.query}"
 
        # Write SQL queries to a logfile. This is potentially useful for bulk inserts
        # when used with the rlm_sql_null driver.
index 7c52637d11dd04f6b229fd26bcbc923436fd2f74..61ca2b683d22f92be870af239571badb94ee97dd 100644 (file)
@@ -122,13 +122,12 @@ acct_counters64.preacct {
 #  the session information.
 #
 sql_session_start.post-auth {
-       acct_unique
-
        #
        #  The SQL accounting queries need an Acct-Status-Type attribute
        #
        update request {
-               Acct-Status-Type := Start
+               &Acct-Session-Query := "post-auth"
+               &Acct-Status-Type := Start
        }
        sql.accounting
 }
index bc6008ccfad76403c937ab861f534d68a7b43714..0cdf205474be5010067173e3d33f854eb9683bb2 100644 (file)
@@ -253,6 +253,11 @@ ATTRIBUTE  FreeRADIUS-Client-Src-IP-Address        1153    ipaddr
 ATTRIBUTE      FreeRADIUS-Client-Src-IPv6-Address      1154    ipv6addr
 ATTRIBUTE      FreeRADIUS-Response-Delay-USec          1155    integer
 
+#
+# For sql_session_start policy
+#
+ATTRIBUTE      Acct-Session-Query                      1156    string
+
 ATTRIBUTE      REST-HTTP-Header                        1160    string
 ATTRIBUTE      REST-HTTP-Body                          1161    string
 ATTRIBUTE      REST-HTTP-Status-Code                   1162    integer