Start list with item 1, update the introductory number of items in the list, include NI_LCF_STRICTRELATIVE, and reformat.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/kern/vfs_lookup.c | ||
---|---|---|
990 | It is NI_LCF_STRICTRELATIVE. Also, the NI_LCF_CAP_DOTDOT should be not set for ENOTCAPABLE. This has some non-trivial intersection with the rule 6. |
Comment Actions
some history,
- two special cases date to 4.4 Lite (now 3 and 4 after my renumbering)
- 2fe5bd8bb8393 added my case 5 (3 when added)
- bea7a8d75cae152fcf7fb18225ad92c8ee2ba1cc added what I've now numbered 2 (1 when committed), and updated comment from "two special cases" (but actually three) to four
- 0304c7316344d7e2d1dee3aa0249724ec629e8ef added hierarchical jails and introduced the for (pr = cnp->cn_cred->cr_prison; pr != NULL; pr = pr->pr_parent) loop and pr != NULL clause in the following if (but no new item in the list)
- 69d377fe1bd79cb7e932275504af3120791960bd added my case 1 (0 when committed)
- 7359fdcf5ffab47dfde9b469afc6a7d8488a77aa removed part of case 1 and added case 6 (0 and 5 when committed)
Comment Actions
from 4.4 Lite the two special cases clearly mapped to the conditions inside the for (;;) loop:
/* * Handle "..": two special cases. * 1. If at root directory (e.g. after chroot) * or at absolute root directory * then ignore it so can't get out. * 2. 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 file system. */ if (cnp->cn_flags & ISDOTDOT) { for (;;) { if (dp == ndp->ni_rootdir || dp == rootvnode) { ndp->ni_dvp = dp; ndp->ni_vp = dp; VREF(dp); goto nextname; } if ((dp->v_flag & VROOT) == 0 || (cnp->cn_flags & NOCROSSMOUNT)) break; tdp = dp; dp = dp->v_mount->mnt_vnodecovered; vput(tdp); VREF(dp); VOP_LOCK(dp); } }
Comment Actions
2fe5bd8bb8393 added nameidata::ni_topdir for case 5
sys/kern/vfs_lookup.c | ||
---|---|---|
990 | Ah, yes. I don't want to just repeat the code in comments. Is NI_LCF_STRICTRELATIVE used only for capability mode or also for O_BENEATH handling? |
sys/kern/vfs_lookup.c | ||
---|---|---|
990 | Also for BENEATH. They are only differentiated at setup. |