Fix for issue #3826 (ldapsearch doesn't prompt bind password when the option -w is not provided)
The behavior modification was introduced in rev #4956 in the following method:
org.opends.server.tools.LDAPConnection.connectToHost()
In the old version (rev #3847 line #291) , the bindPW was set to null.
In the new version (rev #4956 line #307), the bindPW is set to an empty ByteString
The actual bind, handled by LDAPAuthenticationHandler.doSimpleBind() method,
switches in interactive mode when bindPW is null, which is not the case with the
new version.
We now also check to the bind password in an empty ByteString.
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools; |
| | | import org.opends.messages.Message; |
| | |
| | | throws ClientException, LDAPException |
| | | { |
| | | // See if we need to prompt the user for the password. |
| | | if (bindPassword == null) |
| | | if ( (bindPassword == null) || (bindPassword.length() == 0 )) |
| | | { |
| | | if (bindDN == null) |
| | | { |