sqlcounter problem after upgrading to 2.1.0
Hi All, I've been using freeradius 1.1.5 for sometime. I use mysql for storing users and I have enabled sqlcounter module for restricitng monthly access time. Each user is member of a group and group's Max-Monthly-Session is set in radgroupcheck table. I have a script which is invoked from cron every month which calculates remaining time of users and does a insert/update/delete on radcheck so that there will be a record in radcheck if the user has any time left from the prevois month. Attribute is Max-Monthly-Session and value = (remaining + group's Max-Monthly-Session). This way I have implemented a session time carry over system. Recently I have upgraded freeradius to version 2.1.0. Everything is working well as expected other than sqlcounter. In new version it is ignoring the Max-Monthly-Session from radcheck table. I have installed radius in a new server but the same result. The radius debug output and sql table are available at http://pastebin.ca/1204050 Is there any config item for sqlcounter to process radcheck table? Thanks, JT
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there. Ivan Kalik Kalik Informatika ISP Dana 16/9/2008, "J M Toms" <jmtoms@gmail.com> piše:
Hi All,
I've been using freeradius 1.1.5 for sometime. I use mysql for storing users and I have enabled sqlcounter module for restricitng monthly access time. Each user is member of a group and group's Max-Monthly-Session is set in radgroupcheck table. I have a script which is invoked from cron every month which calculates remaining time of users and does a insert/update/delete on radcheck so that there will be a record in radcheck if the user has any time left from the prevois month. Attribute is Max-Monthly-Session and value = (remaining + group's Max-Monthly-Session). This way I have implemented a session time carry over system.
Recently I have upgraded freeradius to version 2.1.0. Everything is working well as expected other than sqlcounter. In new version it is ignoring the Max-Monthly-Session from radcheck table. I have installed radius in a new server but the same result. The radius debug output and sql table are available at http://pastebin.ca/1204050
Is there any config item for sqlcounter to process radcheck table?
Thanks, JT
Hello Ivan, Thanks for quick reply. Deleting the radgroupcheck entry did the trick. Regards, JT 2008/9/16 <tnt@kalik.net>:
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there.
Ivan Kalik Kalik Informatika ISP
FYI, radreply items override radgroupreply. I have Idle-Timeout in both radreply and radgroupreply and user's values override what is set in groups. Why is this processing order different for check items? It is quite natural to set default values in group and override the defaults for some users by setting it in user table. Just curious.. Thanks, JT On Tue, Sep 16, 2008 at 5:14 PM, J M Toms <jmtoms@gmail.com> wrote:
Hello Ivan, Thanks for quick reply. Deleting the radgroupcheck entry did the trick.
Regards, JT
2008/9/16 <tnt@kalik.net>:
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there.
Ivan Kalik Kalik Informatika ISP
It's to do with operators rather than tables. "=" will not replace attribute value if one already exists. ":=" will. There is a case for blocking this in cases when same attribute has both user and group sql entry. That would enable for user entries to take preferance over group entries even when ":=" operator is used. Ivan Kalik Kalik Informatika ISP Dana 17/9/2008, "J M Toms" <jmtoms@gmail.com> piše:
FYI, radreply items override radgroupreply. I have Idle-Timeout in both radreply and radgroupreply and user's values override what is set in groups.
Why is this processing order different for check items? It is quite natural to set default values in group and override the defaults for some users by setting it in user table. Just curious..
Thanks, JT
On Tue, Sep 16, 2008 at 5:14 PM, J M Toms <jmtoms@gmail.com> wrote:
Hello Ivan, Thanks for quick reply. Deleting the radgroupcheck entry did the trick.
Regards, JT
2008/9/16 <tnt@kalik.net>:
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi JT, You can apply following patch to prevent group attributes with operator := overwriting user attributes. Just commenting out the overwritng code in valuepair.c Regards, Abraham --- src/main/valuepair.c.orig 2008-09-17 16:57:25.000000000 +0530 +++ src/main/valuepair.c 2008-09-17 16:58:41.000000000 +0530 @@ -631,11 +631,13 @@ */ case T_OP_SET: /* := */ if (found) { + /* VALUE_PAIR *vp; vp = found->next; memcpy(found, i, sizeof(*found)); found->next = vp; + */ continue; } break; On 9/17/08, tnt@kalik.net <tnt@kalik.net> wrote:
It's to do with operators rather than tables. "=" will not replace attribute value if one already exists. ":=" will.
There is a case for blocking this in cases when same attribute has both user and group sql entry. That would enable for user entries to take preferance over group entries even when ":=" operator is used.
Ivan Kalik Kalik Informatika ISP
Dana 17/9/2008, "J M Toms" <jmtoms@gmail.com> piše:
FYI, radreply items override radgroupreply. I have Idle-Timeout in both radreply and radgroupreply and user's values override what is set in groups.
Why is this processing order different for check items? It is quite natural to set default values in group and override the defaults for some users by setting it in user table. Just curious..
Thanks, JT
On Tue, Sep 16, 2008 at 5:14 PM, J M Toms <jmtoms@gmail.com> wrote:
Hello Ivan, Thanks for quick reply. Deleting the radgroupcheck entry did the trick.
Regards, JT
2008/9/16 <tnt@kalik.net>:
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thanks Ivan for clarifying reply items query. Jacob, Thanks for the patch. One question, will it break any other functionality or modules to behave differnetly? I see this function is being called from many places in the source tree. Thanks, JT 2008/9/17 Abraham Jacob <abrahamj@gmail.com>:
Hi JT,
You can apply following patch to prevent group attributes with operator := overwriting user attributes. Just commenting out the overwritng code in valuepair.c
Regards, Abraham
--- src/main/valuepair.c.orig 2008-09-17 16:57:25.000000000 +0530 +++ src/main/valuepair.c 2008-09-17 16:58:41.000000000 +0530 @@ -631,11 +631,13 @@ */ case T_OP_SET: /* := */ if (found) { + /* VALUE_PAIR *vp;
vp = found->next; memcpy(found, i, sizeof(*found)); found->next = vp; + */ continue; } break;
On 9/17/08, tnt@kalik.net <tnt@kalik.net> wrote:
It's to do with operators rather than tables. "=" will not replace attribute value if one already exists. ":=" will.
There is a case for blocking this in cases when same attribute has both user and group sql entry. That would enable for user entries to take preferance over group entries even when ":=" operator is used.
Ivan Kalik Kalik Informatika ISP
Dana 17/9/2008, "J M Toms" <jmtoms@gmail.com> piše:
FYI, radreply items override radgroupreply. I have Idle-Timeout in both radreply and radgroupreply and user's values override what is set in groups.
Why is this processing order different for check items? It is quite natural to set default values in group and override the defaults for some users by setting it in user table. Just curious..
Thanks, JT
On Tue, Sep 16, 2008 at 5:14 PM, J M Toms <jmtoms@gmail.com> wrote:
Hello Ivan, Thanks for quick reply. Deleting the radgroupcheck entry did the trick.
Regards, JT
2008/9/16 <tnt@kalik.net>:
And the point of radgroupcheck entry (apart from overwriting the radcheck entry - radcheck entry gets processed first, than radgruopcheck entry overwrites it) is? Remove that entry and store that value somewhere else - not in radius schema. Create an additional table and store such stuff there.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Abraham Jacob wrote:
You can apply following patch to prevent group attributes with operator := overwriting user attributes. Just commenting out the overwritng code in valuepair.c
Or, change ":=" to "=" in the group check table. Which also has the benefit of *not* changing the behavior of ":=" for everything else in the server. Alan DeKok.
On Wed, Sep 17, 2008 at 5:20 PM, Alan DeKok <aland@deployingradius.com> wrote:
Or, change ":=" to "=" in the group check table. Which also has the benefit of *not* changing the behavior of ":=" for everything else in the server.
I tried changing operator to '=' but sqlcounter fails with following message. rlm_sqlcounter: Entering module authorize code rlm_sqlcounter: Could not find Check item value pair ++[monthlycounter] returns noop So I guess it has to be := Thanks, JT
participants (4)
-
Abraham Jacob -
Alan DeKok -
J M Toms -
tnt@kalik.net