(RADIATOR) Patch for Radius::Ldap.pm to support a list of ldap servers
Mike McCauley
mikem at open.com.au
Wed Feb 20 23:42:41 CST 2008
Hello Markus,
This is an interesting idea that could be useful for some people.
Support for multiple hosts was added to Net::LDAP in Jan 2003. I wonder if we
can safely assume that all custemers have a later version of Net::LDAP? Views
from anyone?
In the meantime, we generally intended multiple LDAP server to be handled with
multiple chained AuthBy LDAP2 clauses.
Cheers.
On Thursday 21 February 2008 08:16, Markus Moeller wrote:
> I needed to use a list of redundant ldapservers. perl-ldap does support an
> array of servers but Radiator doesn't. Please find below a patch which
> allows a list of ldapservers in <AutbBy LDAP2> , etc..
>
> Markus
>
> P.S I am not too experienced with perl so the below might be easier
> achieved.
>
> Markus
>
> --- Radiator-4.0/Radius/Ldap.pm Tue Dec 18 21:24:04 2007
> +++ /usr/perl5/site_perl/5.8.4/Radius/Ldap.pm Wed Feb 20 21:59:20 2008
> @@ -202,9 +202,16 @@
> return 1 if $self->{ld}; # We are already connected
> return 0 if time < $self->{backoff_until};
>
> - my $host = &Radius::Util::format_special($self->{Host});
> + my $hoststring = &Radius::Util::format_special($self->{Host});
> my $port =
> &Radius::Util::get_port(&Radius::Util::format_special($self->{Port})); -
> $self->{connectedHost} = "$host:$port";
> + my @hostarray = split(/[\s]+/,$hoststring);
> + my $host = \@hostarray;
> + if ( $hoststring =~ /:/ ) {
> + $self->{connectedHost} = "$hoststring";
> + $port='';
> + } else {
> + $self->{connectedHost} = "$hoststring:$port";
> + }
> $self->log($main::LOG_INFO, "Connecting to $self->{connectedHost}");
>
> $self->{bound} = undef;
--
Mike McCauley mikem at open.com.au
Open System Consultants Pty. Ltd Unix, Perl, Motif, C++, WWW
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070
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, NetWare 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