Hello everyone,

I browsed rlm_sql source code and found out that
if main accounting_start_query fails and no alternate
query is set up or it is set to "", then no RLM_MODULE_FAIL
error code is returned from rlm_sql_accounting (actually
RLM_MODULE_OK is returned). The result is that
if no alternate start query is present, accounting start always
succeedes, even on SQL error.

I think the source code should look like (inside rlm_sql_accounting function):

case PW_STATUS_START:
    /*...*/
    if (*querystr) { /* non-empty query */
        /*...*/
        if (*querystr) { /* non-empty query */
            if (rlm_sql_query(sqlsocket, inst, querystr)) {
                radlog(L_ERR, "rlm_sql (%s): Couldn't update SQL" "accounting START 
record - %s",
                    inst->config->xlat_name, (char 
*)(inst->module->sql_error)(sqlsocket, inst->config));
                ret = RLM_MODULE_FAIL;
            }
            (inst->module->sql_finish_query)(sqlsocket, inst->config);
+++ }else
+++         ret = RLM_MODULE_FAIL;
    }

---
Zygmuntowicz Michal

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to