OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man2 / setuid.2
1 .\" Copyright (C), 1994, Graeme W. Wilford (Wilf).
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 .\" Fri Jul 29th 12:56:44 BST 1994  Wilf. <G.Wilford@ee.surrey.ac.uk>
24 .\" Changes inspired by patch from Richard Kettlewell
25 .\"   <richard@greenend.org.uk>, aeb 970616.
26 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
27 .\"     Added notes on capability requirements
28 .\"
29 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
30 .\"         all rights reserved.
31 .\" Translated Sat Mar  1 16:32:11 JST 1997
32 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Modified Sun Sep 28 20:26:49 JST 1997
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated & Modified Sat May 22 18:21:45 JST 2004
36 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\" Updated & Modified Wed Jan  5 00:51:28 JST 2005 by Yuichi SATO
38 .\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
39 .\"
40 .\"WORD:        identity                ¼±ÊÌ
41 .\"WORD:        effective user ID       ¼Â¸ú¥æ¡¼¥¶¡¼ID
42 .\"WORD:        real user ID            ¼Â¥æ¡¼¥¶¡¼ID
43 .\"WORD:        saved user ID           Êݸ¥æ¡¼¥¶¡¼ID
44 .\"WORD:        implement               ¼ÂÁõ
45 .\"WORD:        root                    ¥ë¡¼¥È
46 .\"WORD:        super-user              ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
47 .\"
48 .TH SETUID 2 2010-02-21 "Linux" "Linux Programmer's Manual"
49 .SH Ì¾Á°
50 setuid \- ¥æ¡¼¥¶¡¼¼±ÊÌ (identity) ¤òÀßÄꤹ¤ë
51 .SH ½ñ¼°
52 .B #include <sys/types.h>
53 .br
54 .B #include <unistd.h>
55 .sp
56 .BI "int setuid(uid_t " uid );
57 .SH ÀâÌÀ
58 .BR setuid ()
59 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£
60 ¤â¤·¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬ root ¤Ê¤é¤Ð¡¢
61 ¼Â (real) UID ¤ÈÊݸ (saved) set-user-ID ¤âÀßÄꤵ¤ì¤ë¡£
62 .PP
63 Linux ¤Ç¤Ï¡¢
64 .BR setuid ()
65 ¤Ï
66 .B _POSIX_SAVED_IDS
67 ¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
68 ¤³¤ì¤Ï (¥ë¡¼¥È°Ê³°¤Î) set-user-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥æ¡¼¥¶¡¼¤ÎÆø¢¤ò
69 Á´¤ÆÍ¿¤¨¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë
70 °ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£
71 .PP
72 ¥æ¡¼¥¶¡¼¤¬ root ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤¬ root ¤Ë set-user-ID ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢
73 ÆÃÊ̤ÎÃí°Õ¤¬Ê§¤ï¤ì¤ë¡£
74 .BR setuid ()
75 ´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¼Ô¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¥Á¥§¥Ã¥¯¤·¡¢
76 ¤½¤ì¤¬¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ê¤é¤Ð¡¢
77 ¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ëÁ´¤Æ¤Î¥æ¡¼¥¶¡¼ ID ¤Ë
78 .I uid
79 ¤òÀßÄꤹ¤ë¡£
80 ¤³¤ì¤¬¹Ô¤Ê¤ï¤ì¤¿¸å¤Ë¤Ï¥×¥í¥°¥é¥à¤¬ºÆ¤Ó¥ë¡¼¥È¤ÎÆø¢¤òÆÀ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
81 .PP
82 ¤·¤¿¤¬¤Ã¤Æ¡¢set-user-ID-root ¥×¥í¥°¥é¥à¤Ç¡¢°ì»þŪ¤Ë¥ë¡¼¥ÈÆø¢¤ò²ò½ü¤·¡¢
83 ÈóÆø¢¥æ¡¼¥¶¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¤¡¢¸å¤Ç¥ë¡¼¥È¸¢¸Â¤ò¤â¤¦°ìÅÙÆÀ¤è¤¦¤È
84 ¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
85 .BR setuid ()
86 ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢
87 .BR seteuid (2)
88 ¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£
89 .SH ÊÖ¤êÃÍ
90 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
91 .I errno
92 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
93 .SH ¥¨¥é¡¼
94 .TP
95 .B EAGAIN
96 .I uid
97 ¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È¥Þ¥Ã¥Á¤»¤º¡¢¤³¤Î
98 .I uid
99 ¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤¬¥ê¥½¡¼¥¹¾å¸Â
100 .B RLIMIT_NPROC
101 ¤òĶ¤¨¤¿¡£
102 .TP
103 .B EPERM
104 ¥æ¡¼¥¶¡¼¤¬Æø¢¤ò»ý¤¿¤º
105 (Linux ¤Ç¤Ï
106 .B CAP_SETUID
107 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤¿¤º)¡¢
108 .I uid
109 ¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È°ìÃפ·¤Ê¤¤¡£
110 .SH ½àµò
111 SVr4, POSIX.1-2001.
112 4.4BSD ¤Î¥³¡¼¥ë¤È¤Ï´°Á´¤Ê¸ß´¹À­¤Ï¤Ê¤¤¡¢
113 BSD ¤Î¥³¡¼¥ë¤Ï¼Â (real)¡¢Êݸ (saved)¡¢¼Â¸ú (effective) ID ¤ÎÁ´¤Æ¤òÀßÄꤹ¤ë¡£
114 .\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
115 .SH Ãí°Õ
116 .SS Linux ¤Ç¤ÎÃí°Õ
117 Linux ¤Ï¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤Î³µÇ°¤ò»ý¤Ä¡£
118 Ä̾¤³¤ì¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÅù¤·¤¤¡£
119 .BR setuid ()
120 ¥³¡¼¥ë¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤âÀßÄꤹ¤ë¡£
121 .BR setfsuid (2)
122 ¤â»²¾È¤¹¤ë¤³¤È¡£
123 .PP
124 .I uid
125 ¤¬ÀΤμ¸ú uid ¤È°Û¤Ã¤Æ¤¤¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï¥³¥¢¡¦¥À¥ó¥×¤¹¤ë¤³¤È¤ò
126 ¶Ø»ß¤µ¤ì¤ë¡£
127 .SH ´ØÏ¢¹àÌÜ
128 .BR getuid (2),
129 .BR seteuid (2),
130 .BR setfsuid (2),
131 .BR setreuid (2),
132 .BR capabilities (7),
133 .BR credentials (7)