Hello,

I have been having problems with freeradius 0.8 crashing for us
regularly.

First: we are using freeradius 0.8 with ldap authentication and sql
accounting to an oracle database.  I can supply config files if
required.

At the moment the server crashes multiple times a day.

I *think* I have tracked down the problem.

If a user logs in with a username > 32 characters we have problems.  The
column is VARCHAR2 32, and so the insert/update fails (fair enough).

First bug:
rlm_sql_oracle.c returns SQL_DOWN.

I believe it should return -1.  SQL_DOWN should be for when the
connection fails.

This causes sql.c to try to reconnect.

Second bug:
In sql.c, the code (repeated multiple times but for eg in
rlm_sql_query):

        ret = (inst->module->sql_query)(sqlsocket, inst->config, query);
        if (ret == SQL_DOWN) {
                if (connect_single_socket(sqlsocket, inst) < 0) {
                        radlog(L_ERR, "rlm_sql (%s): reconnect failed, database 
down?", inst->config->xlat_name);
                        return -1;
                }
                ret = (inst->module->sql_query)(sqlsocket, inst->config, query);

Does not first disconnect the socket.  For this reason the oracle login
etc does not get deleted - (inst->module->sql_close) is not called. 
This is a leak and additional eventually uses up all our sql logins on
the server.

It would seem we cant just add sql_close_socket here because
sql_close_socket does other things (sem_destroy).

Does this make sense to people?  I thought I would ask before trying to
fix it.  Particularly for the first one I need to work out when to
return -1 and when SQL_DOWN.


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

Reply via email to