PWD gives getwd: couldn't open .. on world r-x root directories

Tim Ramsey tar at ksuvax1.cis.ksu.edu
Sun Nov 6 20:03:05 AEST 1988


In article <1165 at ksuvax1.cis.ksu.edu> I write:
>It seems odd that the permissions of the mount point affect access to the
>mounted file system.  Is this a bug or feature?

In article <1971 at cbnews.ATT.COM> lvc at cbnews.ATT.COM (Lawrence V. Cipriani) writes:
>This is a feature.  The permissions of the mount point determine the permission
>of the directory after the mount.  The permission on the raw disk only control
>access to that disk device as if it was a file.

I think you are referring to the special file in /dev.  I was commenting on
the mount point and the filesystem root directory.

To add to the confusion (this is 4.3BSD):

% ls -ld /mnt
drwxr-xr-x  7 root          512 Aug  7 23:47 /mnt
% umount /mnt
% ls -ld /mnt
drwxr-xr-x  2 root          512 Jan 88 09:12 /mnt
% chmod 000 /mnt
% ls -ld /mnt
d---------  2 root          512 Jan 88 09:12 /mnt
% mount /mnt
% ls -ld /mnt
drwxr-xr-x  2 root          512 Jan 88 09:12 /mnt

The root directory of the mounted filesystem "hides" the mount directory.
So you don't see the 000 permissions.  I spent a goodly amount of time looking
for the problem the first time I ran into this.

It appears that access checks are done for both the mount directory and the
file system root directory.  You have to pass both to read/write/execute.
I dunno, but this seems like a bug.

-- 
Timothy Ramsey, USENET Keeper-Upper  | Ada:
BITNET: tar at KSUVAX1                  |         Just say NO!
Internet: tar at ksuvax1.cis.ksu.edu    |
UUCP: ... !{pyramid,ucsd}!ncr-sd!ncrwic!ksuvax1!tar



More information about the Comp.unix.questions mailing list