From: Graham B. <gb...@po...> - 2000-08-09 09:05:26
|
This is a change that was forgotten in the RELEASE_NOTES, sorry. You must now be explicit about anonymous binds. Either $ldap->bind; or if you specify any arguments, you must use 'noauth' or 'anonymous' instead of 'password' (the value is ignored) e.g. $ldap->bind($dn, noauth => 1, version => 3); or $ldap->bind( anonymous => 1, version => 3); 'password' with an empty argument will fail with LDAP_INAPPROPRIATE_AUTH Although when we get protocol vs local errors separated, what it fails with may change. This is to prevent an anonymous bind happening by accident. Graham. On Wed, Aug 09, 2000 at 10:31:39AM +0200, Karl-Heinz Rastofer wrote: > just to keep track of changes: > > Anonymous bind does no more work with my old version (top), but I had to change > the > code (see below). > > #------------------------------------------------------------- > # sub ldapbind returns ldap-object OLD > #------------------------------------------------------------- > sub f_ldapbind { > my ($cref,$vref) = @_; > my ($ldap,$ldap_ref,$msg,$msg_ref,$dn,$uid,$pwd); > my %cookie = %$cref; > my %v = %$vref; > $uid = $cookie{$v{'authuid'}} || ""; > $pwd = $cookie{$v{'authpwd'}} || ""; > $dn = "uid=" . $uid . "," . $cookie{$v{'base'}}; > > $ldap = new Net::LDAP($cookie{$v{'servername'}}, port=>$cookie{$v{'serverport'}} > ); > $msg = $ldap->bind( $dn , > password => $pwd, > version => 3 ); > $ldap_ref = \$ldap; > $msg_ref = \$msg; > > return ($msg_ref, $ldap_ref); > } > #-------------------------------------------------------------------------------------------------------------------- > > #------------------------------------------------------------- > # sub ldapbind returns ldap-object NEW > #------------------------------------------------------------- > sub f_ldapbind { > my ($cref,$vref) = @_; > my ($ldap,$ldap_ref,$msg,$msg_ref,$dn,$uid,$pwd); > my %cookie = %$cref; > my %v = %$vref; > $uid = $cookie{$v{'authuid'}} || ""; > $pwd = $cookie{$v{'authpwd'}} || ""; > $dn = "uid=" . $uid . "," . $cookie{$v{'base'}}; > > $ldap = new Net::LDAP($cookie{$v{'servername'}}, > port=>$cookie{$v{'serverport'}}); > > if ($uid and $pwd) { > $msg = $ldap->bind( $dn , > password => $pwd, > version => 3 ); > } else { > $msg = $ldap->bind; > } > $ldap_ref = \$ldap; > $msg_ref = \$msg; > > return ($msg_ref, $ldap_ref); > } > > > |