mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
25.07.2009 ba2858890becc2ec90e48ca74fbefb6c1ad1cb6a
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.

1 files modified
4 ■■■■ changed files
opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -22,7 +22,7 @@
 * 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;
@@ -283,7 +283,7 @@
         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)
      {