"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "raddb/mods-config/sql/main/sqlite/queries.conf" between
freeradius-server-3.0.22.tar.bz2 and freeradius-server-3.0.23.tar.bz2

About: FreeRADIUS Server Project - a high performance and highly configurable RADIUS server.

queries.conf  (freeradius-server-3.0.22.tar.bz2):queries.conf  (freeradius-server-3.0.23.tar.bz2)
skipping to change at line 54 skipping to change at line 54
# to an SQL date. # to an SQL date.
event_timestamp = "${event_timestamp_epoch}" event_timestamp = "${event_timestamp_epoch}"
# NOTE: Recent SQLite versions allow proper arithmetic with dates # NOTE: Recent SQLite versions allow proper arithmetic with dates
# stored as strings including comparison using an index, so we keep # stored as strings including comparison using an index, so we keep
# these variables differentiated in preparation for switching away from # these variables differentiated in preparation for switching away from
# integer storage. # integer storage.
####################################################################### #######################################################################
# Query config: Class attribute
#######################################################################
#
# 3.0.22 and later have a "class" column in the accounting table.
#
# However, we do NOT want to break existing configurations by adding
# the Class attribute to the default queries. If we did that, then
# systems using newer versions of the server would fail, because
# there is no "class" column in their accounting tables.
#
# The solution to that is the following "class" subsection. If your
# database has a "class" column for the various tables, then you can
# uncomment the configuration items here. The queries below will
# then automatically insert the Class attribute into radacct,
# radpostauth, etc.
#
class {
#
# Delete the '#' character from each of the configuration
# items in this section. This change puts the Class
# attribute into the various tables. Leave the double-quoted
# string there, as the value for the configuration item.
#
# See also policy.d/accounting, and the "insert_acct_class"
# policy. You will need to list (or uncomment)
# "insert_acct_class" in the "post-auth" section in order to
# create a Class attribute.
#
column_name = # ", class"
packet_xlat = # ", '%{Class}'"
reply_xlat = # ", '%{Reply:Class}'"
}
#######################################################################
# Default profile # Default profile
####################################################################### #######################################################################
# This is the default profile. It is found in SQL by group membership. # This is the default profile. It is found in SQL by group membership.
# That means that this profile must be a member of at least one group # That means that this profile must be a member of at least one group
# which will contain the corresponding check and reply items. # which will contain the corresponding check and reply items.
# This profile will be queried in the authorize section for every user. # This profile will be queried in the authorize section for every user.
# The point is to assign all users a default profile without having to # The point is to assign all users a default profile without having to
# manually add each one to a group that will contain the profile. # manually add each one to a group that will contain the profile.
# The SQL module will also honor the User-Profile attribute. This # The SQL module will also honor the User-Profile attribute. This
# attribute can be set anywhere in the authorize section (ie the users # attribute can be set anywhere in the authorize section (ie the users
skipping to change at line 239 skipping to change at line 273
acctoutputoctets, \ acctoutputoctets, \
calledstationid, \ calledstationid, \
callingstationid, \ callingstationid, \
acctterminatecause, \ acctterminatecause, \
servicetype, \ servicetype, \
framedprotocol, \ framedprotocol, \
framedipaddress, \ framedipaddress, \
framedipv6address, \ framedipv6address, \
framedipv6prefix, \ framedipv6prefix, \
framedinterfaceid, \ framedinterfaceid, \
delegatedipv6prefix" delegatedipv6prefix \
${..class.column_name}"
type { type {
accounting-on { accounting-on {
# #
# Bulk terminate all sessions associated with a given NA S # Bulk terminate all sessions associated with a given NA S
# #
query = "\ query = "\
UPDATE ${....acct_table1} \ UPDATE ${....acct_table1} \
SET \ SET \
acctstoptime = ${....event_timestamp}, \ acctstoptime = ${....event_timestamp}, \
skipping to change at line 263 skipping to change at line 298
acctterminatecause = '%{Acct-Terminate-Ca use}' \ acctterminatecause = '%{Acct-Terminate-Ca use}' \
WHERE acctstoptime IS NULL \ WHERE acctstoptime IS NULL \
AND nasipaddress = '%{NAS-IP-Address}' \ AND nasipaddress = '%{NAS-IP-Address}' \
AND acctstarttime <= ${....event_timestamp}" AND acctstarttime <= ${....event_timestamp}"
} }
accounting-off { accounting-off {
query = "${..accounting-on.query}" query = "${..accounting-on.query}"
} }
#
# Implement the "sql_session_start" policy.
# See raddb/policy.d/accounting for more details.
#
# You also need to fix the other queries as
# documented below. Look for "sql_session_start".
#
post-auth {
query = "\
INSERT INTO ${....acct_table1} \
(${...column_list}) \
VALUES(\
'%{Acct-Session-Id}', \
'%{Acct-Unique-Session-Id}', \
'%{SQL-User-Name}', \
'%{Realm}', \
'%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}', \
NULLIF('%{%{NAS-Port-ID}:-%{NAS-Port}}', ''), \
'%{NAS-Port-Type}', \
${....event_timestamp}, \
NULL, \
NULL, \
0, \
'', \
'%{Connect-Info}', \
NULL, \
0, \
0, \
'%{Called-Station-Id}', \
'%{Calling-Station-Id}', \
NULL, \
'%{Service-Type}', \
NULL, \
'', \
'', \
'', \
'', \
'')"
query = "\
UPDATE ${....acct_table1} SET \
AcctStartTime = ${....event_timestamp}, \
AcctUpdateTime = ${....event_timestamp},
\
ConnectInfo_start = '%{Connect-Info}', \
AcctSessionId = '%{Acct-Session-Id}' \
WHERE UserName = '%{SQL-User-Name}' \
AND NASIPAddress = '%{%{NAS-IPv6-Address}
:-%{NAS-IP-Address}}' \
AND NASPortId = '%{%{NAS-Port-ID}:-%{NAS-
Port}}' \
AND NASPortType = '%{NAS-Port-Type}' \
AND AcctStopTime IS NULL"
}
start { start {
# #
# Insert a new record into the sessions table # Insert a new record into the sessions table
# #
query = "\ query = "\
INSERT INTO ${....acct_table1} \ INSERT INTO ${....acct_table1} \
(${...column_list}) \ (${...column_list}) \
VALUES \ VALUES \
('%{Acct-Session-Id}', \ ('%{Acct-Session-Id}', \
'%{Acct-Unique-Session-Id}', \ '%{Acct-Unique-Session-Id}', \
skipping to change at line 348 skipping to change at line 331
'0', \ '0', \
'%{Called-Station-Id}', \ '%{Called-Station-Id}', \
'%{Calling-Station-Id}', \ '%{Calling-Station-Id}', \
'', \ '', \
'%{Service-Type}', \ '%{Service-Type}', \
'%{Framed-Protocol}', \ '%{Framed-Protocol}', \
'%{Framed-IP-Address}', \ '%{Framed-IP-Address}', \
'%{Framed-IPv6-Address}', \ '%{Framed-IPv6-Address}', \
'%{Framed-IPv6-Prefix}', \ '%{Framed-IPv6-Prefix}', \
'%{Framed-Interface-Id}', \ '%{Framed-Interface-Id}', \
'%{Delegated-IPv6-Prefix}')" '%{Delegated-IPv6-Prefix}' \
${....class.packet_xlat})"
# #
# When using "sql_session_start", you should comment out # When using "sql_session_start", you should comment out
# the previous query, and enable this one. # the previous query, and enable this one.
# #
# Just change the previous query to "-query", # Just change the previous query to "-query",
# and this one to "query". The previous one # and this one to "query". The previous one
# will be ignored, and this one will be # will be ignored, and this one will be
# enabled. # enabled.
# #
skipping to change at line 451 skipping to change at line 435
%{%{Acct-Output-Octets}:-0}, \ %{%{Acct-Output-Octets}:-0}, \
'%{Called-Station-Id}', \ '%{Called-Station-Id}', \
'%{Calling-Station-Id}', \ '%{Calling-Station-Id}', \
'', \ '', \
'%{Service-Type}', \ '%{Service-Type}', \
'%{Framed-Protocol}', \ '%{Framed-Protocol}', \
'%{Framed-IP-Address}', \ '%{Framed-IP-Address}', \
'%{Framed-IPv6-Address}', \ '%{Framed-IPv6-Address}', \
'%{Framed-IPv6-Prefix}', \ '%{Framed-IPv6-Prefix}', \
'%{Framed-Interface-Id}', \ '%{Framed-Interface-Id}', \
'%{Delegated-IPv6-Prefix}')" '%{Delegated-IPv6-Prefix}' \
${....class.packet_xlat})"
# #
# When using "sql_session_start", you should comment out # When using "sql_session_start", you should comment out
# the previous query, and enable this one. # the previous query, and enable this one.
# #
# Just change the previous query to "-query", # Just change the previous query to "-query",
# and this one to "query". The previous one # and this one to "query". The previous one
# will be ignored, and this one will be # will be ignored, and this one will be
# enabled. # enabled.
# #
skipping to change at line 541 skipping to change at line 526
%{%{Acct-Output-Octets}:-0}, \ %{%{Acct-Output-Octets}:-0}, \
'%{Called-Station-Id}', \ '%{Called-Station-Id}', \
'%{Calling-Station-Id}', \ '%{Calling-Station-Id}', \
'%{Acct-Terminate-Cause}', \ '%{Acct-Terminate-Cause}', \
'%{Service-Type}', \ '%{Service-Type}', \
'%{Framed-Protocol}', \ '%{Framed-Protocol}', \
'%{Framed-IP-Address}', \ '%{Framed-IP-Address}', \
'%{Framed-IPv6-Address}', \ '%{Framed-IPv6-Address}', \
'%{Framed-IPv6-Prefix}', \ '%{Framed-IPv6-Prefix}', \
'%{Framed-Interface-Id}', \ '%{Framed-Interface-Id}', \
'%{Delegated-IPv6-Prefix}')" '%{Delegated-IPv6-Prefix}' \
${....class.packet_xlat})"
# #
# When using "sql_session_start", you should comment out # When using "sql_session_start", you should comment out
# the previous query, and enable this one. # the previous query, and enable this one.
# #
# Just change the previous query to "-query", # Just change the previous query to "-query",
# and this one to "query". The previous one # and this one to "query". The previous one
# will be ignored, and this one will be # will be ignored, and this one will be
# enabled. # enabled.
# #
skipping to change at line 605 skipping to change at line 591
# postauth_query - Insert some info after authentication # postauth_query - Insert some info after authentication
####################################################################### #######################################################################
post-auth { post-auth {
# Write SQL queries to a logfile. This is potentially useful for bulk ins erts # Write SQL queries to a logfile. This is potentially useful for bulk ins erts
# when used with the rlm_sql_null driver. # when used with the rlm_sql_null driver.
# logfile = ${logdir}/post-auth.sql # logfile = ${logdir}/post-auth.sql
query = "\ query = "\
INSERT INTO ${..postauth_table} \ INSERT INTO ${..postauth_table} \
(username, pass, reply, authdate) \ (username, pass, reply, authdate ${..class.column_name}) \
VALUES ( \ VALUES ( \
'%{SQL-User-Name}', \ '%{SQL-User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \ '%{%{User-Password}:-%{Chap-Password}}', \
'%{reply:Packet-Type}', \ '%{reply:Packet-Type}', \
'%S.%M')" '%S.%M' \
${..class.reply_xlat})"
} }
 End of changes. 8 change blocks. 
61 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)