summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/ldap.pm
diff options
context:
space:
mode:
authorivan <ivan>2002-11-19 21:20:03 +0000
committerivan <ivan>2002-11-19 21:20:03 +0000
commitbf79e1879f8f6b309391a71c9d563d9ee8782e36 (patch)
tree690f47bb341705bec3bd7ffca46d64170ae9d006 /FS/FS/part_export/ldap.pm
parentf5be6be6a52ee4461243eeaadcf769c14571b82f (diff)
ldap export: don't use password if not given
Diffstat (limited to 'FS/FS/part_export/ldap.pm')
-rw-r--r--FS/FS/part_export/ldap.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/part_export/ldap.pm b/FS/FS/part_export/ldap.pm
index 6077b74..776814c 100644
--- a/FS/FS/part_export/ldap.pm
+++ b/FS/FS/part_export/ldap.pm
@@ -225,12 +225,14 @@ sub ldap_insert { #subroutine, not 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->new($machine) or die $@;
- my $status = $ldap->bind( $dn, password=>$password );
+ my $status = $ldap->bind( $dn, %bind_options );
die $status->error if $status->is_error;
$dn;