| | |
| | | import org.opends.server.protocols.asn1.ASN1Writer; |
| | | import org.opends.server.protocols.ldap.ExtendedRequestProtocolOp; |
| | | import org.opends.server.protocols.ldap.ExtendedResponseProtocolOp; |
| | | import org.opends.server.protocols.ldap.LDAPControl; |
| | | import org.opends.server.protocols.ldap.LDAPMessage; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.protocols.ldap.UnbindRequestProtocolOp; |
| | |
| | | StringArgument authzID; |
| | | StringArgument bindDN; |
| | | StringArgument bindPW; |
| | | StringArgument controlStr; |
| | | StringArgument currentPW; |
| | | StringArgument ldapHost; |
| | | StringArgument newPW; |
| | |
| | | argParser.addArgument(sslTrustStorePINFile); |
| | | |
| | | |
| | | controlStr = |
| | | new StringArgument("control", 'J', "control", false, true, true, |
| | | "{controloid[:criticality[:value|::b64value|:<fileurl]]}", |
| | | null, null, MSGID_DESCRIPTION_CONTROLS); |
| | | argParser.addArgument(controlStr); |
| | | |
| | | |
| | | showUsage = new BooleanArgument("help", 'H', "help", |
| | | MSGID_LDAPPWMOD_DESCRIPTION_USAGE); |
| | | argParser.addArgument(showUsage); |
| | |
| | | } |
| | | |
| | | |
| | | // If a control string was provided, then decode the requested controls. |
| | | ArrayList<LDAPControl> controls = new ArrayList<LDAPControl>(); |
| | | if(controlStr.isPresent()) |
| | | { |
| | | for (String ctrlString : controlStr.getValues()) |
| | | { |
| | | LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err); |
| | | if(ctrl == null) |
| | | { |
| | | int msgID = MSGID_TOOL_INVALID_CONTROL_STRING; |
| | | String message = getMessage(msgID, ctrlString); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | err.println(argParser.getUsage()); |
| | | return 1; |
| | | } |
| | | controls.add(ctrl); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Perform a basic Directory Server bootstrap if appropriate. |
| | | if (initializeServer) |
| | | { |
| | |
| | | new ExtendedRequestProtocolOp(OID_PASSWORD_MODIFY_REQUEST, |
| | | requestValue); |
| | | LDAPMessage requestMessage = |
| | | new LDAPMessage(nextMessageID.getAndIncrement(), extendedRequest); |
| | | new LDAPMessage(nextMessageID.getAndIncrement(), extendedRequest, |
| | | controls); |
| | | |
| | | |
| | | // Send the request to the server and read the response. |