noresetcounter + NULL radacct records (First Connection)

Ivan Kalik tnt at kalik.net
Tue Sep 8 13:41:41 CEST 2009


> On occasions sqlcounter does not seem to work correctly, especially for
> NEW
> User that have no radacct details.
>
> After doing some digging, I've identified the issue only to happen on the
> first ever connect of the user in a new account.
>
> As you will see from the sql below, if no integer is returned (NULL), then
> Max-All-Sessions and the correct setting of  is ignored and
> Session-Timeout
> is skipped.
>
> How can I address the NULL response for newly created accounts?
>
> rlm_sqlcounter: Entering module authorize code
> sqlcounter_expand:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
> UserName='%{User-Name}''

Alter the counter query:

SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE
UserName='%{User-Name}'

Does postgre have the same problem (no session limit is returned for the
counter if there are no radacct records)?

Ivan Kalik
Kalik Informatika ISP




More information about the Freeradius-Users mailing list