1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
24 .\" all rights reserved.
25 .\" Translated 2005-01-26, Yuichi SATO <ysato444@yahoo.co.jp>
26 .\" Updated and Modified 2005-10-27, Akihiro MOTOKI
27 .\" Updated and Modified 2005-11-04, Akihiro MOTOKI
29 .TH PATH_RESOLUTION 7 2009-12-05 "Linux" "Linux Programmer's Manual"
32 .\"O path_resolution \- how a pathname is resolved to a file
33 path_resolution \- ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Î²ò·èÊýË¡
36 .\"O Some Unix/Linux system calls have as parameter one or more filenames.
37 .\"O A filename (or pathname) is resolved as follows.
38 ¤¤¤¯¤Ä¤«¤Î Unix/Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
39 1 ¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë̾¤ò°ú¤¿ô¤È¤·¤Æ»ý¤Ä¡£
40 ¥Õ¥¡¥¤¥ë̾ (¤Þ¤¿¤Ï¥Ñ¥¹Ì¾) ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ²ò·è¤µ¤ì¤ë¡£
41 .\"O .SS "Step 1: Start of the resolution process"
42 .SS "¥¹¥Æ¥Ã¥× 1: ²ò·è²áÄø¤ò³«»Ï¤¹¤ë"
43 .\"O If the pathname starts with the \(aq/\(aq character,
44 .\"O the starting lookup directory
45 .\"O is the root directory of the calling process.
46 .\"O (A process inherits its
47 .\"O root directory from its parent.
48 .\"O Usually this will be the root directory
49 .\"O of the file hierarchy.
50 .\"O A process may get a different root directory
54 .\"O A process may get an entirely private mount namespace in case
55 .\"O it \(em or one of its ancestors \(em was started by an invocation of the
57 .\"O system call that had the
60 .\"O This handles the \(aq/\(aq part of the pathname.
61 ¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
62 ¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£
63 (¥×¥í¥»¥¹¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤¹¤ë¡£
64 Ä̾ï¤Ï¡¢¤³¤ì¤¬¥Õ¥¡¥¤¥ë³¬ÁؤΥ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£
67 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆÊ̤Υ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤¤ë¡£
68 ¤³¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤È
72 ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¤½¤Î¥×¥í¥»¥¹¤Î»Ò¹¤Ï¡¢
73 ´°Á´¤Ë¥×¥é¥¤¥Ù¡¼¥È¤Ê¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¼èÆÀ¤Ç¤¤ë¡£)
74 ¥Ñ¥¹Ì¾¤Î \(aq/\(aq ¤ÎÉôʬ¤Ï¡¢¤³¤Î¤è¤¦¤Ë¤·¤Æ°·¤ï¤ì¤ë¡£
76 .\"O If the pathname does not start with the \(aq/\(aq character, the
77 .\"O starting lookup directory of the resolution process is the current working
78 .\"O directory of the process.
79 .\"O (This is also inherited from the parent.
80 .\"O It can be changed by use of the
83 ¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
84 ²ò·è²áÄø¤Ë¤ª¤±¤ë¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¡¢
85 ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È (working) ¥Ç¥£¥ì¥¯¥È¥ê¤È¤Ê¤ë¡£
86 (¤³¤ì¤â¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¤ë¡£
89 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤¤ë¡£)
91 .\"O Pathnames starting with a \(aq/\(aq character are called absolute pathnames.
92 .\"O Pathnames not starting with a \(aq/\(aq are called relative pathnames.
93 \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤ÏÀäÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¡¢
94 \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤é¤Ê¤¤¥Ñ¥¹Ì¾¤ÏÁêÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¤ë¡£
95 .\"O .SS "Step 2: Walk along the path"
96 .SS "¥¹¥Æ¥Ã¥× 2: ¥Ñ¥¹¤òé¤ë"
97 .\"O Set the current lookup directory to the starting lookup directory.
98 .\"O Now, for each nonfinal component of the pathname, where a component
99 .\"O is a substring delimited by \(aq/\(aq characters, this component is looked up
100 .\"O in the current lookup directory.
101 ¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤¹¤ë¡£
102 ¤½¤·¤Æ¡¢¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁÇ (component) ¤Ç¤Ê¤¤³Æ¹½À®Í×ÁǤˤĤ¤¤Æ¡¢
103 ¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Ç¸¡º÷¤ò¹Ô¤¦¡£
104 ¤³¤³¤Ç¹½À®Í×ÁÇ¤Ï \(aq/\(aq ¤Ç¶èÀÚ¤é¤ì¤¿Éôʬʸ»úÎó¤Ç¤¢¤ë¡£
106 .\"O If the process does not have search permission on
107 .\"O the current lookup directory,
110 .\"O error is returned ("Permission denied").
111 ¥×¥í¥»¥¹¤¬¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡º÷µö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç¡¢
113 ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Permission denied")¡£
115 .\"O If the component is not found, an
117 .\"O error is returned
118 .\"O \"O ("No such file or directory").
119 ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢
122 ("No such file or directory")¡£
124 .\"O If the component is found, but is neither a directory nor a symbolic link,
127 .\"O error is returned ("Not a directory").
128 ¹½À®Í×ÁǤϸ«¤Ä¤«¤Ã¤¿¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤â¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤â¤Ê¤¤¾ì¹ç¡¢
130 ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Not a directory")¡£
132 .\"O If the component is found and is a directory, we set the
133 .\"O current lookup directory to that directory, and go to the
135 ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¾ì¹ç¡¢
136 ¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤷ¡¢
137 ¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£
139 .\"O If the component is found and is a symbolic link (symlink), we first
140 .\"O resolve this symbolic link (with the current lookup directory
141 .\"O as starting lookup directory).
142 .\"O Upon error, that error is returned.
143 ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ (symlink) ¤Ç¤¢¤ë¾ì¹ç¡¢
144 (¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤·¤Æ)
145 ºÇ½é¤Ë¤½¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¡£
146 .\"O If the result is not a directory, an
148 .\"O error is returned.
149 ·ë²Ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¡¢
152 .\"O If the resolution of the symlink is successful and returns a directory,
153 .\"O we set the current lookup directory to that directory, and go to
154 .\"O the next component.
155 ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î²ò·è¤¬À®¸ù¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬ÊÖ¤µ¤ì¤¿¾ì¹ç¡¢
156 ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÀßÄꤷ¡¢
157 ¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£
158 .\"O Note that the resolution process here involves recursion.
159 ²ò·è²áÄø¤ËºÆµ¢¤¬´Þ¤Þ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£
160 .\"O In order to protect the kernel against stack overflow, and also
161 .\"O to protect against denial of service, there are limits on the
162 .\"O maximum recursion depth, and on the maximum number of symbolic links
166 .\"O error is returned when the maximum is
167 .\"O exceeded ("Too many levels of symbolic links").
168 ¥«¡¼¥Í¥ë¤ò¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ä
169 ¥µ¡¼¥Ó¥¹µñÈÝ (denial of service) ¤«¤é¼é¤ë¤¿¤á¡¢
170 ºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤ËÀ©¸Â¤¬¤¢¤ë¡£
174 ("Too many levels of symbolic links")¡£
176 .\"O .\" presently: max recursion depth during symlink resolution: 5
177 .\"O .\" max total number of symbolic links followed: 40
178 .\"O .\" _POSIX_SYMLOOP_MAX is 8
179 .\" ¸½ºß¤Î¤È¤³¤í: ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯²ò·è¤Ë¤ª¤±¤ëºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤Ï 5 ¤Ç¤¢¤ë¡£
180 .\" ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤Ï 40 ¤Ç¤¢¤ë¡£
181 .\" _POSIX_SYMLOOP_MAX ¤Ï 8 ¤Ç¤¢¤ë¡£
182 .\"O .SS "Step 3: Find the final entry"
183 .SS "¥¹¥Æ¥Ã¥× 3: ºÇ¸å¤Î¥¨¥ó¥È¥ê¤ò¸«¤Ä¤±¤ë"
184 .\"O The lookup of the final component of the pathname goes just like
185 .\"O that of all other components, as described in the previous step,
186 .\"O with two differences: (i) the final component need not be a
187 .\"O directory (at least as far as the path resolution process is concerned \(em
188 .\"O it may have to be a directory, or a nondirectory, because of
189 .\"O the requirements of the specific system call), and (ii) it
190 .\"O is not necessarily an error if the component is not found \(em
191 .\"O maybe we are just creating it.
192 .\"O The details on the treatment
193 .\"O of the final entry are described in the manual pages of the specific
195 ¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤθ¡º÷¤Ï¡¢Á°¤Î¥¹¥Æ¥Ã¥×¤ÇÀâÌÀ¤·¤¿
196 ¾¤ÎÁ´¤Æ¤Î¹½À®Í×ÁǤÈƱ¤¸¤è¤¦¤Ë¼Â¹Ô¤µ¤ì¤ë¤¬¡¢2 ¤Ä¤Î°ã¤¤¤¬¤¢¤ë¡£
197 (i) ºÇ¸å¤Î¹½À®Í×ÁǤϥǥ£¥ì¥¯¥È¥ê¤Ç¤¢¤ëɬÍפ¬¤Ê¤¤
198 (¥Ñ¥¹²ò·è²áÄø¤Ë´Ø¤¹¤ë¸Â¤ê¤Ï¤É¤Á¤é¤Ç¤â¹½¤ï¤Ê¤¤ \(em
199 ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Í׵᤹¤ë¤â¤Î¤Ë¤è¤Ã¤Æ¡¢
200 ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë¤·¡¢
201 ¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë)¡£
202 (ii) ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ë¥¨¥é¡¼¤Ë¤¹¤ëɬÍפϤʤ¤ \(em
203 ¤½¤Î¹½À®Í×ÁǤòºîÀ®¤¹¤ë¤À¤±¤Ç¤è¤¤¾ì¹ç¤â¤¢¤ë¡£
204 ºÇ¸å¤Î¥¨¥ó¥È¥ê¤Î¾ÜºÙ¤Ê°·¤¤¤Ï¡¢
205 ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£
208 .\"O By convention, every directory has the entries "." and "..",
209 .\"O which refer to the directory itself and to its parent directory,
211 ´·½¬¤È¤·¤Æ¡¢Á´¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥¨¥ó¥È¥ê "." ¤È ".." ¤ò»ý¤Ä¡£
212 ¤³¤ì¤é¤Ï¤½¤ì¤¾¤ì¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤È¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£
214 .\"O The path resolution process will assume that these entries have
215 .\"O their conventional meanings, regardless of whether they are
216 .\"O actually present in the physical file system.
217 ¥Ñ¥¹²ò·è²áÄø¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥¨¥ó¥È¥ê¤¬ÊªÍýŪ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë
218 ¼ÂºÝ¤Ë¸ºß¤¹¤ë¤«Èݤ«¤Ë´Ø¤ï¤é¤º¡¢´·½¬Åª¤Ê°ÕÌ£¤ò»ý¤Ä¤È²¾Äꤹ¤ë¡£
220 .\"O One cannot walk down past the root: "/.." is the same as "/".
221 ¥ë¡¼¥È¤è¤ê¾å¤Ëé¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤: "/.." ¤Ï "/" ¤ÈƱ¤¸¤Ç¤¢¤ë¡£
222 .\"O .SS "Mount points"
224 .\"O After a "mount dev path" command, the pathname "path" refers to
225 .\"O the root of the file system hierarchy on the device "dev", and no
226 .\"O longer to whatever it referred to earlier.
227 "mount dev path" ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¸å¡¢
228 ¥Ñ¥¹Ì¾ "path" ¤Ï¥Ç¥Ð¥¤¥¹ "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤÎ
229 ¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¡¢°ÊÁ°¤Î°ÌÃÖ¤ò»²¾È¤·¤Ê¤¤¡£
231 .\"O One can walk out of a mounted file system: "path/.." refers to
232 .\"O the parent directory of "path",
233 .\"O outside of the file system hierarchy on "dev".
234 ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³°¤Ë½Ð¤ë¤³¤È¤¬¤Ç¤¤ë:
235 "path/.." ¤Ï "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬Áؤγ°¤Ç¤¢¤ë
236 "path" ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£
237 .\"O .SS "Trailing slashes"
238 .SS "ËöÈø¤Î¥¹¥é¥Ã¥·¥å"
239 .\"O If a pathname ends in a \(aq/\(aq, that forces resolution of the preceding
240 .\"O component as in Step 2: it has to exist and resolve to a directory.
241 .\"O Otherwise a trailing \(aq/\(aq is ignored.
242 .\"O (Or, equivalently, a pathname with a trailing \(aq/\(aq is equivalent to
243 .\"O the pathname obtained by appending \(aq.\(aq to it.)
244 ¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
245 ¥¹¥Æ¥Ã¥× 2 ¤Ë¤ª¤¤¤Æ¡¢¤½¤ÎÁ°¤Ë¤¢¤ë¹½À®Í×ÁǤβò·èË¡¤ò¼¡¤Î¤è¤¦¤Ë¶¯À©¤¹¤ë:
246 ¤½¤Î¹½À®Í×ÁǤ¬Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ²ò·è¤µ¤ì¤ë¡£
247 ¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ËöÈø¤Î \(aq/\(aq ¤¬Ìµ»ë¤µ¤ì¤ë¡£
248 (¤Þ¤¿Æ±Íͤˡ¢ËöÈø¤Ë \(aq/\(aq ¤¬¤¢¤ë¥Ñ¥¹Ì¾¤Ï¡¢
249 \(aq.\(aq ¤òËöÈø¤Ë²Ã¤¨¤ÆÆÀ¤é¤ì¤ë¥Ñ¥¹Ì¾¤ÈÅù¤·¤¤¡£)
250 .\"O .SS "Final symlink"
251 .SS "ºÇ¸å¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤È¤"
252 .\"O If the last component of a pathname is a symbolic link, then it
253 .\"O depends on the system call whether the file referred to will be
254 .\"O the symbolic link or the result of path resolution on its contents.
255 ¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤ¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢
256 »²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤È¤¹¤ë¤«¡¢
257 ¤½¤ÎÆâÍƤˤĤ¤¤Æ¥Ñ¥¹¤ò²ò·è¤·¤¿·ë²Ì¤È¤¹¤ë¤«¤Ï¡¢
258 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë°Í¸¤¹¤ë¡£
259 .\"O For example, the system call
261 .\"O will operate on the symlink, while
263 .\"O operates on the file pointed to by the symlink.
264 ¤¿¤È¤¨¤Ð¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë
266 ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËºîÍѤ¹¤ë¡£
269 ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç»Ø¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËºîÍѤ¹¤ë¡£
270 .\"O .SS "Length limit"
272 .\"O There is a maximum length for pathnames.
273 .\"O If the pathname (or some
274 .\"O intermediate pathname obtained while resolving symbolic links)
277 .\"O error is returned ("File name too long").
278 ¥Ñ¥¹Ì¾¤Ë¤ÏºÇÂ獬¤¢¤ë¡£
279 ¥Ñ¥¹Ì¾ (¤Þ¤¿¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¤È¤¤ËÆÀ¤é¤ì¤ëÃæ´Ö¥Ñ¥¹Ì¾) ¤¬
282 ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("File name too long")¡£
283 .\"O .SS "Empty pathname"
285 .\"O In the original Unix, the empty pathname referred to the current directory.
286 .\"O Nowadays POSIX decrees that an empty pathname must not be resolved
291 ¸µ¡¹¤Î Unix ¤Ç¤Ï¡¢¶õ¤Î¥Ñ¥¹Ì¾¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤¿¡£
292 ºÇ¶á¡¢POSIX ¤Ç¤Ï¶õ¤Î¥Ñ¥¹Ì¾¤ò²ò·è¤¹¤ë¤Ù¤¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦·èÄ꤬¤Ê¤µ¤ì¤¿¡£
296 .\"O .SS "Permissions"
298 .\"O The permission bits of a file consist of three groups of three bits, cf.\&
302 ¥Õ¥¡¥¤¥ë¤Îµö²Ä¥Ó¥Ã¥È¤Ï¡¢3 ÁȤΠ3 ¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¡£
307 .\"O The first group of three is used when the effective user ID of
308 .\"O the calling process equals the owner ID of the file.
309 .\"O The second group
310 .\"O of three is used when the group ID of the file either equals the
311 .\"O effective group ID of the calling process, or is one of the
312 .\"O supplementary group IDs of the calling process (as set by
313 .\"O .BR setgroups (2)).
314 .\"O When neither holds, the third group is used.
315 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ¼Ô ID ¤ÈÅù¤·¤¤¾ì¹ç¡¢
316 3 ¤Ä¤Î¤¦¤ÁºÇ½é¤Î¥°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£
317 ¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥× ID ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤Þ¤¿¤Ï
319 ¤ÇÀßÄꤵ¤ì¤ë) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÊä½õ (supplementary) ¥°¥ë¡¼¥× ID ¤È
320 Åù¤·¤¤¾ì¹ç¡¢3 ¤Ä¤Î¤¦¤Á 2 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£
321 ¤É¤Á¤é¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¡¢3 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£
323 .\"O Of the three bits used, the first bit determines read permission,
324 .\"O the second write permission, and the last execute permission
325 .\"O in case of ordinary files, or search permission in case of directories.
326 3 ¥Ó¥Ã¥È¤¬»È¤ï¤ì¤ë¾ì¹ç¡¢ºÇ½é¤Î¥Ó¥Ã¥È¤ÏÆɤ߹þ¤ßµö²Ä¤ò·èÄꤷ¡¢
327 2 ÈÖÌܤΥӥåȤϽñ¤¹þ¤ßµö²Ä¤ò·èÄꤹ¤ë¡£
328 ¤Þ¤¿ 3 ÈÖÌܤΥӥåȤϡ¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¼Â¹Ôµö²Ä¤òɽ¤·¡¢
329 ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¸¡º÷µö²Ä¤òɽ¤¹¡£
331 .\"O Linux uses the fsuid instead of the effective user ID in permission checks.
332 .\"O Ordinarily the fsuid will equal the effective user ID, but the fsuid can be
333 .\"O changed by the system call
334 .\"O .BR setfsuid (2).
335 Linux ¤Ï¡¢µö²Ä¤Î¥Á¥§¥Ã¥¯¤Ë¤ª¤¤¤Æ¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤Ç¤Ï¤Ê¤¯ fsuid ¤ò»È¤¦¡£
336 Ä̾ï¤Ï fsuid ¤Ï¼Â¸ú¥æ¡¼¥¶ ID ¤ÈÅù¤·¤¤¤¬¡¢fsuid ¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë
338 ¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
340 .\"O (Here "fsuid" stands for something like "file system user ID".
341 .\"O The concept was required for the implementation of a user space
342 .\"O NFS server at a time when processes could send a signal to a process
343 .\"O with the same effective user ID.
344 .\"O It is obsolete now.
345 .\"O Nobody should use
346 .\"O .BR setfsuid (2).)
347 (¤³¤³¤Ç "fsuid" ¤Ï "file system user ID" ¤òɽ¤·¤Æ¤¤¤ë¡£
348 ¤³¤Î³µÇ°¤Ï¡Ö¥×¥í¥»¥¹¤¬Æ±¤¸¼Â¸ú¥æ¡¼¥¶ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Ë
349 Ʊ»þ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤¤ë¡×¤È¤¤¤¦¥æ¡¼¥¶¶õ´Ö NFS ¥µ¡¼¥Ð¤ò
350 ¼ÂÁõ¤¹¤ëºÝ¤ËɬÍפǤ¢¤Ã¤¿¡£
351 ¤³¤ì¤Ïº£¤Ç¤ÏÇѤì¤Æ¤·¤Þ¤Ã¤¿¡£
355 .\"O Similarly, Linux uses the fsgid ("file system group ID")
356 .\"O instead of the effective group ID.
358 .\"O .BR setfsgid (2).
359 ƱÍͤˡ¢Linux ¤Ç¤Ï¼Â¸ú¥°¥ë¡¼¥× ID ¤ÎÂå¤ï¤ê¤Ë
360 fsgid ("¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥°¥ë¡¼¥×ID") ¤ò»È¤¦¡£
363 .\" FIXME say something about file system mounted read-only ?
364 .\"O .SS "Bypassing permission checks: superuser and capabilities"
365 .SS "µö²Ä¤Î³Îǧ¤ò¥¹¥¥Ã¥×¤¹¤ë: ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£"
366 .\"O On a traditional Unix system, the superuser
368 .\"O user ID 0) is all-powerful, and bypasses all permissions restrictions
369 .\"O when accessing files.
370 ÅÁÅýŪ¤Ê Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶
372 ¥æ¡¼¥¶ ID 0) ¤ÏÈó¾ï¤Ë¶¯ÎϤǤ¢¤ê¡¢¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¤Î
373 µö²Ä¤Ë¤è¤ëÀ©¸Â¤òÁ´¤Æ¥¹¥¥Ã¥×¤¹¤ë¡£
374 .\" (but for exec at least one x bit must be set) -- AEB
375 .\" but there is variation across systems on this point: for
376 .\" example, HP-UX and Tru64 are as described by AEB. However,
377 .\" on some implementations (e.g., Solaris, FreeBSD),
378 .\" access(X_OK) by superuser will report success, regardless
379 .\" of the file's execute permission bits. -- MTK (Oct 05)
381 .\"O On Linux, superuser privileges are divided into capabilities (see
382 .\"O .BR capabilities (7)).
383 .\"O Two capabilities are relevant for file permissions checks:
384 .\"O \fBCAP_DAC_OVERRIDE\fP and \fBCAP_DAC_READ_SEARCH\fP.
385 .\"O (A process has these capabilities if its fsuid is 0.)
386 Linux ¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¸¢¸Â¤¬Ê£¿ô¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ëʬ³ä¤µ¤ì¤Æ¤¤¤ë
387 .RB ( capabilities (7)
388 »²¾È)¡£¥Õ¥¡¥¤¥ë¤Îµö²Ä¤Î³Îǧ¤Ë¤Ï¡¢
391 .B CAP_DAC_READ_SEARCH
392 ¤Î 2¤Ä¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬´Ø·¸¤¹¤ë
393 (¥×¥í¥»¥¹¤Î fsuid ¤¬ 0 ¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä)¡£
395 .\"O The \fBCAP_DAC_OVERRIDE\fP capability overrides all permission checking,
396 .\"O but only grants execute permission when at least one
397 .\"O of the file's three execute permission bits is set.
399 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÁ´¤Æ¤Îµö²Ä¥Á¥§¥Ã¥¯¤ò¾å½ñ¤¤¹¤ë¡£
400 ¼ÂºÝ¤Ë¤Ï¡¢ÂоݤȤʤë¥Õ¥¡¥¤¥ë¤Î 3 ¤Ä¤Î¼Â¹Ôµö²Ä¥Ó¥Ã¥È¤Î¤¦¤Á¤Î
401 ¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¼Â¹Ô¤òµö²Ä¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£
403 .\"O The \fBCAP_DAC_READ_SEARCH\fP capability grants read and search permission
404 .\"O on directories, and read permission on ordinary files.
405 .B CAP_DAC_READ_SEARCH
406 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÆɤ߹þ¤ß¤È¸¡º÷¤òµö²Ä¤·¡¢
407 Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÆɤ߹þ¤ß¤òµö²Ä¤¹¤ë¡£
408 .\" FIXME say something about immutable files
409 .\" FIXME say something about ACLs
413 .BR capabilities (7),