From owner-freebsd-bugs Fri Oct 19 8:20: 8 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 D653437B403 for ; Fri, 19 Oct 2001 08:20:00 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9JFK0f06203; Fri, 19 Oct 2001 08:20:00 -0700 (PDT) (envelope-from gnats) Received: from hermes.mail.nl.demon.net (hermes.mail.nl.demon.net [194.159.72.197]) by hub.freebsd.org (Postfix) with ESMTP id 8F1D137B401 for ; Fri, 19 Oct 2001 08:15:24 -0700 (PDT) Received: from samhain.noc.nl.demon.net ([194.159.72.214]) by hermes.mail.nl.demon.net with esmtp (Exim 3.31 #1) id 15ubMp-000LmP-00 for FreeBSD-gnats-submit@freebsd.org; Fri, 19 Oct 2001 17:15:23 +0200 Received: by samhain.noc.nl.demon.net with local id 15ubMp-000DN9-00 for FreeBSD-gnats-submit@freebsd.org; Fri, 19 Oct 2001 15:15:23 +0000 Message-Id: Date: Fri, 19 Oct 2001 15:15:23 +0000 From: pdp@nl.demon.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/31375: "cd .." at mount-point uses perms of dir under mount 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 >Number: 31375 >Category: kern >Synopsis: "cd .." at mount-point uses perms of dir under mount >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 19 08:20:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Phil Pennock >Release: FreeBSD 4.4-STABLE i386 >Organization: Demon Internet Netherlands >Environment: System built to RELENG_4, cvsup'd 2001-10-17. Kernel config available upon request. Filesystems used are ufs. >Description: It appears that when determining where ".." is, in a directory which is a mount-point, the file-permissions of the underlying directory are used, rather than the permissions of the mounted directory. See below for evidence backing this analysis. Found because it breaks /etc/periodic/weekly/310.locate Note that the practice of "chmod 0 /a/mountpoint" is not unusual. Workaround: change permissions of mountpoints >How-To-Repeat: # mkdir /d/mounthere # touch /d/mounthere/NOTHING_MOUNTED_HERE # chmod 0 /d/mounthere [ have a relevant filesystem in /etc/fstab, or choose one ] # mount /d/mounthere # su -m nobody $ 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 .. $ # umount /d/mounthere # chmod 555 /d/mounthere # mount /d/mounthere # su -m nobody $ cd /d/mounthere $ cd .. $ pwd /d $ >Fix: Unknown >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message