NFS and links... please explain ../../private/usr/lib

Casper H.S. Dik dik at uva.UUCP
Thu Feb 16 02:39:26 AEST 1989


Cris.Fuhrman at a.coe.wvu.wvnet.edu writes:
> [stuff deleted about accessing ../.. on clients in /usr/lib ]
>From the server, ls -ld /usr yields
>
>lrwxrwxrwx  1 root       11 Jun  3 1988 /usr -> usr.MC68020/
>
>and ls -ld /usr/lib yields
>
>drwxr-xr-x 21 bin     4096 Dec 21 15:46 lib/
>
>Anyone care to comment?
>
>I'm pretty frustrated about the NFS cross mounting kludge... Just when I 
>thought I was beginning to like unix...

You stumbled accross one of the nastiest bugs I've encountered.

I had the same problem, and it turned out to be caused by the permissions
set for the mount point.

When you access '..' in the root of a NFS-mounted filesystem, this is
translated to a search for .. in the mount point.

If you the permissions for the mount point aren't right - trouble ahead.

Fix:
    umount /usr
    chmod a+rx /usr   (need both read & execute permission)
    mount /usr

This bug once cost me the better part of a day, I dumped the fs and ran
newfs - all to no avail.

I don't know for sure but it seems to happen on normally (not NFS) mounted
filesystems as well.

Let's try.

# chmod 700 /mnt
# ls -ld /mnt
drwx------  2 bin            24 Sep 15  1986 /mnt/
# mount /dev/sd2c /mnt
# ls -ld /mnt
drwxr-xr-x  3 root         1024 Feb  2 19:33 /mnt/
# su nobody
$ cd mnt
$ ls -ld 
drwxr-xr-x  3 root         1024 Feb  2 19:33 .
$ ls -ld ..
. not found


So check all your mount points and chmod a+rx them.

[[ Remember:  in order to change the mount point itself, you have to do
the chmod before the file system is mounted there.  Otherwise you will be
changing the root directory of the mounted file system (and in the case of
NFS partitions, it might produce an error message).  --wnl ]]

--cd

Casper H.S. Dik
University of Amsterdam     |		      dik at uva.uucp
The Netherlands             |                 ...!uunet!mcvax!uva!dik



More information about the Comp.sys.sun mailing list