Visible to Intel only — GUID: GUID-D9359570-C9C6-4A8A-8525-FEBB00585746
Visible to Intel only — GUID: GUID-D9359570-C9C6-4A8A-8525-FEBB00585746
PXFSETUID
POSIX Subroutine: Sets the effective user ID of the current process. This routine is only available for Linux and macOS.
USE IFPOSIX
CALL PXFSETUID (iuid,ierror)
iuid |
(Output) INTEGER(4). The session ID. |
ierror |
(Output) INTEGER(4). The user status. |
If successful, ierror is set to zero; otherwise, an error code.
If the effective user ID of the caller is root, the real and saved user ID's are also set. This feature allows a program other than root to drop all of its user privileges, do some un-privileged work, and then re-engage the original effective user ID in a secure manner.
If the user is root then special care must be taken. PXFSETUID checks the effective uid of the caller. If it is the superuser, all process-related user ID's are set to uid. After this has occurred, it is impossible for the program to regain root privileges.