Set Encrypted User Password (QSYSUPWD) API


  Required Parameter Group:

1 Receiver variable from QSYRUPWD Input Char(*)
2 Format Input Char(8)
3 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Set Encrypted User Password (QSYSUPWD) API sets the encrypted password data for the specified user profile by using the receiver variable that was retrieved with the Retrieve Encrypted User Password (QSYRUPWD) API.

The QSYSUPWD API changes the following fields in addition to the password values:

Note: If an error occurs while you are attempting to set the IBM i NetServerâ„¢ password, the CPF22F0 error is returned and no other encrypted password data is set.

If the local password management (LCLPWDMGT) value for the specified user profile is *NO, then the local IBM i password will be set to *NONE. Also, if the LCLPWDMGT value was *NO for the user profile on the system where the QSYRUPWD API was called, then the local IBM i password will be set to *NONE.

The QSYRUPWD (Retrieve Encrypted User Password) API does not retrieve product-level encrypted data that may be associated with a user profile. Additional steps may be needed after the QSYSUPWD (Set Encrypted User Password) API is run, to ensure that product-level encrypted data is correct.


Authorities and Locks

User Profile Authority
*ALLOBJ and *SECADM
API Public Authority
*EXCLUDE

Required Parameter Group

Receiver variable from QSYRUPWD
INPUT; CHAR(*)

The variable that is used to set the encrypted password for the user. The receiver variable from the QSYRUPWD API must be used as input to this API. For this API to successfully set the encrypted password for the user, the bytes returned value must be equal to the bytes available value in the input data. The input data must be retrieved from the receiver variable used by the QSYRUPWD API.

Format
INPUT; CHAR(8)

The name of the format that is used to set the user's encrypted password data.

The following values are allowed:

UPWD0100 Encrypted password will be set

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


UPWD0100 Format

The following table describes the input variable that is to be passed as the first parameter to QSYSUPWD. This input variable must be the same data as the receiver variable that is returned by the QSYRUPWD API. The receiver variable, returned by the QSYRUPWD API, cannot be changed in any way prior to passing the data as input to the QSYSUPWD API. If this data is changed, the QSYSUPWD API will not be able to successfully change the password for the user. For detailed descriptions of the fields in the tables, see Field Descriptions.

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) User profile name
18 12 CHAR(*) Encrypted user password data


Field Descriptions

Bytes available. The number of bytes of data available when retrieved by the QSYRUPWD API. For the QSYSUPWD API to successfully set the encrypted password for the user, this value must be equal to the bytes returned value. If the bytes available field is greater than the bytes returned field, this input cannot be used to successfully set the encrypted password for the user.

Bytes returned. The number of bytes of data.

Encrypted user password data. The encrypted password data for the user profile.

User profile name. The name of the user profile for which the password will be changed.


Error Messages

Message ID Error Message Text
CPD2201 E System user profile cannot be changed.
CPF2203 E User profile &1 not correct.
CPF2225 E Not able to allocate internal system object.
CPF222E E &1 special authority is required.
CPF22F0 E Unexpected errors occurred during processing.
CPF3C21 E Format name &1 is not valid.
CPF3CF1 E Error code parameter not valid.
CPF4AB2 E Receiver variable from QSYRUPWD has been altered.
CPF9801 E Object &2 in library &3 not found.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V3R7

[ Back to top | Security APIs | APIs by category ]