Skip to content

Commit baf65b1

Browse files
authored
Add more documentation about setuid and friends. (#1383)
These functions can't be implemented in rustix becuse they require the implementation to be aware of all threads in the program and to be able to use reserved signal values.
1 parent 9c522fd commit baf65b1

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

src/not_implemented.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ pub mod libc_internals {
7878
not_implemented!(tkill);
7979
not_implemented!(sched_setscheduler);
8080
not_implemented!(rseq);
81+
not_implemented!(setuid);
82+
not_implemented!(setgid);
83+
not_implemented!(seteuid);
84+
not_implemented!(setegid);
85+
not_implemented!(setreuid);
86+
not_implemented!(setregid);
87+
not_implemented!(setresuid);
88+
not_implemented!(setresgid);
89+
not_implemented!(setgroups);
8190

8291
not_implemented!(pthread_atfork);
8392
not_implemented!(pthread_attr_destroy);

src/thread/id.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ pub fn gettid() -> Pid {
5757
///
5858
/// # Warning
5959
///
60-
/// This is not the setxid you are looking for… POSIX requires xids to be
60+
/// This is not the `setuid` you are looking for… POSIX requires uids to be
6161
/// process granular, but on Linux they are per-thread. Thus, this call only
62-
/// changes the xid for the current *thread*, not the entire process even
62+
/// changes the uid for the current *thread*, not the entire process even
6363
/// though that is in violation of the POSIX standard.
6464
///
6565
/// For details on this distinction, see the C library vs. kernel differences
@@ -83,9 +83,9 @@ pub fn set_thread_uid(uid: Uid) -> io::Result<()> {
8383
///
8484
/// # Warning
8585
///
86-
/// This is not the setresxid you are looking for… POSIX requires xids to be
86+
/// This is not the `setresuid` you are looking for… POSIX requires uids to be
8787
/// process granular, but on Linux they are per-thread. Thus, this call only
88-
/// changes the xid for the current *thread*, not the entire process even
88+
/// changes the uid for the current *thread*, not the entire process even
8989
/// though that is in violation of the POSIX standard.
9090
///
9191
/// For details on this distinction, see the C library vs. kernel differences
@@ -106,9 +106,9 @@ pub fn set_thread_res_uid(ruid: Uid, euid: Uid, suid: Uid) -> io::Result<()> {
106106
///
107107
/// # Warning
108108
///
109-
/// This is not the setxid you are looking for… POSIX requires xids to be
109+
/// This is not the `setgid` you are looking for… POSIX requires gids to be
110110
/// process granular, but on Linux they are per-thread. Thus, this call only
111-
/// changes the xid for the current *thread*, not the entire process even
111+
/// changes the gid for the current *thread*, not the entire process even
112112
/// though that is in violation of the POSIX standard.
113113
///
114114
/// For details on this distinction, see the C library vs. kernel differences
@@ -132,9 +132,9 @@ pub fn set_thread_gid(gid: Gid) -> io::Result<()> {
132132
///
133133
/// # Warning
134134
///
135-
/// This is not the setresxid you are looking for… POSIX requires xids to be
135+
/// This is not the `setresgid` you are looking for… POSIX requires gids to be
136136
/// process granular, but on Linux they are per-thread. Thus, this call only
137-
/// changes the xid for the current *thread*, not the entire process even
137+
/// changes the gid for the current *thread*, not the entire process even
138138
/// though that is in violation of the POSIX standard.
139139
///
140140
/// For details on this distinction, see the C library vs. kernel differences

0 commit comments

Comments
 (0)