summaryrefslogtreecommitdiff
path: root/lib/libc/sys/setuid.2
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-02-27 12:31:34 +0000
committercgd <cgd@NetBSD.org>1995-02-27 12:31:34 +0000
commit4eab61bd40c07b2fc612ad50cface2b77fc110d0 (patch)
tree7118747f1d9919499fdea5d7c6908c5cfe04e5a8 /lib/libc/sys/setuid.2
parentc67e54a2e2b9f3d455a30d68ea4e09e56d7b9136 (diff)
merge with lite, keeping most local changes. clean up Ids
Diffstat (limited to 'lib/libc/sys/setuid.2')
-rw-r--r--lib/libc/sys/setuid.261
1 files changed, 35 insertions, 26 deletions
diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2
index 5c6a634475f..deca532b388 100644
--- a/lib/libc/sys/setuid.2
+++ b/lib/libc/sys/setuid.2
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983, 1991 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: setuid.2,v 1.3 1995/02/27 12:37:06 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)setuid.3 6.4 (Berkeley) 4/19/91
-.\" $Id: setuid.2,v 1.2 1994/04/10 00:16:58 cgd Exp $
+.\" @(#)setuid.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd April 19, 1991
+.Dd June 4, 1993
.Dt SETUID 2
.Os BSD 4.2
.Sh NAME
@@ -55,46 +56,54 @@
.Sh DESCRIPTION
The
.Fn setuid
-function sets the real and effective user IDs and the saved
-set-user-ID of the current process to the specified value. The
+function
+sets the real and effective
+user IDs and the saved set-user-ID of the current process
+to the specified value.
+The
.Fn setuid
-function is permitted if the specified ID is equal to the real user ID of
-the process, or if the effective user ID is that of the super user.
+function is permitted if the specified ID is equal to the real user ID
+of the process, or if the effective user ID is that of the super user.
.Pp
The
.Fn setgid
-function sets the real and effective group IDs and the saved
-set-group-ID of the current process to the specified value. The
+function
+sets the real and effective
+group IDs and the saved set-group-ID of the current process
+to the specified value.
+The
.Fn setgid
function is permitted if the specified ID is equal to the real group ID
of the process, or if the effective user ID is that of the super user.
.Pp
The
.Fn seteuid
-function sets the effective user ID
-of the current process. The effective user ID may be set to the value of
-the real user ID or the saved set-user-ID (see
-.Xr intro 2
+function
+.Pq Fn setegid
+sets the effective user ID (group ID) of the
+current process.
+The effective user ID may be set to the value
+of the real user ID or the saved set-user-ID (see
+.Xr intro 2
and
-.Xr execve 2 );
-in this way, the effective user ID of a set-user-ID executable may be
-toggled by switching to the real user ID, then re-enabled by reverting to
-the set-user-ID value.
-Similarly, with
-.Fn setegid
-the effective group ID may be set to
-the value of the real group ID or the saved set-user-ID.
+.Xr execve 2 ) ;
+in this way, the effective user ID of a set-user-ID executable
+may be toggled by switching to the real user ID, then re-enabled
+by reverting to the set-user-ID value.
+Similarly, the effective group ID may be set to the value
+of the real group ID or the saved set-user-ID.
+.Pp
.Sh RETURN VALUES
Upon success, these functions return 0;
otherwise \-1 is returned.
.Pp
-If the user is not the super user, or the uid (gid) specified is not
-the real ID, effective ID, or saved ID of the process,
+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 getuid 2 ,
.Xr getgid 2
-.Sh HISTORY
+.Sh STANDARDS
The
.Fn setuid
and