BSD 4_4 release
[unix-history] / usr / src / sbin / mount_umap / mount_umap.8
CommitLineData
ad787160
C
1.\" Copyright (c) 1992, 1993
2.\" The Regents of the University of California. All rights reserved.
63666ef6
JH
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.\"
ad787160
C
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\" must display the following acknowledgement:
18.\" This product includes software developed by the University of
19.\" California, Berkeley and its contributors.
20.\" 4. Neither the name of the University nor the names of its contributors
21.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission.
63666ef6 23.\"
ad787160
C
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE.
5f8711c1 35.\"
ad787160
C
36.\" @(#)mount_umap.8 8.1 (Berkeley) 6/9/93
37.\"
38.Dd "June 9, 1993"
63666ef6
JH
39.Dt MOUNT_UMAP 8
40.Os BSD 4.4
41.Sh NAME
42.Nm mount_umap
43.Nd sample file system layer
44.Sh SYNOPSIS
45.Nm mount_umap
46.Op Fl F Ar fsoptions
47.Ar target mount-point uid-mapfile gid-mapfile
48.Sh DESCRIPTION
49The
50.Nm mount_umap
51command is used to mount a sub-tree of an existing file system
52that uses a different set of uids and gids than the local system.
53Such a file system could be mounted from a remote site via NFS or
54it could be a file system on removable media brought from some
5091e5f6 55foreign location that uses a different password file.
63666ef6
JH
56The
57.Nm mount_umap
58command uses a set of files provided by the user to make correspondences
59between uids and gids in the sub-tree's original environment and
60some other set of ids in the local environment. For instance, user
61smith might have uid 1000 in the original environment, while having
62uid 2000 in the local environment. The
63.Nm mount_umap
64command allows the subtree from smith's original environment to be
65mapped in such a way that all files with owning uid 1000 look like
66they are actually owned by uid 2000.
67.Pp
5091e5f6
JH
68.Em target
69should be the current location of the sub-tree in the
70local system's name space.
71.Em mount-point
72should be a directory
73where the mapped subtree is to be placed.
74.Em uid-mapfile
75and
76.Em gid-mapfile
77describe the mappings to be made between identifiers.
63666ef6
JH
78Briefly, the format of these files is a count of the number of
79mappings on the first line, with each subsequent line containing
80a single mapping. Each of these mappings consists of an id from
81the original environment and the corresponding id in the local environment,
5091e5f6
JH
82separated by white space.
83.Em uid-mapfile
84should contain all uid
85mappings, and
86.Em gid-mapfile
87should contain all gid mappings.
88Any uids not mapped in
89.Em uid-mapfile
90will be treated as user NOBODY,
91and any gids not mapped in
92.Em gid-mapfile
93will be treated as group
63666ef6
JH
94NULLGROUP. At most 64 uids can be mapped for a given subtree, and
95at most 16 groups can be mapped by a given subtree.
96.Pp
97The mapfiles can be located anywhere in the file hierarchy, but they
98must be owned by root, and they must be writable only by root.
99.Nm mount_umap
100will refuse to map the sub-tree if the ownership or permissions on
101these files are improper. It will also balk if the count of mappings
102in the first line of the map files is not correct.
103.Pp
104The layer created by the
105.Nm mount_umap
106command is meant to serve as a simple example of file system layering.
107It is not meant for production use. The implementation is not very
5091e5f6 108sophisticated.
63666ef6 109.Sh SEE ALSO
5091e5f6 110.Xr mount_null 8 ,
5f8711c1 111.Xr mount_lofs 8
63666ef6
JH
112.Sh HISTORY
113The
ad787160
C
114.Nm mount_umap
115utility first appeared in 4.4BSD.