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

david_page
03.15.2007 a6f8e77979e4968ff1862b0b9e277309fe8bc5fd
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
commita6f8e77979e4968ff1862b0b9e277309fe8bc5fd
tree d3bfd1ae539f97d9b2c7953013e683420a319dbc tree | zip | gz
parent 1648e8db330a8e66782ec1b69948fd9db7710648 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
opends/src/server/org/opends/server/tools/LDAPSearch.java 3 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/util/PasswordReader.java 10 ●●●●● diff | view | raw | blame | history