Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setuid(2) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getuid(2)

intro(2)

setregid(2)

setreuid(2)




setuid(2) setuid(2)
NAME setuid, setgid - set user and group ID SYNOPSIS #include <sys/types.h> uid_t setuid(uid) uid_t uid; int setgid(gid) gid_t gid; DESCRIPTION setuid sets the real user ID, effective user ID, and saved set-user-ID of the calling process. If the effective user ID of the calling process is superuser, the real user ID, effective user ID, and saved set-user-ID are set to uid. If the effective user ID of the calling process is not the superuser, but its real user ID is equal to uid, the effective user ID is set to uid. If the effective user ID of the calling process is not the superuser, but the saved set-user-ID from exec(2) is equal to uid, the effective user ID is set to uid. setgid sets the real group ID, effective group ID, and saved set-group-ID of the calling process. If the effective user ID of the calling process is the superuser, the real group ID, effective group ID, and saved set-group-ID are set to gid. If the effective user ID of the calling process is not the superuser, but its real group ID is equal to gid, the effective group ID is set to gid. If the effective user ID of the calling process is not the superuser, but the saved set-group-ID from exec(2) is equal to gid, the effective group ID is set to gid. STATUS MESSAGES AND VALUES On successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. The setuid or setgid commands will fail if one or more of the following is true: EPERM The real user or group ID of the calling process is not equal to uid or gid and its effective user ID is not the superuser. January 1992 1



setuid(2) setuid(2)
EINVAL uid is out of range. SEE ALSO getuid(2), intro(2), setregid(2), setreuid(2) 2 January 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026