Date: Sat, 20 Oct 2001 04:40:02 -0700 (PDT) From: Dag-Erling Smorgrav <des@ofug.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/31375: "cd .." at mount-point uses perms of dir under mount Message-ID: <200110201140.f9KBe2f12951@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/31375; it has been noted by GNATS. From: Dag-Erling Smorgrav <des@ofug.org> To: pdp@nl.demon.net Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/31375: "cd .." at mount-point uses perms of dir under mount Date: 20 Oct 2001 13:33:59 +0200 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110201140.f9KBe2f12951>