From owner-freebsd-bugs Sat Oct 20 4:40:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DEC5F37B401 for ; Sat, 20 Oct 2001 04:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9KBe2f12951; Sat, 20 Oct 2001 04:40:02 -0700 (PDT) (envelope-from gnats) Date: Sat, 20 Oct 2001 04:40:02 -0700 (PDT) Message-Id: <200110201140.f9KBe2f12951@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dag-Erling Smorgrav Subject: Re: kern/31375: "cd .." at mount-point uses perms of dir under mount Reply-To: Dag-Erling Smorgrav Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/31375; it has been noted by GNATS. From: Dag-Erling Smorgrav 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