summaryrefslogtreecommitdiff
path: root/sbin/mount_umap/mount_umap.8
blob: 2aacd29122dc7c4d92da03eebf2c9cced4297eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.\"	$OpenBSD: mount_umap.8,v 1.14 2000/03/18 22:56:01 aaron Exp $
.\"	$NetBSD: mount_umap.8,v 1.4 1996/03/05 02:36:42 thorpej Exp $
.\"
.\" Copyright (c) 1992, 1993, 1994
.\"	The Regents of the University of California.  All rights reserved.
.\" All rights reserved.
.\"
.\" This code is derived from software donated to Berkeley by
.\" Jan-Simon Pendry and from John Heidemann of the UCLA Ficus project.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"	@(#)mount_umap.8	8.3 (Berkeley) 3/27/94
.\"
.Dd March 27, 1994
.Dt MOUNT_UMAP 8
.Os
.Sh NAME
.Nm mount_umap
.Nd sample file system layer
.Sh SYNOPSIS
.Nm mount_umap
.Op Fl o Ar options
-u
.Ar uid-mapfile
-g
.Ar gid-mapfile
.Ar target
.Ar mount_point
.Sh DESCRIPTION
The
.Nm
command is used to mount a subtree 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.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl o Ar options
Options are specified with a
.Fl o
flag followed by a comma separated string of options.
See the
.Xr mount 8
man page for possible options and their meanings.
.El
.Pp
The
.Nm
command uses a set of files provided by the user to make correspondences
between UIDs and GIDs in the subtree's original environment and
some other set of IDs in the local environment.
For instance, user
smith might have UID 1000 in the original environment, while having
UID 2000 in the local environment.
The
.Nm
command allows the subtree from smith's original environment to be
mapped in such a way that all files with owner UID 1000 look like
they are actually owned by UID 2000.
.Pp
.Em target
should be the current location of the subtree in the
local system's name space.
.Ar mount_point
should be a directory
where the mapped subtree is to be placed.
.Em uid-mapfile
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 whitespace.
.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 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 subtree 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.
.Sh SEE ALSO
.Xr mount 8 ,
.Xr mount_null 8
.Sh HISTORY
The
.Nm
utility first appeared in
.Bx 4.4 .