Paul Hampson wrote:

> > > > With one minor change, to call
> > > > (inst->module->sql_finish_query)(sqlsocket, inst->config);
> > > > even for failed queries. (As is done in _some_ of the other
> > > > sql_ function in rlm_sql.c. And PostgresSQL's docs also do
> > > > it... Only postgres and Sybase (off hand, Oracle too maybe)
> > > > actually implement the function anyway.
> >
> > I don't understand. There is a return RLM_MODULE_FAIL just above,
> > so sql_finish_query() is not called on failed query.
>
> That's my point. My reading says it _should_ be. This certainly
> needs to be cleaned up in other places too.

I'm sorry, I've completely misunderstood your previous post.

The fact is it's unclear when you should call sql_finish_query().
Looking more closely at rlm_sql.c I observed that:
(i) after a failed rlm_sql_query() there no call to sql_finish_query()
except in rlm_sql_accounting()
(ii) sql_finish_query() may sometimes be called 2 times (see lines 812
and 815 for example)

I think it'd be better to have a separate patch to fix
sql_finish_query() usage everywhere and not only in
rlm_sql_postauth()

-- 
Nicolas Baradakis



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

Reply via email to