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

david_page
03.15.2007 b75f522e223fcee55e9e474bf691f48d54703f3f
refs
author david_page <david_page@localhost>
Thursday, May 3, 2007 17:15 +0200
committer david_page <david_page@localhost>
Thursday, May 3, 2007 17:15 +0200
commitb75f522e223fcee55e9e474bf691f48d54703f3f
tree 31a81bd34823250a46ff30109da83a1510d73397 tree | zip | gz
parent 411def8a4f6083b4504b779532ff1fab212067e2 view | diff
Issue [1395] NullPointerException raised by ldapsearch when prompt for bind passwd

When "-w -" is passed to a command-line tool such as ldapsearch, the tool requests the bind password from standard input. OpenDS on Java 6 uses java.io.Console.readPassword method. For prior releases a utility method org.opends.server.util.PasswordReader.readPasswordUsingBackspaces is used, and this routine returns a char[] with the user-supplied password, which is used to initialize a String. In the case no password was supplied (i.e., the user just presses return at the prompt), the routine returns null, which results in an exception. This change returns char[0] in the case of an empty password, which mimics the behavior of the Java 6 java.io.Console.readPassword, and eliminates the exception.
2 files modified
13 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java 3 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/PasswordReader.java 10 ●●●●● diff | view | raw | blame | history