OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / release / man2 / chroot.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
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 by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-21 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1994-08-21 by Michael Chastain <mec@shell.portal.com>
28 .\" Modified 1996-06-13 by aeb
29 .\" Modified 1996-11-06 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified 1997-08-21 by Joseph S. Myers <jsm28@cam.ac.uk>
31 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
32 .\"
33 .\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara
34 .\"         all rights reserved.
35 .\" Translated Mon Jun 24 14:29:55 JST 1996
36 .\"         by Yosiaki Yanagihara <yosiaki@bsd2.kbnes.nec.co.jp>
37 .\" Modified Sat Dec 13 23:29:07 JST 1997
38 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
39 .\" Updated & Modified Fri 6 Apr 2001
40 .\"         by NAKANO Takeo <nakano@apm.seikei.ac.jp>
41 .\" Updated & Modified Thu Dec 23 10:04:20 JST 2004
42 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
43 .\"
44 .TH CHROOT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
45 .SH Ì¾Á°
46 chroot \- ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë
47 .SH ½ñ¼°
48 .B #include <unistd.h>
49 .sp
50 .BI "int chroot(const char *" path );
51 .sp
52 .in -4n
53 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
54 .RB ( feature_test_macros (7)
55 »²¾È):
56 .in
57 .sp
58 .BR chroot ():
59 .ad l
60 .RS 4
61 .PD 0
62 .TP 4
63 glibc 2.2.2 °Ê¹ß:
64 .nf
65 _BSD_SOURCE ||
66     (_XOPEN_SOURCE\ >=\ 500 ||
67         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
68     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
69 .fi
70 .TP 4
71 glibc 2.2.2 ¤è¤êÁ°: ¤Ê¤·
72 .PD
73 .RE
74 .ad b
75 .SH ÀâÌÀ
76 .BR chroot ()
77 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò
78 .I path
79 ¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£
80 ¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤¬ \fI/\fP ¤«¤é»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤È¤·¤Æ»È¤ï¤ì¤ë¡£
81 ¤³¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤Ë¼õ¤±·Ñ¤¬¤ì¤ë¡£
82 .PP
83 Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï¡¢
84 .B CAP_SYS_CHROOT
85 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬
86 .BR chroot ()
87 ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
88 .PP
89 ¤³¤Î¥³¡¼¥ë¤Ï¥Ñ¥¹Ì¾²ò·è¤Î²áÄø¤Ç¹½À®Í×ÁǤòÊѹ¹¤¹¤ë¤Î¤ß¤Ç¡¢
90 ¤½¤Î¾¤Ë¤Ï²¿¤â¹Ô¤ï¤Ê¤¤¡£
91 .PP
92 ¤³¤Î¥³¡¼¥ë¤Ï¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê
93 (working directory) ¤òÊѹ¹¤·¤Ê¤¤¡£
94 ¤½¤Î¤¿¤á¡¢¤³¤Î¥³¡¼¥ë¤Î¸å¤Ë \(aq\fI.\fP\(aq ¤¬ \(aq\fI/\fP\(aq ¤ò
95 º¬¤È¤¹¤ë¥Ä¥ê¡¼¤Î³°¤Ë¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£
96 Æäˡ¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç
97 "chroot jail" ¤«¤éƨ¤²½Ð¤»¤Æ¤·¤Þ¤¦¡£
98 .nf
99
100     mkdir foo; chroot foo; cd ..
101 .fi
102
103 ¤³¤Î¥³¡¼¥ë¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤Î¤Ç¡¢
104 ¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï chroot ¥Ä¥ê¡¼¤Î³°¤Ë¤¢¤ë
105 ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£
106 .SH ÊÖ¤êÃÍ
107 À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
108 ¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢
109 .I errno
110 ¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£
111 .SH ¥¨¥é¡¼
112 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£
113 °ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
114 .TP
115 .B EACCES
116 ¥Ñ¥¹Ì¾¤ÎÅÓÃæ¤Î¤É¤³¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤¡£
117 .RB ( path_resolution (7)
118 ¤â»²¾È¤¹¤ë¤³¤È¡£)
119 .\" ¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤˤ⸡º÷µö²Ä¤¬É¬ÍפǤ¢¤ë¡£
120 .\" ¤ª¤½¤é¤¯¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ê¤Î¤«?
121 .TP
122 .B EFAULT
123 .I path
124 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
125 .TP
126 .B EIO
127 I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
128 .TP
129 .B ELOOP
130 .I path
131 ¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
132 .TP
133 .B ENAMETOOLONG
134 .I path
135 ¤¬Ä¹²á¤®¤ë¡£
136 .TP
137 .B ENOENT
138 ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
139 .TP
140 .B ENOMEM
141 ¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
142 .TP
143 .B ENOTDIR
144 .I path
145 ¤ÎÆâÍƤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£
146 .TP
147 .B EPERM
148 ¸Æ¤Ó½Ð¤·Â¦¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£
149 .SH ½àµò
150 SVr4, 4.4BSD, SUSv2 (⤷¡¢SUSv2 ¤Ç¤Ï²áµî¤Î̾»Ä¤È¤µ¤ì¤Æ¤¤¤ë)¡£
151 ¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£
152 .\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
153 .\" X/OPEN ¤Ë¤Ï EIO, ENOMEM, EFAULT ¥¨¥é¡¼¾õÂ֤ε­½Ò¤Ï¤Ê¤¤¡£
154 .SH Ãí°Õ
155 .BR fork (2)
156 ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢
157 ¿Æ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò·Ñ¾µ¤¹¤ë¡£
158 .BR execve (2)
159 ¤Î¾ì¹ç¤â¡¢¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
160
161 FreeBSD ¤Ë¤Ï¤è¤ê¶¯ÎϤÊ
162 .BR jail ()
163 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£
164 .\" FIXME . eventually say something about containers,
165 .\" virtual servers, etc.?
166 .SH ´ØÏ¢¹àÌÜ
167 .BR chdir (2),
168 .BR path_resolution (7)