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