Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160444267
D28445.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28445.diff
View Options
Index: sys/kern/vfs_lookup.c
===================================================================
--- sys/kern/vfs_lookup.c
+++ sys/kern/vfs_lookup.c
@@ -1235,23 +1235,22 @@
MPASS(cnp->cn_nameptr[0] != '\0');
/*
- * Handle "..": five special cases.
- * 0. If doing a capability lookup and lookup_cap_dotdot is
- * disabled, return ENOTCAPABLE.
- * 1. Return an error if this is the last component of
- * the name and the operation is DELETE or RENAME.
- * 2. If at root directory (e.g. after chroot)
- * or at absolute root directory
- * then ignore it so can't get out.
- * 3. If this vnode is the root of a mounted
- * filesystem, then replace it with the
- * vnode which was mounted on so we take the
- * .. in the other filesystem.
- * 4. If the vnode is the top directory of
- * the jail or chroot, don't let them out.
- * 5. If doing a capability lookup and lookup_cap_dotdot is
- * enabled, return ENOTCAPABLE if the lookup would escape
- * from the initial file descriptor directory.
+ * Handle "..": six special cases.
+ * 1. If doing a capability lookup and lookup_cap_dotdot is disabled,
+ * or NI_LCF_STRICTRELATIVE and not NI_LCF_CAP_DOTDOT is set, return
+ * ENOTCAPABLE.
+ * 2. Return an error if this is the last component of the name and the
+ * operation is DELETE or RENAME.
+ * 3. If at root directory (e.g. after chroot) or at absolute root
+ * directory then ignore it so can't get out.
+ * 4. If this vnode is the root of a mounted filesystem, then replace
+ * it with the vnode which was mounted on so we take the .. in the
+ * other filesystem.
+ * 5. If the vnode is the top directory of the jail or chroot, don't
+ * let them out.
+ * 6. If doing a capability lookup and lookup_cap_dotdot is enabled,
+ * return ENOTCAPABLE if the lookup would escape from the initial
+ * file descriptor directory.
*/
if (cnp->cn_flags & ISDOTDOT) {
if (__predict_false((ndp->ni_lcf & (NI_LCF_STRICTREL_KTR |
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 25, 12:18 PM (8 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34322250
Default Alt Text
D28445.diff (1 KB)
Attached To
Mode
D28445: vfs_lookup: correct comments around .. special cases
Attached
Detach File
Event Timeline
Log In to Comment