1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
27 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
28 .\" all rights reserved.
29 .\" Translated 1997-08-30, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
30 .\" Updated & Modified 2004-05-22, Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated & Modified 2005-01-04, Yuichi SATO
32 .\" Updated & Modified 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
33 .\" Updated & Modified 2005-11-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
35 .\"WORD: effective user ID 実効ユーザーID
36 .\"WORD: real user ID 実ユーザーID
37 .\"WORD: saved set-user-ID 保存セットユーザーID
38 .\"WORD: effective group ID 実効グループID
39 .\"WORD: real group ID 実グループID
40 .\"WORD: saved group ID 保存グループID
42 .TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
45 .\"O setresuid, setresgid \- set real, effective and saved user or group ID
46 setresuid, setresgid \- ユーザやグループの 実、実効、保存 ID を設定する
49 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
50 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */"
52 .B #include <unistd.h>
54 .BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid );
56 .BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid );
60 .\"O sets the real user ID, the effective user ID, and the
61 .\"O saved set-user-ID of the calling process.
63 は呼び出し元のプロセスの実 (real) ユーザーID、実効 (effective) ユーザーID、
66 .\"O Unprivileged user processes
67 .\"O may change the real UID,
68 .\"O effective UID and saved set-user-ID, each to one of:
69 .\"O the current real UID, the current effective UID or the
70 .\"O current saved set-user-ID.
71 非特権ユーザーのプロセスは、その実 UID、実効 UID、保存 set-user-ID を、
72 現在の実 UID、現在の実効 UID、現在の保存 set-user-ID
75 .\"O Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability)
76 .\"O may set the real UID, effective UID, and
77 .\"O saved set-user-ID to arbitrary values.
78 特権プロセス (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持つ
79 プロセス) は、実 UID、実効 UID、保存 set-user-ID を任意の値に設定できる。
81 .\"O If one of the arguments equals \-1, the corresponding value is not changed.
82 引き数のどれかが \-1 の場合はその値は変更されずに残される。
84 .\"O Regardless of what changes are made to the real UID, effective UID,
85 .\"O and saved set-user-ID, the file system UID is always set to the same
86 .\"O value as the (possibly new) effective UID.
87 実 UID、実効 UID、保存 set-user-ID にどんな変更が行われたかに関わらず、
88 ファイルシステム UID は常に実効 UID (可能であれば変更後の新しい実効 UID)
91 .\"O Completely analogously,
93 .\"O sets the real GID, effective GID, and saved set-group-ID
94 .\"O of the calling process (and always modifies the file system GID
95 .\"O to be the same as the effective GID),
96 .\"O with the same restrictions for unprivileged processes.
99 は呼び出し元のプロセスの実 GID、実効 GID、保存 set-group-ID を設定する
100 (さらにファイルシステム GID を実効 GID と同じ値に修正する)。
102 .\"O .SH "RETURN VALUE"
104 .\"O On success, zero is returned.
105 .\"O On error, \-1 is returned, and
107 .\"O is set appropriately.
108 成功した場合は 0 が返される。エラーの場合は \-1 が返され、
116 .\"O does not match the current UID and this call would
117 .\"O bring that user ID over its
128 .\"O The calling process is not privileged (did not have the \fBCAP_SETUID\fP
129 .\"O capability) and tried to change the IDs to values that are not permitted.
131 (\fBCAP_SETUID\fP ケーパビリティを持たないのに)、
132 ID を許されていない値に変更しようとした。
135 .\"O It is available under Linux since Linux 2.1.44.
136 Linux ではバージョン 2.1.44 より利用可能になった。
137 .\"O .SH "CONFORMING TO"
139 .\"O These calls are nonstandard;
140 .\"O they also appear on HP-UX and some of the BSDs.
142 HP-UX や BSD 系のいくつかにも存在する。
145 .\"O Under HP-UX and FreeBSD the prototype is found in
146 .\"O .IR <unistd.h> .
150 .\"O Under Linux the prototype is provided by glibc since version 2.3.2.
151 Linux では、glibc 2.3.2 以降で
161 .BR capabilities (7),