qsyseteuid()--Set Effective User ID


  Syntax
 #include <qsysetid.h>    

 int qsyseteuid(uid_t uid);  
  Service Program Name: QSYSETIDS

  Default Public Authority: *USE

  Threadsafe: Yes

If uid is equal to the real, effective, or saved user ID, qsyseteuid() sets the effective user ID to uid.

If uid is not equal to the real, effective, or saved user ID, but the thread has *USE authority to the user profile associated with uid, qsyseteuid() sets the effective user ID to uid.

Job scoped locks with a lock state of *SHRRD are held on the user profiles associated with the real user ID, effective user ID, saved user ID, real group ID, effective group ID, saved group ID, and all of the supplemental groups.


Parameters

uid
(Input) User ID.

This field must contain one of the following values:

0 to 4294967294
The user ID value for the set operation.

Authorities and Locks

User profile associated with uid authority
*USE authority is required to the user profile associated with uid if uid is not equal to the real, effective or saved user IDs.
User profile associated with uid lock
*SHRRD

Return Value

0
qsyseteuid() was successful.
-1
qsyseteuid() was not successful. errno is set to indicate the error.

Error Conditions

If qsyseteuid() is not successful, errno indicates one of the following errors.

Error condition Additional information
[EAGAIN]

User profile associated with the uid is locked. Try again.

[EDAMAGE]

The user profile associated with the uid or an internal system object is damaged.

[EINVAL]

The value of the uid argument is not valid. Following are possible reasons:

  • Out of range.
  • Not associated with a user profile.
[ENOTSUP]

Operation not supported. The user profile associated with this uid specifies OWNER(*GRPPRF), but the user profile's first group is not the current effective group, nor is it in the list of supplemental groups.

[EPERM]

Operation not permitted. The thread does not have *USE authority to the user profile and the uid to be set is not the same as the real, effective, or saved user IDs.

[EUNKNOWN]

An unknown error has occurred. Check the joblog for error messages.



API introduced: V4R5

[ Back to top | UNIX-Type APIs | APIs by category ]