xref: /original-bsd/sbin/mount_umap/mount_umap.8 (revision 65d10654)
1.\" Copyright (c) 1992, 1993, 1994
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.4 (Berkeley) 05/01/95
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 o Ar options
21.Ar target
22.Ar mount-point
23.Ar uid-mapfile
24.Ar gid-mapfile
25.Sh DESCRIPTION
26The
27.Nm mount_umap
28command is used to mount a sub-tree of an existing file system
29that uses a different set of uids and gids than the local system.
30Such a file system could be mounted from a remote site via NFS or
31it could be a file system on removable media brought from some
32foreign location that uses a different password file.
33.Pp
34The options are as follows:
35.Bl -tag -width indent
36.It Fl o
37Options are specified with a
38.Fl o
39flag followed by a comma separated string of options.
40See the
41.Xr mount 8
42man page for possible options and their meanings.
43.El
44.Pp
45The
46.Nm mount_umap
47command uses a set of files provided by the user to make correspondences
48between uids and gids in the sub-tree's original environment and
49some other set of ids in the local environment.  For instance, user
50smith might have uid 1000 in the original environment, while having
51uid 2000 in the local environment.  The
52.Nm mount_umap
53command allows the subtree from smith's original environment to be
54mapped in such a way that all files with owning uid 1000 look like
55they are actually owned by uid 2000.
56.Pp
57.Em target
58should be the current location of the sub-tree in the
59local system's name space.
60.Em mount-point
61should be a directory
62where the mapped subtree is to be placed.
63.Em uid-mapfile
64and
65.Em gid-mapfile
66describe the mappings to be made between identifiers.
67Briefly, the format of these files is a count of the number of
68mappings on the first line, with each subsequent line containing
69a single mapping.  Each of these mappings consists of an id from
70the original environment and the corresponding id in the local environment,
71separated by white space.
72.Em uid-mapfile
73should contain all uid
74mappings, and
75.Em gid-mapfile
76should contain all gid mappings.
77Any uids not mapped in
78.Em uid-mapfile
79will be treated as user NOBODY,
80and any gids not mapped in
81.Em gid-mapfile
82will be treated as group
83NULLGROUP.  At most 64 uids can be mapped for a given subtree, and
84at most 16 groups can be mapped by a given subtree.
85.Pp
86The mapfiles can be located anywhere in the file hierarchy, but they
87must be owned by root, and they must be writable only by root.
88.Nm mount_umap
89will refuse to map the sub-tree if the ownership or permissions on
90these files are improper.  It will also balk if the count of mappings
91in the first line of the map files is not correct.
92.Pp
93The layer created by the
94.Nm mount_umap
95command is meant to serve as a simple example of file system layering.
96It is not meant for production use.  The implementation is not very
97sophisticated.
98.Sh SEE ALSO
99.Xr mount 8 ,
100.Xr mount_null 8
101.Sh HISTORY
102The
103.Nm mount_umap
104utility first appeared in 4.4BSD.
105