> The problem is, as far as I can tell, the kernel does not let you know
> what is exported.  Certainly looking into the /proc/<pid>/ files does
> not show what is exported in the usual places.
> 
> If the kernel doesn't let you know, then its going to be hard to figure
> it out.  Of course if you know the secret location of these exports than
> its going to make things easier.

The "showmount -e" command extracts this information.  It does it via
an RPC call (via the portmap daemon) to the rpc.mountd daemon.  This
is the standard way to find out.

If you wanted to be trickier, you could examine the mountd daemon and
see where it is communicating with the kernel about this info.

The man page for exportfs(8) says that interface is /proc/fs/nfsd (in
new kernels), and indeed that file exists in my system.  But it
appears that the kernel sends requests up via that file, and the
daemon responds to them; there may not be a way to list the kernel's
mount table, which is considered a cache of the one maintained by the
mount daemon.  Stracing the command "exportfs", which outputs similar
info to "showmount -e", shows that it gets it from /var/lib/nfs/etab.
But that seems like too-heavy reliance on an implementation detail,
particularly for a program like fuser that isn't an intimate part of
the NFS subsystem.

        John


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to