1 .\" $NetBSD: do_setresuid.9,v 1.3 2004/10/04 19:09:28 rumble Exp $
4 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" This code is derived from software contributed to The NetBSD Foundation
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
19 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 .\" POSSIBILITY OF SUCH DAMAGE.
31 .Dd September 28, 2003
37 .Nd set process uid and gid
41 .Fn do_setresuid "struct lwp *lwp" "uid_t ruid" "uid_t euid" "uid_t svuid" "u_int flags"
43 .Fn do_setresgid "struct lwp *lwp" "uid_t ruid" "uid_t euid" "uid_t svuid" "u_int flags"
49 functions are used to implement the various system calls that allow a
50 process to change its real, effective, and saved uid and gid values.
54 function sets the specified processes real user ID to
56 its effective user ID to
58 and its saved user ID to
60 If any of the uid arguments are \-1 then that assignment is skipped.
64 is true, then any values may be assigned, otherwise the new uid
65 values must match one of the existing values and the caller must have
66 set the relevant bit in
71 argument specifies which of the existing uid values the new value must match.
72 It should be set to a logical OR of ID_{R,E,S}_EQ_{R,E,S}, where ID_E_EQ_R
73 means that it is valid to set the effective ID to the current value of the
78 function sets the group IDs but otherwise behaves in the same manner as
80 The processes group list is neither examined nor effected.
87 These functions are implemented in:
88 .Pa sys/kern/kern_prot.c .
92 to replace ad-hoc code in each system call routine and in the
93 various compat modules.