1 .\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" [should really be seteuid.3]
24 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
25 .\" Added notes on capability requirements
27 .\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO
28 .\" all rights reserved.
29 .\" Translated 2001-06-04, Yuichi SATO <ysato@h4.dion.ne.jp>
30 .\" Updated & Modified 2005-01-04, Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated 2010-04-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
33 .\"WORD: effective user ID 実効ユーザー ID
34 .\"WORD: real user ID 実ユーザー ID
35 .\"WORD: saved user ID 保存ユーザー ID
38 .TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
41 .\"O seteuid, setegid \- set effective user or group ID
42 seteuid, setegid \- 実効ユーザー ID や 実効グループ ID を設定する
45 .B #include <sys/types.h>
47 .B #include <unistd.h>
49 .BI "int seteuid(uid_t " euid );
51 .BI "int setegid(gid_t " egid );
54 .\"O Feature Test Macro Requirements for glibc (see
55 .\"O .BR feature_test_macros (7)):
57 .RB ( feature_test_macros (7)
65 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
71 .\"O sets the effective user ID of the calling process.
72 .\"O Unprivileged user processes may only set the effective user ID to the
73 .\"O real user ID, the effective user ID or the saved set-user-ID.
75 は呼び出し元のプロセスの実効ユーザー ID を設定する。
76 非特権ユーザーのプロセスの場合、実効ユーザー ID に設定できるのは、
77 実ユーザー ID・実効ユーザー ID・保存 set-user-ID のいずれかだけである。
79 .\"O Precisely the same holds for
81 .\"O with "group" instead of "user".
83 は「ユーザー」ではなく「グループ」に対して全く同じことを行う。
86 .\" equals \-1, nothing is changed.
87 .\" (This is an artifact of the implementation in glibc of seteuid()
88 .\" using setresuid(2).)
89 .\"O .SH "RETURN VALUE"
91 .\"O On success, zero is returned.
92 .\"O On error, \-1 is returned, and
94 .\"O is set appropriately.
106 .\"O The calling process is not privileged (Linux: does not have the
108 .\"O capability in the case of
112 .\"O capability in the case of
118 .\"O is not the real user (group) ID, the effective user (group) ID,
119 .\"O or the saved set-user-ID (saved set-group-ID).
123 が実ユーザー (グループ) ID、または実効ユーザー (グループ) ID、
124 保存 set-user-ID (保存 set-group-ID) のいずれでもではない
129 ケーパビリティ (capability) が、
133 ケーパビリティがない場合に、特権がないと判断される)。
134 .\"O .SH "CONFORMING TO"
136 4.3BSD, POSIX.1-2001.
139 .\"O Setting the effective user (group) ID to the
140 .\"O saved set-user-ID (set-group-ID) is
141 .\"O possible since Linux 1.1.37 (1.1.38).
142 .\"O On an arbitrary system one should check
143 .\"O .BR _POSIX_SAVED_IDS .
144 実効ユーザー (グループ) ID を保存 set-user-ID (保存 set-group-ID) に
145 設定できるのは、Linux 1.1.37 (1.1.38) 以降である。
150 .\"O Under libc4, libc5 and glibc 2.0
151 .\"O .BI seteuid( euid )
152 .\"O is equivalent to
153 .\"O .BI setreuid(\-1, " euid" )
154 .\"O and hence may change the saved set-user-ID.
155 .\"O Under glibc 2.1 it is equivalent to
156 .\"O .BI setresuid(\-1, " euid" ", \-1)"
157 .\"O and hence does not change the saved set-user-ID.
158 .\"O Similar remarks hold for
160 libc4, libc5, glibc 2.0 では、
163 .BI setreuid(\-1, " euid" )
164 と等価であり、保存 set-user-ID を変更するかもしれない。
166 .BI setresuid(\-1, " euid" ", \-1)"
167 と等価であり、保存 set-user-ID 変更しない。
172 .\"O According to POSIX.1,
174 .\"O .RB ( setegid ())
178 .\"O to be the same value as the current effective user (group) ID,
179 .\"O and some implementations do not permit this.
186 として現在の実効ユーザ (グループ) ID と同じ値を指定可能である
187 必要はないとされており、いくつかの実装では
190 として現在の実効ユーザ (グループ) ID と同じ値を
198 .BR capabilities (7),