(RADIATOR) SQLRADIUS patch

Mike McCauley mikem at open.com.au
Tue Aug 5 06:52:09 CDT 2003


Hello Alexander ,

Thanks for your contribution. We really appreciate it when people send us 
patches like this.

We have rolled your patch in for the next release and also uploaded a patch to 
the Radiator 3.6 area.

Thanks again for your code.

Cheers.


On Tue, 5 Aug 2003 08:04 pm, Alexander Mayrhofer wrote:
> Hi,
>
> I've done a small patch to the SQLRADIUS module, which helps in certain
> query situations. The patch (see below for a diff) adds the parameter:
>
> StartHost [integer]   (Default: 1)
>
> to the <AuthBy SQLRADIUS> section. It is useful in situations where you
> don't want the local counter variable %0 to start with 1, the most
> obvious one being
>
> HostSelect SELECT HOST, SECRET FROM radius_servers WHERE realm='%R' \
> 	ORDER BY priority ASC OFFSET %0 LIMIT 1
>
> which currently makes Radiator to miss the first row (it would start
> with " ... OFFSET 1 LIMIT 1"). Setting "StartHost" to 0 remedies that
> issue.
>
> I'd like one of the Radiator developers to screen my patch, feel free to
> integrate it into the mainstream source if it qualifies.
>
> cheers
>
> Alex Mayrhofer
> nic.at
>
>
> --- AuthSQLRADIUS.pm.orig	Tue Aug  5 11:06:23 2003
> +++ AuthSQLRADIUS.pm	Tue Aug  5 11:28:33 2003
> @@ -16,6 +16,7 @@
>  %Radius::AuthSQLRADIUS::ConfigKeywords =
>      ('HostSelect'    => 'string',
>       'NumHosts'      => 'integer',
> +     'StartHost'     => 'integer',
>       'HostColumnDef' => 'stringhash',
>       );
>
> @@ -33,6 +34,7 @@
>  SERVERHASBROKENADDRESSES, IGNOREREPLYSIGNATURE, FAILUREPOLICY from
> RADSQLRADIUS where TARGETNAME=\'%R\'';
>      $self->{NumHosts} = 2; # Number of hosts (primary and secodary) per
> realm +    $self->{StartHost} = 1; # First host number
>  }
>
>  #####################################################################
> @@ -45,12 +47,21 @@
>  {
>      my ($self, $fp, $p) = @_;
>
> +    # initialize or increment hostCounter
> +    if (defined($fp->{hostCounter}))
> +    {
> +        $fp->{hostCounter}++;
> +    }
> +    else
> +    {
> +        $fp->{hostCounter} = $self->{StartHost};
> +    }
> +
>      # If they have already tried to send this too many times, and there
>      # are no more hosts to send to take the policy from the database
>      # This standard table has space for 2 hosts. Adjust this if necessary
> -    return if ($fp->{hostCounter} >= $self->{NumHosts});
> +    return if ($fp->{hostCounter} > $self->{NumHosts});
>
> -    $fp->{hostCounter}++;
>      my $q = &Radius::Util::format_special
>  	($self->{HostSelect}, $p, undef, $fp->{hostCounter});
>
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.

-- 
Mike McCauley                               mikem at open.com.au
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, 
TTLS, PEAP etc on Unix, Windows, MacOS etc.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list