Skip to content

Commit

Permalink
Update the default configuration to specify sql-group in a saner way.
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jun 26, 2015
1 parent 62fff67 commit b51ecab
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
12 changes: 12 additions & 0 deletions raddb/mods-available/sql
Expand Up @@ -230,6 +230,18 @@ sql {
# Table to keep radius client info
client_table = "nas"

#
# The group attribute specific to this instance of rlm_sql
#

# This entry should be used for additional instances (sql foo {})
# of the SQL module.
# group_attr = "${.:instance}-SQL-Group"

# This entry should be used for the default instance (sql {})
# of the SQL module.
group_attr = "SQL-Group"

# Read database-specific queries
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}
4 changes: 2 additions & 2 deletions raddb/mods-config/sql/main/mysql/queries.conf
Expand Up @@ -141,14 +141,14 @@ authorize_group_check_query = "\
SELECT id, groupname, attribute, \
Value, op \
FROM ${groupcheck_table} \
WHERE groupname = '%{Sql-Group}' \
WHERE groupname = '%{${group_attr}}' \
ORDER BY id"

authorize_group_reply_query = "\
SELECT id, groupname, attribute, \
value, op \
FROM ${groupreply_table} \
WHERE groupname = '%{Sql-Group}' \
WHERE groupname = '%{${group_attr}}' \
ORDER BY id"

#######################################################################
Expand Down
4 changes: 2 additions & 2 deletions raddb/mods-config/sql/main/postgresql/queries.conf
Expand Up @@ -146,13 +146,13 @@ authorize_reply_query = "\
authorize_group_check_query = "\
SELECT id, GroupName, Attribute, Value, op \
FROM ${groupcheck_table} \
WHERE GroupName = '%{Sql-Group}' \
WHERE GroupName = '%{${group_attr}}' \
ORDER BY id"

authorize_group_reply_query = "\
SELECT id, GroupName, Attribute, Value, op \
FROM ${groupreply_table} \
WHERE GroupName = '%{Sql-Group}' \
WHERE GroupName = '%{${group_attr}}' \
ORDER BY id"

#######################################################################
Expand Down
6 changes: 3 additions & 3 deletions raddb/mods-config/sql/main/sqlite/queries.conf
Expand Up @@ -131,14 +131,14 @@ authorize_group_check_query = "\
SELECT id, groupname, attribute, \
Value, op \
FROM ${groupcheck_table} \
WHERE groupname = '%{Sql-Group}' \
WHERE groupname = '%{${group_attr}}' \
ORDER BY id"

authorize_group_reply_query = "\
SELECT id, groupname, attribute, \
value, op \
FROM ${groupreply_table} \
WHERE groupname = '%{Sql-Group}' \
WHERE groupname = '%{${group_attr}}' \
ORDER BY id"

#######################################################################
Expand Down Expand Up @@ -166,7 +166,7 @@ simul_verify_query = "\
SELECT radacctid, acctsessionid, username, nasipaddress, nasportid, framedipaddress, \
callingstationid, framedprotocol \
FROM ${acct_table1} \
WHERE username = '%{SQL-User-Name}' \
WHERE username = '%{${group_attr}}' \
AND acctstoptime IS NULL"

#######################################################################
Expand Down
3 changes: 3 additions & 0 deletions src/tests/modules/sql_mysql/module.conf
Expand Up @@ -45,6 +45,9 @@ sql {
# Table to keep radius client info
client_table = "nas"

# The group attribute specific to this instance of rlm_sql
group_attr = "SQL-Group"

# Read database-specific queries
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}
3 changes: 3 additions & 0 deletions src/tests/modules/sql_postgresql/module.conf
Expand Up @@ -44,6 +44,9 @@ sql {
# Table to keep radius client info
client_table = "nas"

# The group attribute specific to this instance of rlm_sql
group_attr = "SQL-Group"

# Read database-specific queries
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}
3 changes: 3 additions & 0 deletions src/tests/modules/sql_sqlite/module.conf
Expand Up @@ -44,6 +44,9 @@ sql {
# Table to keep radius client info
client_table = "nas"

# The group attribute specific to this instance of rlm_sql
group_attr = "SQL-Group"

# Read database-specific queries
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}

0 comments on commit b51ecab

Please sign in to comment.