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

Gaetan Boismal
23.31.2016 a49e9326888ff9f1ed77563201a15d64fc845242
OPENDJ-3222 Fix ldap* tool anonymous mode

Used in anonymous mode and --reportAuthzID or --usePasswordPolicyControl
arguments, ldap* tool were failing in NPE.
As discussed in the JIRA issue, the behavior choosen is to do nothing
ant let the request goes if these controls are used in anonymous mode.
1 files modified
4 ■■■■ changed files
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java 4 ●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java
@@ -646,11 +646,11 @@
                throw new ArgumentException(ERR_LDAPAUTH_UNSUPPORTED_SASL_MECHANISM.get(mech));
            }
            if (reportAuthzIDArg.isPresent()) {
            if (bindRequest != null && reportAuthzIDArg.isPresent()) {
                bindRequest.addControl(AuthorizationIdentityRequestControl.newControl(false));
            }
            if (usePasswordPolicyControlArg.isPresent()) {
            if (bindRequest != null && usePasswordPolicyControlArg.isPresent()) {
                bindRequest.addControl(PasswordPolicyRequestControl.newControl(false));
            }
        }