OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / setresuid.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
4 .\"
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.
8 .\"
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.
13 .\"
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
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
26 .\"
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>
34 .\"
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
41 .\"
42 .TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
43 .\"O .SH NAME
44 .SH Ì¾Á°
45 .\"O setresuid, setresgid \- set real, effective and saved user or group ID
46 setresuid, setresgid \- ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Î ¼Â¡¢¼Â¸ú¡¢Êݸ ID ¤òÀßÄꤹ¤ë
47 .\"O .SH SYNOPSIS
48 .SH ½ñ¼°
49 .B #define _GNU_SOURCE
50 .br
51 .B #include <unistd.h>
52 .sp
53 .BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid );
54 .br
55 .BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid );
56 .\"O .SH DESCRIPTION
57 .SH ÀâÌÀ
58 .\"O .BR setresuid ()
59 .\"O sets the real user ID, the effective user ID, and the
60 .\"O saved set-user-ID of the calling process.
61 .BR setresuid ()
62 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ID¡¢¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID¡¢
63 Êݸ set-user-ID ¤òÀßÄꤹ¤ë¡£
64
65 .\"O Unprivileged user processes
66 .\"O may change the real UID,
67 .\"O effective UID and saved set-user-ID, each to one of:
68 .\"O the current real UID, the current effective UID or the
69 .\"O current saved set-user-ID.
70 ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Ï¡¢¤½¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤ò¡¢
71 ¸½ºß¤Î¼Â UID¡¢¸½ºß¤Î¼Â¸ú UID¡¢¸½ºß¤ÎÊݸ set-user-ID
72 ¤Î¤É¤ì¤«¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë:
73
74 .\"O Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability)
75 .\"O may set the real UID, effective UID, and
76 .\"O saved set-user-ID to arbitrary values.
77 Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï \fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä
78 ¥×¥í¥»¥¹) ¤Ï¡¢¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤òǤ°Õ¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£
79
80 .\"O If one of the arguments equals \-1, the corresponding value is not changed.
81 °ú¤­¿ô¤Î¤É¤ì¤«¤¬ \-1 ¤Î¾ì¹ç¤Ï¤½¤ÎÃͤÏÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¡£
82
83 .\"O Regardless of what changes are made to the real UID, effective UID,
84 .\"O and saved set-user-ID, the file system UID is always set to the same
85 .\"O value as the (possibly new) effective UID.
86 ¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Ë¤É¤ó¤ÊÊѹ¹¤¬¹Ô¤ï¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢
87 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤Ï¾ï¤Ë¼Â¸ú UID (²Äǽ¤Ç¤¢¤ì¤ÐÊѹ¹¸å¤Î¿·¤·¤¤¼Â¸ú UID)
88 ¤ÈƱ¤¸ÃͤËÀßÄꤵ¤ì¤ë¡£
89
90 .\"O Completely analogously,
91 .\"O .BR setresgid ()
92 .\"O sets the real GID, effective GID, and saved set-group-ID
93 .\"O of the calling process (and always modifies the file system GID
94 .\"O to be the same as the effective GID),
95 .\"O with the same restrictions for unprivileged processes.
96 Á´¤¯Æ±¤¸¤è¤¦¤Ë¡¢
97 .BR setresgid ()
98 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â GID¡¢¼Â¸ú GID¡¢Êݸ set-group-ID ¤òÀßÄꤹ¤ë
99 (¤µ¤é¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ò¼Â¸ú GID ¤ÈƱ¤¸Ãͤ˽¤Àµ¤¹¤ë)¡£
100 ÈóÆø¢¥×¥í¥»¥¹¤ÏƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£
101 .\"O .SH "RETURN VALUE"
102 .SH ÊÖ¤êÃÍ
103 .\"O On success, zero is returned.
104 .\"O On error, \-1 is returned, and
105 .\"O .I errno
106 .\"O is set appropriately.
107 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
108 .I errno
109 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
110 .\"O .SH ERRORS
111 .SH ¥¨¥é¡¼
112 .TP
113 .B EAGAIN
114 .\"O .I uid
115 .\"O does not match the current UID and this call would
116 .\"O bring that user ID over its
117 .\"O .B RLIMIT_NPROC
118 .\"O resource limit.
119 .I uid
120 ¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È°ã¤¦Ãͤǡ¢
121 ¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê ¥æ¡¼¥¶¡¼ ID ¤¬
122 ¥ê¥½¡¼¥¹¾å¸Â
123 .B RLIMIT_NPROC
124 ¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£
125 .TP
126 .B EPERM
127 .\"O The calling process is not privileged (did not have the \fBCAP_SETUID\fP
128 .\"O capability) and tried to change the IDs to values that are not permitted.
129 ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¤Î¤Ë
130 (\fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¤Î¤Ë)¡¢
131 ID ¤òµö¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤËÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£
132 .\"O .SH VERSIONS
133 .SH ¥Ð¡¼¥¸¥ç¥ó
134 .\"O It is available under Linux since Linux 2.1.44.
135 Linux ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1.44 ¤è¤êÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¡£
136 .\"O .SH "CONFORMING TO"
137 .SH ½àµò
138 .\"O These calls are nonstandard;
139 .\"O they also appear on HP-UX and some of the BSDs.
140 ¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£
141 HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£
142 .\"O .SH NOTES
143 .SH Ãí°Õ
144 .\"O Under HP-UX and FreeBSD the prototype is found in
145 .\"O .IR <unistd.h> .
146 HP-UX ¤ä FreeBSD ¤Ç¤Ï
147 .I <unistd.h>
148 ¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£
149 .\"O Under Linux the prototype is provided by glibc since version 2.3.2.
150 Linux ¤Ç¤Ï¡¢glibc 2.3.2 °Ê¹ß¤Ç
151 ¥×¥í¥È¥¿¥¤¥×¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£
152 .\"O .SH "SEE ALSO"
153 .SH ´ØÏ¢¹àÌÜ
154 .BR getresuid (2),
155 .BR getuid (2),
156 .BR setfsgid (2),
157 .BR setfsuid (2),
158 .BR setreuid (2),
159 .BR setuid (2),
160 .BR capabilities (7),
161 .BR credentials (7),
162 .BR feature_test_macros (7)