grep { /^\s*(\w+)\s+(.*\S)\s*$/ }
split("\n", $self->option('attributes'));
- if ( $self->option('radius') {
+ if ( $self->option('radius') ) {
foreach my $table (qw(reply check)) {
my $method = "radius_$table";
my %radius = $svc_acct->$method();
sub ldap_connect {
my( $machine, $dn, $password ) = @_;
+ my %bind_options;
+ $bind_options{password} = $password if length($password);
eval "use Net::LDAP";
die $@ if $@;
- my $ldap = Net::LDAP->net($machine) or die $@;
- my $status = $ldap->bind( $dn, password=>$password );
+ my $ldap = Net::LDAP->new($machine) or die $@;
+ my $status = $ldap->bind( $dn, %bind_options );
die $status->error if $status->is_error;
$dn;