From bf79e1879f8f6b309391a71c9d563d9ee8782e36 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 19 Nov 2002 21:20:03 +0000 Subject: [PATCH] ldap export: don't use password if not given --- FS/FS/part_export/ldap.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FS/FS/part_export/ldap.pm b/FS/FS/part_export/ldap.pm index 6077b7418..776814c59 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; -- 2.11.0