OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / seteuid.2
1 .\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" [should really be seteuid.3]
24 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
25 .\"     Added notes on capability requirements
26 .\"
27 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .TH SETEUID 2 2009\-10\-17 Linux "Linux Programmer's Manual"
33 .SH 名前
34 seteuid, setegid \- 実効ユーザー ID や 実効グループ ID を設定する
35 .SH 書式
36 \fB#include <sys/types.h>\fP
37 .br
38 \fB#include <unistd.h>\fP
39 .sp
40 \fBint seteuid(uid_t \fP\fIeuid\fP\fB);\fP
41 .br
42 \fBint setegid(gid_t \fP\fIegid\fP\fB);\fP
43 .sp
44 .in -4n
45 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
46 .in
47 .sp
48 .ad l
49 \fBseteuid\fP(), \fBsetegid\fP():
50 .RS 4
51 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
52 .RE
53 .ad
54 .SH 説明
55 \fBseteuid\fP()  は呼び出し元のプロセスの実効ユーザー ID を設定する。 非特権ユーザーのプロセスの場合、実効ユーザー ID
56 に設定できるのは、 実ユーザー ID・実効ユーザー ID・保存 set\-user\-ID のいずれかだけである。
57
58 .\" When
59 .\" .I euid
60 .\" equals \-1, nothing is changed.
61 .\" (This is an artifact of the implementation in glibc of seteuid()
62 .\" using setresuid(2).)
63 \fBsetegid\fP()  は「ユーザー」ではなく「グループ」に対して全く同じことを行う。
64 .SH 返り値
65 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
66 .SH エラー
67 .\" .TP
68 .\" .B EINVAL
69 .TP 
70 \fBEPERM\fP
71 呼び出し元のプロセスに特権がなく、 \fIeuid\fP (\fIegid\fP)  が実ユーザー (グループ) ID、または実効ユーザー (グループ) ID、
72 保存 set\-user\-ID (保存 set\-group\-ID) のいずれでもではない (Linux においては、 \fBseteuid\fP()  では
73 \fBCAP_SETUID\fP ケーパビリティ (capability) が、 \fBsetegid\fP()  では \fBCAP_SETGID\fP
74 ケーパビリティがない場合に、特権がないと判断される)。
75 .SH 準拠
76 4.3BSD, POSIX.1\-2001.
77 .SH 注意
78 実効ユーザー (グループ) ID を保存 set\-user\-ID (保存 set\-group\-ID) に 設定できるのは、Linux 1.1.37
79 (1.1.38) 以降である。 全てのシステムにおいて \fB_POSIX_SAVED_IDS\fP をチェックすべきである。
80 .LP
81 libc4, libc5, glibc 2.0 では、 \fBseteuid(\fP\fIeuid\fP\fB)\fP は \fBsetreuid(\-1,\fP\fI
82 euid\fP\fB)\fP と等価であり、保存 set\-user\-ID を変更するかもしれない。 glibc 2.1 では、
83 \fBsetresuid(\-1,\fP\fI euid\fP\fB, \-1)\fP と等価であり、保存 set\-user\-ID 変更しない。 同様のことが
84 \fBsetegid\fP()  にも言える。
85
86 POSIX.1 では、 \fBseteuid\fP()  (\fBsetegid\fP())  で、 \fIeuid\fP (\fIegid\fP)  として現在の実効ユーザ
87 (グループ) ID と同じ値を指定可能である 必要はないとされており、いくつかの実装では \fIeuid\fP (\fIegid\fP)  として現在の実効ユーザ
88 (グループ) ID と同じ値を 指定することができない。
89 .SH 関連項目
90 \fBgeteuid\fP(2), \fBsetresuid\fP(2), \fBsetreuid\fP(2), \fBsetuid\fP(2),
91 \fBcapabilities\fP(7), \fBcredentials\fP(7)