OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / release / 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 .\" 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
32 .\"
33 .\"WORD:        effective user ID       ¼Â¸ú¥æ¡¼¥¶¡¼ ID
34 .\"WORD:        real user ID            ¼Â¥æ¡¼¥¶¡¼ ID
35 .\"WORD:        saved user ID           Êݸ¥æ¡¼¥¶¡¼ ID
36 .\"WORD:
37 .\"
38 .TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
39 .SH Ì¾Á°
40 seteuid, setegid \- ¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ä ¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë
41 .SH ½ñ¼°
42 .B #include <sys/types.h>
43 .br
44 .B #include <unistd.h>
45 .sp
46 .BI "int seteuid(uid_t " euid );
47 .br
48 .BI "int setegid(gid_t " egid );
49 .sp
50 .in -4n
51 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
52 .RB ( feature_test_macros (7)
53 »²¾È):
54 .in
55 .sp
56 .ad l
57 .BR seteuid (),
58 .BR setegid ():
59 .RS 4
60 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
61 .RE
62 .ad
63 .SH ÀâÌÀ
64 .BR seteuid ()
65 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£
66 ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢
67 ¼Â¥æ¡¼¥¶¡¼ ID¡¦¼Â¸ú¥æ¡¼¥¶¡¼ ID¡¦Êݸ set-user-ID ¤Î¤¤¤º¤ì¤«¤À¤±¤Ç¤¢¤ë¡£
68
69 .BR setegid ()
70 ¤Ï¡Ö¥æ¡¼¥¶¡¼¡×¤Ç¤Ï¤Ê¤¯¡Ö¥°¥ë¡¼¥×¡×¤ËÂФ·¤ÆÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¡£
71 .\" When
72 .\" .I euid
73 .\" equals \-1, nothing is changed.
74 .\" (This is an artifact of the implementation in glibc of seteuid()
75 .\" using setresuid(2).)
76 .SH ÊÖ¤êÃÍ
77 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£
78 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
79 .I errno
80 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
81
82 .SH ¥¨¥é¡¼
83 .\" .TP
84 .\" .B EINVAL
85 .TP
86 .B EPERM
87 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯¡¢
88 .I euid
89 .RI ( egid )
90 ¤¬¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢
91 Êݸ set-user-ID (Êݸ set-group-ID) ¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ï¤Ê¤¤
92 (Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢
93 .BR seteuid ()
94 ¤Ç¤Ï
95 .B CAP_SETUID
96 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¡¢
97 .BR setegid ()
98 ¤Ç¤Ï
99 .B CAP_SETGID
100 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢Æø¢¤¬¤Ê¤¤¤ÈȽÃǤµ¤ì¤ë)¡£
101 .SH ½àµò
102 4.3BSD, POSIX.1-2001.
103 .SH Ãí°Õ
104 ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ set-user-ID (Êݸ set-group-ID) ¤Ë
105 ÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢Linux 1.1.37 (1.1.38) °Ê¹ß¤Ç¤¢¤ë¡£
106 Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ
107 .B _POSIX_SAVED_IDS
108 ¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£
109 .LP
110 libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢
111 .BI seteuid( euid )
112 ¤Ï
113 .BI setreuid(\-1, " euid" )
114 ¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID ¤òÊѹ¹¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
115 glibc 2.1 ¤Ç¤Ï¡¢
116 .BI setresuid(\-1, " euid" ", \-1)"
117 ¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID Êѹ¹¤·¤Ê¤¤¡£
118 ƱÍͤΤ³¤È¤¬
119 .BR setegid ()
120 ¤Ë¤â¸À¤¨¤ë¡£
121
122 POSIX.1 ¤Ç¤Ï¡¢
123 .BR seteuid ()
124 .RB ( setegid ())
125 ¤Ç¡¢
126 .I euid
127 .RI ( egid )
128 ¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò»ØÄê²Äǽ¤Ç¤¢¤ë
129 ɬÍפϤʤ¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï
130 .I euid
131 .RI ( egid )
132 ¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò
133 »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
134 .SH ´ØÏ¢¹àÌÜ
135 .BR geteuid (2),
136 .BR setresuid (2),
137 .BR setreuid (2),
138 .BR setuid (2),
139 .BR capabilities (7),
140 .BR credentials (7)