|
|
HP-UX Reference > Ssetuid(2)HP-UX 11i Version 2: December 2007 Update |
|
NAMEsetuid(), setgid() — set user and group IDs DESCRIPTIONsetuid() sets the real-user-ID (ruid), effective-user-ID (euid), and/or saved-user-ID (suid) of the calling process. If the Security Containment product is installed, these interfaces treat a process observing CHSUBJIDENT as a privileged process. Otherwise, only processes with an euid of zero are treated as privileged processes. See privileges(5) for more information on Security Containment and fine-grained privileges. The following conditions govern setuid's behavior:
setgid() sets the real-group-ID (rgid), effective-group-ID (egid), and/or saved-group-ID (sgid) of the calling process. The following conditions govern setgid()'s behavior:
Security RestrictionsSome or all of the actions associated with this system call require the CHSUBJIDENT privilege. Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUEUpon successful completion, setuid() and setgid() return 0. Otherwise, they return -1 and set errno to indicate the error. ERRORSsetuid() and setgid() fail and return -1 if any of the following conditions are encountered:
WARNINGSIt is recommended that the PRIV_SETRUGID capability be avoided, as it is provided for backward compatibility. This feature may be modified or dropped from future HP-UX releases. When changing the real user ID and real group ID, use of setresuid() and setresgid() (see setresuid(2)) is recommended instead. |
|