summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/setuid.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/setuid.2')
-rw-r--r--lib/libc/sys/setuid.245
1 files changed, 42 insertions, 3 deletions
diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2
index 383a8f5..1f24fb0 100644
--- a/lib/libc/sys/setuid.2
+++ b/lib/libc/sys/setuid.2
@@ -30,6 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)setuid.2 8.1 (Berkeley) 6/4/93
+.\" $Id: setuid.2,v 1.10 1997/04/01 18:58:38 mpp Exp $
.\"
.Dd June 4, 1993
.Dt SETUID 2
@@ -58,9 +59,22 @@ function
sets the real and effective
user IDs and the saved set-user-ID of the current process
to the specified value.
+.\" Comment out next block for !_POSIX_SAVED_IDS
+.\" The real user ID and the saved set-user-ID are changed only if the
+.\" effective user ID is that of the super user.
+.\" I.e.
+.\" .Fn setuid
+.\" function is equal to
+.\" .Fn seteuid
+.\" function if the effective user ID is not that of the super user.
+.\" End of block
The
.Fn setuid
function is permitted if the specified ID is equal to the real user ID
+.\" Comment out next line for !_POSIX_SAVED_IDS
+.\" or the saved set-user-ID
+.\" Next line is for Appendix B.4.2.2 case.
+or the effective user ID
of the process, or if the effective user ID is that of the super user.
.Pp
The
@@ -69,9 +83,22 @@ function
sets the real and effective
group IDs and the saved set-group-ID of the current process
to the specified value.
+.\" Comment out next block for !_POSIX_SAVED_IDS
+.\" The real group ID and the saved set-group-ID are changed only if the
+.\" effective user ID is that of the super user.
+.\" I.e.
+.\" .Fn setgid
+.\" function is equal to
+.\" .Fn setegid
+.\" function if the effective user ID is not that of the super user.
+.\" End of block
The
.Fn setgid
function is permitted if the specified ID is equal to the real group ID
+.\" Comment out next line for !_POSIX_SAVED_IDS
+.\" or the saved set-groupd-ID
+.\" Next line is for Appendix B.4.2.2 case.
+or the effective group ID
of the process, or if the effective user ID is that of the super user.
.Pp
The
@@ -99,18 +126,23 @@ If the user is not the super user, or the uid
specified is not the real, effective ID, or saved ID,
these functions return \-1.
.Sh SEE ALSO
+.Xr getgid 2 ,
.Xr getuid 2 ,
-.Xr getgid 2
+.Xr issetugid 2 ,
+.Xr setregid 2 ,
+.Xr setreuid 2
.Sh STANDARDS
The
.Fn setuid
and
.Fn setgid
functions are compliant with the
-.St -p1003.1-88
+.St -p1003.1-90
specification with
.Li _POSIX_SAVED_IDS
-not defined.
+.\" Uncomment next line for !_POSIX_SAVED_IDS
+not
+defined with the permitted extensions from Appendix B.4.2.2.
The
.Fn seteuid
and
@@ -120,3 +152,10 @@ functions are extensions based on the
concept of
.Li _POSIX_SAVED_IDS ,
and have been proposed for a future revision of the standard.
+.Sh HISTORY
+A
+.Fn setuid
+and a
+.Fn setgid
+function calls appeared in
+.At v7 .
OpenPOWER on IntegriCloud