United States-English |
|
|
HP-UX Reference > Ssetresuid(2)HP-UX 11i Version 3: February 2007 |
|
NAMEsetresuid, setresgid — set real, effective, and saved user and group IDs SYNOPSIS#include <unistd.h> int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); DESCRIPTIONsetresuid() sets the real, effective and/or saved user ID of the calling process. If the current real, effective or saved user ID is equal to that of a user having appropriate privileges, setresuid() sets the real, effective and saved user IDs to ruid, euid, and suid, respectively. Otherwise, setresuid() only sets the real, effective, and saved user IDs if ruid, euid, and suid each match at least one of the current real, effective, or saved user IDs. If ruid, euid, or suid is -1, setresuid() leaves the current real, effective or saved user ID unchanged. setresgid() sets the real, effective and/or saved group ID of the calling process. If the current real, effective or saved user ID is equal to that of a user having appropriate privileges, setresgid() sets the real, effective, and saved group ID to rgid, egid, and sgid, respectively. Otherwise, setresgid() only sets the real, effective and saved group ID if rgid, egid, and sgid each match at least one of the current real, effective or saved group ID. If rgid, egid, or sgid is -1, setresgid() leaves the current real, effective or saved group ID unchanged. Security RestrictionsSome or all of the actions associated with this system call require the PRIV_CHSUBJIDENT privilege (CHSUBJIDENT). Processes owned by the superuser will 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, setresuid() and setresgid() return 0; otherwise, they return -1 and set errno to indicate the error. |
Printable version | ||
|