issue# 2624:ldapsearch: wrong return code when no password provided
| | |
| | | provided as argument. No schema check will be performed. If this is being \ |
| | | called throught the '%s' command-line, verify that the script has not been \ |
| | | modified |
| | | INFO_LDAPAUTH_NON_EMPTY_PASSWORD_1676=You must provide a non-empty password \ |
| | | to continue |
| | |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | char[] pwChars = PasswordReader.readPassword(); |
| | | bindPasswordValue = new String(pwChars); |
| | | //As per rfc 4513(section-5.1.2) a client should avoid sending |
| | | //an empty password to the server. |
| | | while(pwChars.length==0) |
| | | { |
| | | err.println(wrapText( |
| | | INFO_LDAPAUTH_NON_EMPTY_PASSWORD.get(), |
| | | MAX_LINE_WIDTH)); |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | pwChars = PasswordReader.readPassword(); |
| | | } |
| | | bindPasswordValue = new String(pwChars); |
| | | } catch(Exception ex) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | char[] pwChars = PasswordReader.readPassword(); |
| | | bindPasswordValue = new String(pwChars); |
| | | //As per rfc 4513(section-5.1.2) a client should avoid sending |
| | | //an empty password to the server. |
| | | while(pwChars.length==0) |
| | | { |
| | | err.println(wrapText( |
| | | INFO_LDAPAUTH_NON_EMPTY_PASSWORD.get(), |
| | | MAX_LINE_WIDTH)); |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | pwChars = PasswordReader.readPassword(); |
| | | } |
| | | bindPasswordValue = new String(pwChars); |
| | | } catch(Exception ex) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | char[] pwChars = PasswordReader.readPassword(); |
| | | bindPasswordValue = new String(pwChars); |
| | | //As per rfc 4513(section-5.1.2) a client should avoid sending |
| | | //an empty password to the server. |
| | | while(pwChars.length==0) |
| | | { |
| | | err.println(wrapText( |
| | | INFO_LDAPAUTH_NON_EMPTY_PASSWORD.get(), |
| | | MAX_LINE_WIDTH)); |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | pwChars = PasswordReader.readPassword(); |
| | | } |
| | | bindPasswordValue = new String(pwChars); |
| | | } catch(Exception ex) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | char[] pwChars = PasswordReader.readPassword(); |
| | | bindPasswordValue = new String(pwChars); |
| | | //As per rfc 4513(section-5.1.2) a client should avoid sending |
| | | //an empty password to the server. |
| | | while(pwChars.length ==0) |
| | | { |
| | | err.println(wrapText( |
| | | INFO_LDAPAUTH_NON_EMPTY_PASSWORD.get(), |
| | | MAX_LINE_WIDTH)); |
| | | out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(bindDNValue)); |
| | | pwChars = PasswordReader.readPassword(); |
| | | } |
| | | bindPasswordValue = new String(pwChars); |
| | | } catch(Exception ex) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | if (DirectoryServer.bindWithDNRequiresPassword() && |
| | | ((bindDN != null) && (! bindDN.isNullDN()))) |
| | | { |
| | | throw new DirectoryException(ResultCode.INAPPROPRIATE_AUTHENTICATION, |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | ERR_BIND_DN_BUT_NO_PASSWORD.get()); |
| | | } |
| | | |
| | |
| | | import org.testng.annotations.Test; |
| | | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.core.BindOperation; |
| | | import org.opends.server.plugins.DisconnectClientPlugin; |
| | | import org.opends.server.plugins.InvocationCounterPlugin; |
| | | import org.opends.server.plugins.ShortCircuitPlugin; |
| | |
| | | conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"), |
| | | ByteString.empty()); |
| | | assertEquals(bindOperation.getResultCode(), |
| | | ResultCode.INAPPROPRIATE_AUTHENTICATION); |
| | | ResultCode.UNWILLING_TO_PERFORM); |
| | | } |
| | | |
| | | |