Set*id system calls SetXid programs are running with effective uid/gid, but original uid/gid are still known to the program. Thus a setXid program can easily get back to the original uid/gid settings. Useful system calls include: setuid( uid ); setgid( gid ); Set real id (and effective/saved/fs iff root) setreuid( ruid, euid ); setregid( rgid, egid ); set real and effective ids (can use -1 to indicate no change) setresuid( ruid, euid, suid ); setresgid( rgid, egid, sgid ); set real, effective, and saved ids (can use -1 to indicate no change)