Subject: Re: exporting -ro nfs
To: None <wrstuden@netbsd.org>
From: None <rick@snowhite.cis.uoguelph.ca>
List: tech-security
Date: 01/28/2007 14:16:53
> No. File handles within an fs will still be used in the same way. We will
> just have a different mapping between the file system specific info and
> the on-wire NFS file handle.

I'm not sure how you are going to implement "different mapping"? Remember
that file handles are T stable, which means they refer to a file even
long after the file is deleted, must work across server reboots, etc.

Anyhow, here is the case I was referring to. Suppose the local file system
is /usr, and the exports are:
/usr -rw
/usr/sub -ro

Now suppose /usr/foo and /usr/sub/bar are both hard links to the same file.

ie One hard link is exported rw and the other ro. How do you differentiate
these cases without using different file handles for the two hard links?
One way is to put the export flags, etc in every i-node, but that's a lot
of work and you can have fun propagating them down the directory tree.
Other than that, the only way I can see to do the above exports to the
same hosts is make /usr/sub a separate file system --> no hard link
could then exist.

As I noted, using different file handles for the hard links of the same
file isn't exactly disallowed by the RFCs, but it does cause grief for
clients. (See the "Finding Hardlinks" thread in the current email archive
under www.nfsv4.org.)

rick