1.1.0: Bug in rlm_sql.c OR sql.conf templates
Hi, this is a rather annoying bug that has create a whole lot of confusion in my accounting tables: See rlm_sql.c static CONF_PARSER module_config[] = { ... {"acct_table", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_acct_table), NULL, "radacct"}, {"acct_table2", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_acct_table2), NULL, "radacct"}, ... i.e. the configuration items for the accounting tables are called "acct_table" and "acct_table2". But the sql.conf template says: acct_table1 = "radacct" acct_table2 = "radacct" and later all the query templates refer to acct_table1. The outcome is that the server claims to write his UPDATE to the content of variable acct_table1 (even in -X debug output, because there the xlat's "expands to" is printed and that uses acct_table1 for expansion), but the sql module actually always writes to the default "radacct" (unless you are clever enough to add a configuration item "acct_table" that is in sync with "acct_table1". The bug is a little hard to spot, since it will only show if you make acct_table1 not use the default "radacct". Please fix this for 1.1.1 if it's not tagged already. My suggested fix is, naturally, a one-liner: < {"acct_table", PW_TYPE_STRING_PTR,
{"acct_table1", PW_TYPE_STRING_PTR,
Greetings, Stefan Winter -- Stefan WINTER RESTENA Foundation - Réseau Téléinformatique de l'Education Nationale et de la Recherche R&D Engineer 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg email: stefan.winter@restena.lu Tel.: +352 424409-1 http://www.restena.lu Fax: +352 422473
Stefan Winter wrote:
My suggested fix is, naturally, a one-liner:
< {"acct_table", PW_TYPE_STRING_PTR,
{"acct_table1", PW_TYPE_STRING_PTR,
I'd vote to completely delete the *_table* variables from rlm_sql.c and conf.h. They are unused anyway and only bring confusion. The admin can use whatever names he likes, the variables will be xlated before running the SQL query. -- Nicolas Baradakis
Nicolas Baradakis <nbk@sitadelle.com> wrote:
I'd vote to completely delete the *_table* variables from rlm_sql.c and conf.h. They are unused anyway and only bring confusion. The admin can use whatever names he likes, the variables will be xlated before running the SQL query.
That does sound like a better solution. We just have to check that the module verifies that the xlat'd queries are non-NULL before the "instantiate" section returns. Alan DeKok.
participants (3)
-
Alan DeKok -
Nicolas Baradakis -
Stefan Winter