xref: /original-bsd/sbin/mount_umap/mount_umap.8 (revision 5fe42eba)
1.\" Copyright (c) 1992, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\" All rights reserved.
4.\"
5.\" This code is derived from software donated to Berkeley by
6.\" Jan-Simon Pendry and from John Heidemann of the UCLA Ficus project.
7.\"
8.\" %sccs.include.redist.roff%
9.\"
10.\"	@(#)mount_umap.8	8.1 (Berkeley) 06/09/93
11.\"
12.Dd ""
13.Dt MOUNT_UMAP 8
14.Os BSD 4.4
15.Sh NAME
16.Nm mount_umap
17.Nd sample file system layer
18.Sh SYNOPSIS
19.Nm mount_umap
20.Op Fl F Ar fsoptions
21.Ar target mount-point uid-mapfile gid-mapfile
22.Sh DESCRIPTION
23The
24.Nm mount_umap
25command is used to mount a sub-tree of an existing file system
26that uses a different set of uids and gids than the local system.
27Such a file system could be mounted from a remote site via NFS or
28it could be a file system on removable media brought from some
29foreign location that uses a different password file.
30The
31.Nm mount_umap
32command uses a set of files provided by the user to make correspondences
33between uids and gids in the sub-tree's original environment and
34some other set of ids in the local environment.  For instance, user
35smith might have uid 1000 in the original environment, while having
36uid 2000 in the local environment.  The
37.Nm mount_umap
38command allows the subtree from smith's original environment to be
39mapped in such a way that all files with owning uid 1000 look like
40they are actually owned by uid 2000.
41.Pp
42.Em target
43should be the current location of the sub-tree in the
44local system's name space.
45.Em mount-point
46should be a directory
47where the mapped subtree is to be placed.
48.Em uid-mapfile
49and
50.Em gid-mapfile
51describe the mappings to be made between identifiers.
52Briefly, the format of these files is a count of the number of
53mappings on the first line, with each subsequent line containing
54a single mapping.  Each of these mappings consists of an id from
55the original environment and the corresponding id in the local environment,
56separated by white space.
57.Em uid-mapfile
58should contain all uid
59mappings, and
60.Em gid-mapfile
61should contain all gid mappings.
62Any uids not mapped in
63.Em uid-mapfile
64will be treated as user NOBODY,
65and any gids not mapped in
66.Em gid-mapfile
67will be treated as group
68NULLGROUP.  At most 64 uids can be mapped for a given subtree, and
69at most 16 groups can be mapped by a given subtree.
70.Pp
71The mapfiles can be located anywhere in the file hierarchy, but they
72must be owned by root, and they must be writable only by root.
73.Nm mount_umap
74will refuse to map the sub-tree if the ownership or permissions on
75these files are improper.  It will also balk if the count of mappings
76in the first line of the map files is not correct.
77.Pp
78The layer created by the
79.Nm mount_umap
80command is meant to serve as a simple example of file system layering.
81It is not meant for production use.  The implementation is not very
82sophisticated.
83.Sh SEE ALSO
84.Xr mount_null 8 ,
85.Xr mount_lofs 8
86.Sh HISTORY
87The
88.Nm mount_umap
89utility first appeared in 4.4BSD.
90