Skip to contentSkip to conversation

seteuid.2: glibc implements seteuid calling setresuid, not setreuid

PATCH In review Štěpán Němec 2 participants 2 messages Feb 7, 2024 – Feb 11, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seteuid.2: glibc implements seteuid calling setresuid, not setreuid

Analogously with set*gid.

This has been the case since more than two decades, e.g.:

commit eae59a5681a6 glibc-2.3.2-793-geae59a5681a6
Commit: Ulrich Drepper <[email protected]>
CommitDate: Sun Jun 8 22:37:53 2003 +0000

Update.

* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Use setresuid32 syscall directly if possible. If __ASSUME_SETRESUID_SYSCALL is defined drop compatibility code.
[...]

The change in implementation from setreuid/setregid is also already mentioned two paragraphs earlier in the same man page.

Fixes a36b2bb0eca4 ("seteuid.2: seteuid() and setegid() are implemented as library functions")
Fixes 8554dd0324b0 ("seteuid.2: tfix")
---
 man2/seteuid.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man2/seteuid.2 +2 -2
index 312ed1f9e002..0eae04f79fc9 100644
@@ -117,9 +117,9 @@ .SS C library/kernel differences
 and
 .BR setegid ()
 are implemented as library functions that call, respectively,
-.BR setreuid (2)
+.BR setresuid (2)
 and
-.BR setregid (2).
+.BR setresgid (2).
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY

base-commit: 452f15569fc3cb1697b6482754dd51a56fcab970
prerequisite-patch-id: 79eb7cb4939079d7fa9f00007856784f30801886

Signature · 1 line
2.43.0
#1 lore raw

Hi Štěpán,

Quoted 15 lines · Štěpán Němec

Analogously with set*gid.

This has been the case since more than two decades, e.g.:

commit eae59a5681a6 glibc-2.3.2-793-geae59a5681a6
Commit: Ulrich Drepper <[email protected]>
CommitDate: Sun Jun 8 22:37:53 2003 +0000

Update.

* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Use setresuid32 syscall directly if possible. If __ASSUME_SETRESUID_SYSCALL is defined drop compatibility code.
[...]

Quoted 6 lines

The change in implementation from setreuid/setregid is also already mentioned two paragraphs earlier in the same man page.

Fixes a36b2bb0eca4 ("seteuid.2: seteuid() and setegid() are implemented as library functions")
Fixes 8554dd0324b0 ("seteuid.2: tfix")

Patch applied. Thanks.

Have a lovely day!
Alex

Quoted 26 lines
---
 man2/seteuid.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man2/seteuid.2 +2 -2
index 312ed1f9e002..0eae04f79fc9 100644
@@ -117,9 +117,9 @@ .SS C library/kernel differences
 and
 .BR setegid ()
 are implemented as library functions that call, respectively,
-.BR setreuid (2)
+.BR setresuid (2)
 and
-.BR setregid (2).
+.BR setresgid (2).
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY

base-commit: 452f15569fc3cb1697b6482754dd51a56fcab970
prerequisite-patch-id: 79eb7cb4939079d7fa9f00007856784f30801886

Signature · 1 line
2.43.0
Signature · 2 lines
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.