A NOTE has been added to this issue. ====================================================================== https://www.austingroupbugs.net/view.php?id=1344 ====================================================================== Reported By: mkerrisk Assigned To: ajosey ====================================================================== Project: 1003.1(2008)/Issue 7 Issue ID: 1344 Category: System Interfaces Type: Enhancement Request Severity: Editorial Priority: normal Status: Under Review Name: Michael Kerrisk Organization: man7.org User Reference: Section: XSH Page Number: n/a Line Number: n/a Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2020-05-20 10:34 UTC Last Modified: 2020-05-21 13:02 UTC ====================================================================== Summary: Addition of setresuid()/setresgid()/getresuid()/getresgid() ======================================================================
---------------------------------------------------------------------- (0004878) mkerrisk (reporter) - 2020-05-21 13:02 https://www.austingroupbugs.net/view.php?id=1344#c4878 ---------------------------------------------------------------------- On page 448 (<unistd.h> Declarations), after line 15419, insert <blockquote> <pre> int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); </pre> </blockquote> On page 448 (<unistd.h> Declarations), after line 15443, insert <blockquote> <pre> int setresgid(gid_t rgid, gid_t egid, gid_t sgid); int setresuid(uid_t ruid, uid_t euid, uid_t suid); </pre> </blockquote> On page 451 (<unistd.h> SEE ALSO) at lines 15579-15581, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1028 (getegid() SEE ALSO) at line 35033, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1032 (geteuid() SEE ALSO) at line 35171, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1033 (getgid() SEE ALSO) at line 35210, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1104 (getuid() SEE ALSO) at line 37410, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1890 (setegid() SEE ALSO) at line 61214, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1893 (seteuid() SEE ALSO) at line 61308, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1894 (setgid() SEE ALSO) at line 61345, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1917 (setregid() SEE ALSO) at line 61847, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1919 (setreuid() SEE ALSO) at line 61908, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> On page 1929 (setuid() SEE ALSO) at line 62155, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> (Depending on whether these APIs should be part of XSI_USER_GROUPS) On page 3794 (Subprofiling Option Groups) at lines 130234-130234, insert the following entries into the list in sorted order: <blockquote> getresgid(), getresuid(), setresgid(), setresuid() </blockquote> At page 1086, insert the specifications for getresuid() and getresgid(): <blockquote> <b>NAME</b> getresgid - get real group ID, effective group ID, and saved set-group-ID <b>SYNOPSIS</b> <pre> #include <unistd.h> int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); </pre> <b>DESCRIPTION</b> The <i>getresgid()</i> function shall return the calling process's real group ID, effective group ID, and saved set-group-ID, storing them in the locations pointed to by, respectively, the arguments <i>rgid</i>, <i>egid</i>, and <i>sgid</i>. <b>RETURN VALUE</b> Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. <b>ERRORS</b> No errors are defined. <b>SEE ALSO</b> <i>getegid()</i>, <i>geteuid()</i>, <i>getgid()</i>, <i>getresuid()</i>, <i>getuid()</i>, <i>setegid()</i>, <i>setgid()</i>, <i>seteuid()</i>, <i>setregid()</i>, <i>setresgid()</i>, <i>setresuid()</i>, <i>setreuid()</i>, <i>setuid()</i> <b>XBD <sys/types.h>, <unistd.h></b> <b>NAME</b> getresuid - get real user ID, effective user ID, and saved set-user-ID <b>SYNOPSIS</b> <pre> #include <unistd.h> int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); </pre> <b>DESCRIPTION</b> The <i>getresuid()</i> function shall return the calling process's real user ID, effective user ID, and saved set-user-ID, storing them in the locations pointed to by, respectively, the arguments <i>ruid</i>, <i>euid</i>, and <i>suid</i>. <b>RETURN VALUE</b> Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. <b>ERRORS</b> No errors are defined. <b>SEE ALSO</b> <i>getegid()</i>, <i>geteuid()</i>, <i>getgid()</i>, <i>getresgid()</i>, <i>getuid()</i>, <i>setegid()</i>, <i>setgid()</i>, <i>seteuid()</i>, <i>setregid()</i>, <i>setresgid()</i>, <i>setresuid()</i>, <i>setreuid()</i>, <i>setuid()</i> <b>XBD <sys/types.h>, <unistd.h></b> </blockquote> At page 1918, insert the specifications for setresuid() and setresgid(): <blockquote> <b>NAME</b> setresgid - set real group ID, effective group ID, and saved set-group-ID <b>SYNOPSIS</b> <pre> #include <unistd.h> int setresgid(gid_t rgid, gid_t egid, gid_t sgid); </pre> <b>DESCRIPTION</b> The <i>setresgid()</i> function shall change the calling process's real group ID, effective group ID, and saved set-group-ID, respectively, to the values specified by <i>rgid</i>, <i>egid</i>, and <i>sgid</i>. If one of the arguments is -1, the corresponding group ID shall not be changed. Only a process with appropriate privileges can set the real group <b>ID, effective group ID, and saved set-group-ID to any valid value.</b> A non-privileged process may set its real group ID, effective group ID, and saved set-group-ID, each to one of the values that it currently holds in its real group ID, effective group ID, or saved set-group-ID. The real group ID, effective group ID, and saved set-group-ID may be set to different values in the same call. <b>RETURN VALUE</b> Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error, and none of the group IDs shall be changed. <b>ERRORS</b> The <i>setresgid()</i> function shall fail if: [EINVAL] The value of the <i>rgid</i>, <i>egid</i>, or <i>sgid</i> argument is invalid or out-of-range. [EPERM] The calling process does not have appropriate privileges, and an attempt was made to change the real group ID, effective group ID, or saved set-group-ID to a value that is not currently present in one of those IDs. <b>SEE ALSO</b> <i>getegid()</i>, <i>geteuid()</i>, <i>getgid()</i>, <i>getresgid()</i>, <i>getresuid()</i>, <i>getuid()</i>, <i>setegid()</i>, <i>seteuid()</i>, <i>setgid()</i>, <i>setregid()</i>, <i>setresuid()</i>, <i>setreuid()</i>, <i>setuid()</i> <b>XBD <sys/types.h>, <unistd.h></b> <b>NAME</b> setresuid - set real user ID, effective user ID, and saved set-user-ID <b>SYNOPSIS</b> <pre> #include <unistd.h> int setresuid(uid_t ruid, uid_t euid, uid_t suid); </pre> <b>DESCRIPTION</b> The <i>setresuid()</i> function shall change the calling process's real user ID, effective user ID, and saved set-user-ID, respectively, to the values specified by <i>ruid</i>, <i>euid</i>, and <i>suid</i>. If one of the arguments is -1, the corresponding user ID shall not be changed. Only a process with appropriate privileges can set the real user ID, effective user ID, and saved set-user-ID to any valid value. A non-privileged process may set its real user ID, effective user ID, and saved set-user-ID, each to one of the values that it currently holds in its real user ID, effective user ID, or saved set-user-ID. The real user ID, effective user ID, and saved set-user-ID may be set to different values in the same call. <b>RETURN VALUE</b> Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error, and none of the user IDs shall be changed. <b>ERRORS</b> The <i>setresuid()</i> function shall fail if: [EINVAL] The value of the <i>ruid</i>, <i>euid</i>, or <i>suid</i> argument is invalid or out-of-range. [EPERM] The calling process does not have appropriate privileges, and an attempt was made to change the real user ID, effective user ID, or saved set-user-ID to a value that is not currently present in one of those IDs. <b>SEE ALSO</b> <i>getegid()</i>, <i>geteuid()</i>, <i>getgid()</i>, <i>getresgid()</i>, <i>getresuid()</i>, <i>getuid()</i>, <i>setegid()</i>, <i>seteuid()</i>, <i>setgid()</i>, <i>setregid()</i>, <i>setresgid()</i>, <i>setreuid()</i>, <i>setuid()</i> XBD <sys/types.h>, <unistd.h> </blockquote> Issue History Date Modified Username Field Change ====================================================================== 2020-05-20 10:34 mkerrisk New Issue 2020-05-20 10:34 mkerrisk Status New => Under Review 2020-05-20 10:34 mkerrisk Assigned To => ajosey 2020-05-20 10:34 mkerrisk Name => Michael Kerrisk 2020-05-20 10:34 mkerrisk Organization => man7.org 2020-05-20 10:34 mkerrisk Section => XSH 2020-05-20 10:34 mkerrisk Page Number => n/a 2020-05-20 10:34 mkerrisk Line Number => n/a 2020-05-21 12:51 mkerrisk Note Added: 0004875 2020-05-21 12:57 mkerrisk Note Added: 0004876 2020-05-21 12:58 mkerrisk Note Deleted: 0004875 2020-05-21 12:59 mkerrisk Note Deleted: 0004876 2020-05-21 12:59 mkerrisk Note Added: 0004877 2020-05-21 12:59 mkerrisk Note Deleted: 0004877 2020-05-21 13:02 mkerrisk Note Added: 0004878 ======================================================================