Problem with unlang and customized reply message
Lorenzo Milesi
maxxer at ufficyo.com
Thu Jun 19 18:28:25 CEST 2014
Hi.
Following [1] and [2] I modified my site config in order to send custom reply message for each accounting error. Sadly it seems the server is NOT rejecting the user in case of Max-Daily-Session, so I must have done something wrong, but I cannot find the error.
I attached my config. This is what debug prints out for dailycounter
Thu Jun 19 17:31:35 2014 : Info: [dailycounter] expand: %{sql:SELECT SUM(acctsessiontime - GREATEST((1403128800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'username' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1403128800'} -> 10819
Thu Jun 19 17:31:35 2014 : Debug: rlm_sqlcounter: (Check item - counter) is less than zero
Thu Jun 19 17:31:35 2014 : Debug: rlm_sqlcounter: Rejected user username, check_item=10800, counter=10819
Thu Jun 19 17:31:35 2014 : Info: ++[dailycounter] = reject
Thu Jun 19 17:31:35 2014 : Info: ++? if (reject)
Thu Jun 19 17:31:35 2014 : Info: ? Evaluating (reject) -> TRUE
Thu Jun 19 17:31:35 2014 : Info: ++? if (reject) -> TRUE
Thu Jun 19 17:31:35 2014 : Info: ++if (reject) {
Thu Jun 19 17:31:35 2014 : Info: +++update reply {
Thu Jun 19 17:31:35 2014 : Info: +++} # update reply = noop
Thu Jun 19 17:31:35 2014 : Info: ++} # if (reject) = noop
... and then goes on on the next module. While if I just let "dailycounter" without additional options the debug correctly return reject:
Thu Jun 19 16:23:52 2014 : Debug: rlm_sqlcounter: (Check item - counter) is less than zero
Thu Jun 19 16:23:52 2014 : Debug: rlm_sqlcounter: Rejected user username, check_item=10800, counter=10819
Thu Jun 19 16:23:52 2014 : Info: ++[dailycounter] = reject
Thu Jun 19 16:23:52 2014 : Info: +} # group authorize = reject
Thu Jun 19 16:23:52 2014 : Info: Using Post-Auth-Type REJECT
Thu Jun 19 16:23:52 2014 : Info: # Executing group from file /etc/freeradius/sites-enabled/default
Thu Jun 19 16:23:52 2014 : Info: +group REJECT {
Thu Jun 19 16:23:52 2014 : Info: ++update reply {
Thu Jun 19 16:23:52 2014 : Info: ++} # update reply = noop
Thu Jun 19 16:23:52 2014 : Info: [attr_filter.access_reject] expand: %{User-Name} -> username
Thu Jun 19 16:23:52 2014 : Debug: attr_filter: Matched entry DEFAULT at line 11
Thu Jun 19 16:23:52 2014 : Info: ++[attr_filter.access_reject] = updated
Thu Jun 19 16:23:52 2014 : Info: +} # group REJECT = updated
This is the dailycounter config:
dailycounter{
reject = 1
}
if(reject){
update reply {
Reply-Message := "You have reached your daily time limit"
}
ok = reject
}
For other checks the same code seems to work fine... What's wrong with this?
thanks
[1] http://grasehotspot.org/documentation/freeradius/meaningful-reply-message-for-access-reject/
[2] http://tim.purewhite.id.au/2011/04/coova-chilli-freeradius-reply-message/
--
Lorenzo Milesi - lorenzo.milesi at yetopen.it
YetOpen S.r.l. - http://www.yetopen.it/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: frconfig.gz
Type: application/x-gzip
Size: 695 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140619/7ff514d8/attachment.bin>
More information about the Freeradius-Users
mailing list