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"
40 seteuid, setegid \- 実効ユーザー ID や 実効グループ ID を設定する
42 .B #include <sys/types.h>
44 .B #include <unistd.h>
46 .BI "int seteuid(uid_t " euid );
48 .BI "int setegid(gid_t " egid );
52 .RB ( feature_test_macros (7)
60 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
65 は呼び出し元のプロセスの実効ユーザー ID を設定する。
66 非特権ユーザーのプロセスの場合、実効ユーザー ID に設定できるのは、
67 実ユーザー ID・実効ユーザー ID・保存 set-user-ID のいずれかだけである。
70 は「ユーザー」ではなく「グループ」に対して全く同じことを行う。
73 .\" equals \-1, nothing is changed.
74 .\" (This is an artifact of the implementation in glibc of seteuid()
75 .\" using setresuid(2).)
90 が実ユーザー (グループ) ID、または実効ユーザー (グループ) ID、
91 保存 set-user-ID (保存 set-group-ID) のいずれでもではない
96 ケーパビリティ (capability) が、
100 ケーパビリティがない場合に、特権がないと判断される)。
102 4.3BSD, POSIX.1-2001.
104 実効ユーザー (グループ) ID を保存 set-user-ID (保存 set-group-ID) に
105 設定できるのは、Linux 1.1.37 (1.1.38) 以降である。
110 libc4, libc5, glibc 2.0 では、
113 .BI setreuid(\-1, " euid" )
114 と等価であり、保存 set-user-ID を変更するかもしれない。
116 .BI setresuid(\-1, " euid" ", \-1)"
117 と等価であり、保存 set-user-ID 変更しない。
128 として現在の実効ユーザ (グループ) ID と同じ値を指定可能である
129 必要はないとされており、いくつかの実装では
132 として現在の実効ユーザ (グループ) ID と同じ値を
139 .BR capabilities (7),