(RADIATOR) Patch for Radius::Ldap.pm to support a list of ldap servers

Markus Moeller huaraz at moeller.plus.com
Wed Feb 20 16:16:37 CST 2008


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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20080220/01bf1941/attachment.html>


More information about the radiator mailing list