Make this manual page a lot more helpful.

This commit is contained in:
thorpej 2001-03-06 20:12:33 +00:00
parent d6ff14bfde
commit 6f05b85270
1 changed files with 43 additions and 33 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mount_umap.8,v 1.10 1999/03/07 11:02:08 mycroft Exp $
.\" $NetBSD: mount_umap.8,v 1.11 2001/03/06 20:12:33 thorpej Exp $
.\"
.\" Copyright (c) 1992, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -37,12 +37,12 @@
.\"
.\" @(#)mount_umap.8 8.4 (Berkeley) 5/1/95
.\"
.Dd May 1, 1995
.Dd March 6, 2001
.Dt MOUNT_UMAP 8
.Os BSD 4.4
.Os NetBSD
.Sh NAME
.Nm mount_umap
.Nd sample file system layer
.Nd user and group ID remapping file system layer
.Sh SYNOPSIS
.Nm ""
.Op Fl o Ar options
@ -57,9 +57,12 @@ The
.Nm
command is used to mount a sub-tree of an existing file system
that uses a different set of uids and gids than the local system.
Such a file system could be mounted from a remote site via NFS or
it could be a file system on removable media brought from some
foreign location that uses a different password file.
Such a file system could be mounted from a remote site via NFS,
a local file system on removable media brought from some foreign
location that uses a different user/group database, or could be
a local file system for another operating system which does not
support Unix-style user/group IDs, or which uses a different
numbering scheme.
.Pp
The options are as follows:
.Bl -tag -width indent
@ -70,6 +73,14 @@ flag followed by a comma separated string of options.
See the
.Xr mount 8
man page for possible options and their meanings.
.It Fl g Ar gid-mapfile
Use the group ID mapping specified in
.Ar gid-mapfile .
This flag is required.
.It Fl u Ar uid-mapfile
Use the user ID mapping specified in
.Ar uid-mapfile .
This flag is required.
.El
.Pp
The
@ -94,40 +105,39 @@ where the mapped subtree is to be placed.
and
.Em gid-mapfile
describe the mappings to be made between identifiers.
Briefly, the format of these files is a count of the number of
mappings on the first line, with each subsequent line containing
a single mapping. Each of these mappings consists of an id from
the original environment and the corresponding id in the local environment,
separated by white space.
.Em uid-mapfile
should contain all uid
mappings, and
.Em gid-mapfile
should contain all gid mappings.
Any uids not mapped in
.Em uid-mapfile
will be treated as user NOBODY,
and any gids not mapped in
.Em gid-mapfile
will be treated as group
NULLGROUP. At most 64 uids can be mapped for a given subtree, and
at most 16 groups can be mapped by a given subtree.
.Pp
The format of the user and group ID mapping files is very simple.
The first line of the file is the total number of mappings present
in the file. The remaining lines each consist of two numbers: the
ID in the mapped subtree and the ID in the original subtree.
.Pp
For example, to map uid 1000 in the original subtree to uid 2000
in the mapped subtree:
.Bd -unfilled -offset indent
1
2000 1000
.Ed
.Pp
For user IDs in the original subtree for which no mapping exists,
the user ID will be mapped to the user
.Dq nobody .
For group IDs in the original subtree for which no mapping exists,
the group ID will be mapped to the group
.Dq nobody .
.Pp
There is a limit of 64 user ID mappings and 16 group ID mappings.
.Pp
The mapfiles can be located anywhere in the file hierarchy, but they
must be owned by root, and they must be writable only by root.
.Nm
will refuse to map the sub-tree if the ownership or permissions on
these files are improper. It will also balk if the count of mappings
in the first line of the map files is not correct.
.Pp
The layer created by the
.Nm
command is meant to serve as a simple example of file system layering.
It is not meant for production use. The implementation is not very
sophisticated.
these files are improper. It will also report an error if the count
of mappings in the first line of the map files is not correct.
.Sh SEE ALSO
.Xr mount 8 ,
.Xr mount_null 8
.Sh BUGS
The implementation is not very sophisticated.
.Sh HISTORY
The
.Nm