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

lutoff
25.23.2009 e59528243f3f148db4684925ddefa8b42f75c820
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.

Previous fix was not good: The user cannot specify anymore -D "" -w ""
If the password is not the command line, We now set it to null.

2 files modified
4 ■■■■ changed files
opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/LDAPConnection.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -283,7 +283,7 @@
         throws ClientException, LDAPException
  {
    // See if we need to prompt the user for the password.
    if ( (bindPassword == null) || (bindPassword.length() == 0 ))
    if (bindPassword == null)
    {
      if (bindDN == null)
      {
opends/src/server/org/opends/server/tools/LDAPConnection.java
@@ -304,7 +304,7 @@
      ByteString bindPW;
      if (bindPassword == null)
      {
        bindPW =  ByteString.empty();
        bindPW =  null;
      }
      else
      {