Skip to content

Commit

Permalink
Escape %s in sqlite counter queries
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 18, 2014
1 parent 6c0b190 commit 7f3deec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions raddb/mods-config/sql/counter/sqlite/dailycounter.conf
Expand Up @@ -3,9 +3,9 @@
# involves more work for the SQL server than those
# below
query = "SELECT SUM(acctsessiontime - \
GREATEST((%b - strftime('%s', acctstarttime)), 0)) \
GREATEST((%b - strftime('%%s', acctstarttime)), 0)) \
FROM radacct WHERE username = '%{${key}}' AND \
(strftime('%s', acctstarttime) + acctsessiontime) > %b"
(strftime('%%s', acctstarttime) + acctsessiontime) > %b"

# This query ignores calls that started in a previous
# reset period and continue into into this one. But it
Expand Down
2 changes: 1 addition & 1 deletion raddb/mods-config/sql/counter/sqlite/expire_on_login.conf
@@ -1,4 +1,4 @@
query = "SELECT GREATEST(strftime('%s', NOW()) - strftime('%s', acctstarttime), 0) AS expires \
query = "SELECT GREATEST(strftime('%%s', NOW()) - strftime('%%s', acctstarttime), 0) AS expires \
FROM radacct \
WHERE username = '%{${key}}' \
ORDER BY acctstarttime \
Expand Down
4 changes: 2 additions & 2 deletions raddb/mods-config/sql/counter/sqlite/monthlycounter.conf
Expand Up @@ -3,9 +3,9 @@
# involves more work for the SQL server than those
# below
query = "SELECT SUM(acctsessiontime - \
GREATEST((%b - strftime('%s', acctstarttime)), 0)) \
GREATEST((%b - strftime('%%s', acctstarttime)), 0)) \
FROM radacct WHERE username = '%{${key}}' AND \
(strftime('%s', acctstarttime) + acctsessiontime) > %b"
(strftime('%%s', acctstarttime) + acctsessiontime) > %b"

# This query ignores calls that started in a previous
# reset period and continue into into this one. But it
Expand Down

0 comments on commit 7f3deec

Please sign in to comment.