Change User Profile UID or GID (QSYCHGID) API


  Required Parameter Group:

1 User profile name Input Char(10)
2 User ID number (UID) Input Binary(4)
3 Group ID number (GID) Input Binary(4)
4 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Change User Profile UID or GID (QSYCHGID) API provides an interface to change the user ID number (UID) or group ID number (GID) for a user profile. The UID or GID value for any user profile on the system may be changed. If the UID value is changed and the user profile owns objects in a directory (not including objects in the QSYS.LIB or QDLS file system), then the UID information for these objects is also changed. If the GID value is changed and the user profile is the primary group for objects in a directory, then the GID information for these objects is also changed. The UID or GID of a profile that is active in a process can be changed only when the system is in restricted state. (For example, the system would probably have to be in restricted state to change the UID for the QSYS user profile.) However, the UID of the user profile currently running cannot be changed, and the GID of the groups for the user profile currently running cannot be changed.


Authorities and Locks

User Profile Authority
*ALLOBJ and *SECADM
User Profile Lock
*EXCL

Required Parameter Group

User profile name
INPUT; CHAR(10)

The name of the user profile whose UID or GID is to be changed.

User ID number (UID)
INPUT; BINARY(4)

The new UID for the user profile.

This field must contain one of the following values:

1 to 4294967294 The new UID value.
4294967295 The UID for this user profile does not change. This value is the same as X'FFFFFFFF' or -1 in languages that do not support unsigned integers.

Group ID number (GID)
INPUT; BINARY(4)

The new GID for the user profile.

This field must contain one of the following values:

1 to 4294967294 The new GID.
4294967295 The GID for this user profile does not change. This value is the same as X'FFFFFFFF' or -1 in languages that do not support unsigned integers.
0 This user profile will no longer have a GID.

Error code
I/O; CHAR(*)

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


Error Messages

Message ID Error Message Text
CPFA1C8 D Error occurred while attempting to change the UID or GID information.
CPF22CE E The &1 value &2 is used by another user profile.
CPF22DB E The user profile being changed must have a GID.
CPF22DE E Not allowed to change the UID or GID of user profile &1.
CPF2203 E User profile &1 not correct.
CPF2204 E User profile &1 not found.
CPF2213 E Not able to allocate user profile &1.
CPF222E E &1 special authority is required.
CPF2225 E Not able to allocate internal system object.
CPF224B E &1 value is not valid.
CPF224C E Cannot change the UID value for QSECOFR.
CPF224D E User profile &1 cannot have a GID.
CPF3CF1 E Error code parameter not valid.
CPF3C90 E Literal value cannot be changed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R3
Top | Security APIs | APIs by category