MFC r154990, r180071, r180112, r180154:

- use the ".Pa" macro for path names
- markup fixes
- advise to use rc script to SIGHUP mountd
- add some missing words
- add information about possiblity of using /prefix network notation [1]

PR:		docs/124373 [1]
Obtained from:	NetBSD [1]
This commit is contained in:
danger 2008-07-05 10:29:27 +00:00
parent cc620919fa
commit 46900df0a5

View File

@ -28,7 +28,7 @@
.\" @(#)exports.5 8.3 (Berkeley) 3/29/95
.\" $FreeBSD$
.\"
.Dd March 29, 1995
.Dd June 30, 2008
.Dt EXPORTS 5
.Os
.Sh NAME
@ -61,7 +61,9 @@ last line with a backslash
A host may be specified only once for each local file system on the
server and there may be only one default entry for each server
file system that applies to all other hosts.
The latter exports the file system to the ``world'' and should
The latter exports the file system to the
.Dq world
and should
be used only when the file system contains public information.
.Pp
In a mount entry,
@ -80,20 +82,24 @@ including regular files if the
option is used on
.Xr mountd 8 .
The pathnames must not have any symbolic links in them and should not have
any "." or ".." components.
any
.Dq Pa \&.
or
.Dq Pa ..
components.
Mount points for a file system may appear on multiple lines each with
different sets of hosts and export options.
.Pp
The second component of a line specifies how the file system is to be
exported to the host set.
The option flags specify whether the file system
is exported read-only or read-write and how the client uid is mapped to
is exported read-only or read-write and how the client UID is mapped to
user credentials on the server.
.Pp
Export options are specified as follows:
.Pp
.Sm off
.Fl maproot No = Sy user
.Fl maproot Li = Sy user
.Sm on
The credential of the specified user is used for remote access by root.
The credential includes all the groups to which the user is a member
@ -102,7 +108,7 @@ on the local machine (see
The user may be specified by name or number.
.Pp
.Sm off
.Fl maproot No = Sy user:group1:group2:...
.Fl maproot Li = Sy user:group1:group2:...
.Sm on
The colon separated list is used to specify the precise credential
to be used for remote access by root.
@ -111,13 +117,13 @@ Note that user: should be used to distinguish a credential containing
no groups from a complete credential for that user.
.Pp
.Sm off
.Fl mapall No = Sy user
.Fl mapall Li = Sy user
.Sm on
or
.Sm off
.Fl mapall No = Sy user:group1:group2:...
.Fl mapall Li = Sy user:group1:group2:...
.Sm on
specifies a mapping for all client uids (including root)
specifies a mapping for all client UIDs (including root)
using the same semantics as
.Fl maproot .
.Pp
@ -159,7 +165,7 @@ be done with the
.Fl public
flag.
However, this flag in itself allows r/w access to all files in
the file system, not requiring reserved ports and not remapping uids.
the file system, not requiring reserved ports and not remapping UIDs.
It
is only provided to conform to the spec, and should normally not be used.
For a
@ -180,7 +186,7 @@ exported on a server.
.Pp
A
.Sm off
.Fl index No = Sy file
.Fl index No = Pa file
.Sm on
option can be used to specify a file whose handle will be returned if
a directory is looked up using the public filehandle
@ -209,8 +215,14 @@ below).
The third component of a line specifies the host set to which the line applies.
The set may be specified in three ways.
The first way is to list the host name(s) separated by white space.
(Standard Internet ``dot'' addresses may be used in place of names.)
The second way is to specify a ``netgroup'' as defined in the netgroup file (see
(Standard Internet
.Dq dot
addresses may be used in place of names.)
The second way is to specify a
.Dq netgroup
as defined in the
.Pa netgroup
file (see
.Xr netgroup 5 ) .
The third way is to specify an Internet subnetwork using a network and
network mask that is defined as the set of all hosts with addresses within
@ -221,18 +233,27 @@ large number of clients within an administrative subnet.
.Pp
The first two cases are specified by simply listing the name(s) separated
by whitespace.
All names are checked to see if they are ``netgroup'' names
All names are checked to see if they are
.Dq netgroup
names
first and are assumed to be hostnames otherwise.
Using the full domain specification for a hostname can normally
circumvent the problem of a host that has the same name as a netgroup.
The third case is specified by the flag
.Sm off
.Fl network No = Sy netname
.Fl network Li = Sy netname Op Li / Ar prefixlength
.Sm on
and optionally
.Sm off
.Fl mask No = Sy netmask .
.Sm on
The netmask may be specified either by attaching a
.Ar prefixlength
to the
.Fl network
option, or by using a separate
.Fl mask
option.
If the mask is not specified, it will default to the mask for that network
class (A, B or C; see
.Xr inet 4 ) .
@ -240,13 +261,23 @@ See the
.Sx EXAMPLES
section below.
.Pp
Scoped IPv6 address must carry scope identifier as documented in
.Xr inet6 4 .
For example,
.Dq Li fe80::%re2/10
is used to specify
.Li fe80::/10
on
.Li re2
interface.
.Pp
The
.Xr mountd 8
utility can be made to re-read the
.Nm
file by sending it a hangup signal as follows:
.Bd -literal -offset indent
kill -s HUP `cat /var/run/mountd.pid`
/etc/rc.d/mountd reload
.Ed
.Pp
After sending the
@ -269,53 +300,92 @@ the default remote mount-point file
/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
/usr -ro -mapall=nobody
/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
/a -network 192.168.0/24
/a -network 3ffe:1ce1:1:fe80::/64
/u2 -maproot=root friends
/u2 -alldirs -network cis-net -mask cis-mask
/cdrom -alldirs,quiet,ro -network 192.168.33.0 -mask 255.255.255.0
.Ed
.Pp
Given that
.Sy /usr ,
.Sy /u
.Pa /usr , /u , /a
and
.Sy /u2
.Pa /u2
are
local file system mount points, the above example specifies the following:
.Pp
.Sy /usr
The file system rooted at
.Pa /usr
is exported to hosts
.Em friends
where friends is specified in the netgroup file
with users mapped to their remote credentials and
root mapped to uid 0 and group 10.
It is exported read-write and the hosts in ``friends'' can mount either /usr
or /usr/local.
root mapped to UID 0 and group 10.
It is exported read-write and the hosts in
.Dq friends
can mount either
.Pa /usr
or
.Pa /usr/local .
It is exported to
.Em 131.104.48.16
and
.Em grumpy.cis.uoguelph.ca
with users mapped to their remote credentials and
root mapped to the user and groups associated with ``daemon'';
root mapped to the user and groups associated with
.Dq daemon ;
it is exported to the rest of the world as read-only with
all users mapped to the user and groups associated with ``nobody''.
all users mapped to the user and groups associated with
.Dq nobody .
.Pp
.Sy /u
The file system rooted at
.Pa /u
is exported to all hosts on the subnetwork
.Em 131.104.48
with root mapped to the uid for ``bin'' and with no group access.
with root mapped to the UID for
.Dq bin
and with no group access.
.Pp
.Sy /u2
is exported to the hosts in ``friends'' with root mapped to uid and groups
associated with ``root'';
it is exported to all hosts on network ``cis-net'' allowing mounts at any
The file system rooted at
.Pa /u2
is exported to the hosts in
.Dq friends
with root mapped to UID and groups
associated with
.Dq root ;
it is exported to all hosts on network
.Dq cis-net
allowing mounts at any
directory within /u2.
.Pp
The file system rooted at
.Sy /cdrom
will exported read-only to the entire network 192.168.33.0/24, including
.Pa /a
is exported to the network 192.168.0.0, with a netmask of 255.255.255.0.
However, the netmask length in the entry for
.Pa /a
is not specified through a
.Fl mask
option, but through the
.Li / Ns Ar prefix
notation.
.Pp
The file system rooted at
.Pa /a
is also exported to the IPv6 network
.Li 3ffe:1ce1:1:fe80::
address, using the upper 64 bits as the prefix.
Note that, unlike with IPv4 network addresses, the specified network
address must be complete, and not just contain the upper bits.
With IPv6 addresses, the
.Fl mask
option must not be used.
.Pp
The file system rooted at
.Pa /cdrom
will be exported read-only to the entire network 192.168.33.0/24, including
all its subdirectories.
Since
.Sy /cdrom
.Pa /cdrom
is the conventional mountpoint for a CD-ROM device, this export will
fail if no CD-ROM medium is currently mounted there since that line
would then attempt to export a subdirectory of the root file system
@ -331,15 +401,15 @@ As soon as an actual CD-ROM is going to be mounted,
will notify
.Xr mountd 8
about this situation, and the
.Sy /cdrom
.Pa /cdrom
file system will be exported as intended.
Note that without using the
.Fl alldirs
option, the export would always succeed.
While there is no CD-ROM medium mounted under
.Sy /cdrom ,
.Pa /cdrom ,
it would export the (normally empty) directory
.Sy /cdrom
.Pa /cdrom
of the root file system instead.
.Sh SEE ALSO
.Xr netgroup 5 ,