Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2001 15:15:23 +0000
From:      pdp@nl.demon.net
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/31375: "cd .." at mount-point uses perms of dir under mount
Message-ID:  <E15ubMp-000DN9-00@samhain.noc.nl.demon.net>

next in thread | raw e-mail | index | archive | help

>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 ..
$ <control-D>
# 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E15ubMp-000DN9-00>