SQLcounter patch - Addition of reply-attribute

Alan DeKok aland at deployingradius.com
Sun Oct 22 16:52:51 CEST 2006


"Jonathan De Graeve" <Jonathan.De.Graeve at imelda.be> wrote:
> I just made a patch against 1.1.3 for the SQLcounter module.

  Please submit patches on bugs.freeradius.org.  It's easier to manage
them that way.

> I'm planning the following additions:
> 
> The ability to override the reject behaviour with an accept but adding
> attributes.
> 
> For example: if the user has reached his volume limit, accept the user
> but add speed-limitation attributes.

  That's really what multiple module are for.  Have the sqlcounter
module return a special return code when the user is over the limit,
and use module failover to switch on that return code, and run another
module.

> -       char *counter_name;     /* Daily-Session-Time */
> -       char *check_name;       /* Max-Daily-Session */
> -       char *key_name;         /* User-Name */
> +       char *counter_name;     /* Daily-Session-Time */

  Why?  Gratuitous whitespace changes don't belong in a patch.

> -               if ((reply_item = pairfind(request->reply->vps,
> PW_SESSION_TIMEOUT)) != NULL) {
> +               /* if ((reply_item = pairfind(request->reply->vps,
> PW_SESSION_TIMEOUT)) != NULL) { */

  If you're changing code PLEASE do not leave the old code in
comments.  It's confusing, and pointless.  CVS will tell you what the
old code was.  This practice is just unnecessary.

  Alan DeKok.
--
  http://deployingradius.com       - The web site of the book
  http://deployingradius.com/blog/ - The blog



More information about the Freeradius-Users mailing list