Commit | Line | Data |
---|---|---|
63666ef6 JH |
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 | .\" %sccs.include.redist.roff% | |
11 | .\" | |
12 | .\" @(#)mount_umap.8 5.1 (Berkeley) %G% | |
13 | .\" | |
14 | .\" | |
15 | .Dd | |
16 | .Dt MOUNT_UMAP 8 | |
17 | .Os BSD 4.4 | |
18 | .Sh NAME | |
19 | .Nm mount_umap | |
20 | .Nd sample file system layer | |
21 | .Sh SYNOPSIS | |
22 | .Nm mount_umap | |
23 | .Op Fl F Ar fsoptions | |
24 | .Ar target mount-point uid-mapfile gid-mapfile | |
25 | .Sh DESCRIPTION | |
26 | The | |
27 | .Nm mount_umap | |
28 | command is used to mount a sub-tree of an existing file system | |
29 | that uses a different set of uids and gids than the local system. | |
30 | Such a file system could be mounted from a remote site via NFS or | |
31 | it could be a file system on removable media brought from some | |
32 | foreign location that uses a different password file and yellow pages. | |
33 | The | |
34 | .Nm mount_umap | |
35 | command uses a set of files provided by the user to make correspondences | |
36 | between uids and gids in the sub-tree's original environment and | |
37 | some other set of ids in the local environment. For instance, user | |
38 | smith might have uid 1000 in the original environment, while having | |
39 | uid 2000 in the local environment. The | |
40 | .Nm mount_umap | |
41 | command allows the subtree from smith's original environment to be | |
42 | mapped in such a way that all files with owning uid 1000 look like | |
43 | they are actually owned by uid 2000. | |
44 | .Pp | |
45 | The target should be the current location of the sub-tree in the | |
46 | local system's name space. The mount-point should be a directory | |
47 | where the mapped subtree is to be placed. The uid-mapfile and | |
48 | gid-mapfile describe the mappings to be made between identifiers. | |
49 | Briefly, the format of these files is a count of the number of | |
50 | mappings on the first line, with each subsequent line containing | |
51 | a single mapping. Each of these mappings consists of an id from | |
52 | the original environment and the corresponding id in the local environment, | |
53 | separated by white space. The uid-mapfile should contain all uid | |
54 | mappings, and the gid-mapfile should contain all gid mappings. | |
55 | Any uids not mapped in the uid-mapfile will be treated as user NOBODY, | |
56 | and any gids not mapped in the gid-mapfile will be treated as group | |
57 | NULLGROUP. At most 64 uids can be mapped for a given subtree, and | |
58 | at most 16 groups can be mapped by a given subtree. | |
59 | .Pp | |
60 | The mapfiles can be located anywhere in the file hierarchy, but they | |
61 | must be owned by root, and they must be writable only by root. | |
62 | .Nm mount_umap | |
63 | will refuse to map the sub-tree if the ownership or permissions on | |
64 | these files are improper. It will also balk if the count of mappings | |
65 | in the first line of the map files is not correct. | |
66 | .Pp | |
67 | The layer created by the | |
68 | .Nm mount_umap | |
69 | command is meant to serve as a simple example of file system layering. | |
70 | It is not meant for production use. The implementation is not very | |
71 | sophisticated, and not particularly fast. | |
72 | ||
73 | This command makes use of the layered file system, described | |
74 | command makes a sub-tree of an existing filesystem visible | |
75 | in another part of the global filesystem namespace, | |
76 | while also performing mappings of uids and gids. | |
77 | This allows existing files and directories to be accessed | |
78 | using a different pathname. | |
79 | .Pp | |
80 | Virtual file system sub-trees created by the null layer should | |
81 | be identical to those created by the loopback | |
82 | The virtual copy of a file system sub-tree created by the null | |
83 | layer should be nearly identical to one created by | |
84 | .Xr mount_lofs 8 . | |
85 | The purpose of the null layer is to serve as a basis for future | |
86 | layer development. | |
87 | .Pp | |
88 | An example of a layer constructed from the null layer is | |
89 | the umap layer (see | |
90 | .Xr mount_umap 8 ). | |
91 | .Sh SEE ALSO | |
92 | UCLA Technical Report CSD-910056, | |
93 | "Stackable Layers: an Architecture for File System Development". | |
94 | .Sh HISTORY | |
95 | The | |
96 | null file system layer | |
97 | is | |
98 | .Ud |