| Summary: | "cd .." at mount-point uses perms of dir under mount | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Phil Pennock <pdp> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.4-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Phil Pennock
2001-10-19 16:20:00 UTC
pdp@nl.demon.net writes: > $ cd /d/mounthere > $ pwd > /d/mounthere > $ ls -ld . > drwxr-xr-x 2 root wheel 512 Oct 18 20:42 . > $ cd .. > cd: can't cd to .. This is not a bug. It happens because the fs you mounted on top of /d/mounthere doesn't know shit about the mountpoint or its parent, and has no way of returning a vnode to the mountpoint's parent, so (as a special case) you have to look up .. in the covered node instead of in the covering one. The error here is in you removing read and search permission from the mountpoint. (another reason why .. must be special-cased is that it is meaningless for the root directory, and the one in the root directory of a chroot or jail must be hidden from some processes but not others - it wouldn't do to rely on the individual vfs to do this) > Workaround: change permissions of mountpoints Fix, not workaround. The permissions of the covered node are *not* irrelevant; in some cases (like msdosfs) they even control the behaviour of the mounted filesystem. DES -- Dag-Erling Smorgrav - des@ofug.org State Changed From-To: open->closed Not a bug. |