umap_manual revision 1.1 1 1.1 mycroft
2 1.1 mycroft \appendix
3 1.1 mycroft \section{The umap Layer} \label{sect:umap}
4 1.1 mycroft
5 1.1 mycroft \subsection{Introduction}
6 1.1 mycroft
7 1.1 mycroft Normally, the file system is expected to span a single administrative domain.
8 1.1 mycroft An administrative domain, for these purposes, is a machine or set of
9 1.1 mycroft machines that share common password file information, usually through
10 1.1 mycroft the yellow pages mechanism. File hierarchies that span more
11 1.1 mycroft than one domain leads to certain problems, since the same numerical
12 1.1 mycroft UID in one domain may correspond to a different user in another domain.
13 1.1 mycroft If the system administrator is very careful to ensure that both domains
14 1.1 mycroft contain identical user ID information, The umap layer can be used to
15 1.1 mycroft run between those domains without changes
16 1.1 mycroft
17 1.1 mycroft The umap layer is a file system layer that sits on top of the normal
18 1.1 mycroft file layer. The umap layer maps Unix-style UIDs from
19 1.1 mycroft one domain into the UIDs in the other domain. By setting up the mappings
20 1.1 mycroft properly, the same user with different UIDs in two domains can be seen
21 1.1 mycroft as the same user, from the system point of view, or, conversely, two
22 1.1 mycroft different users with the same UID in the two domains can be distinguished.
23 1.1 mycroft
24 1.1 mycroft First, we define some terms. ``User'' refers to the human (or daemon) that
25 1.1 mycroft has privileges to login, run programs, and access files. ``UID''refers to
26 1.1 mycroft the numerical identifier that uniquely identifies the user within a
27 1.1 mycroft single domain. ``Login name'' refers to the character string the user
28 1.1 mycroft types to log into the system. ``GID'' refers to the numerical group
29 1.1 mycroft identifier used by Unix systems to identify groups of users. ``Group
30 1.1 mycroft name'' is the character string name attached to a particular GID in the
31 1.1 mycroft local {\sf /etc/groups} file or the yellow pages groups file.
32 1.1 mycroft
33 1.1 mycroft In order for the umap layer to work properly, all users
34 1.1 mycroft in either domain must have password file entries in both domains.
35 1.1 mycroft They do not, however, have to have the same numerical UID, nor even the
36 1.1 mycroft same character string login name (the latter is highly recommended,
37 1.1 mycroft if possible, however). Any user not having a UID in one domain will be
38 1.1 mycroft treated as the special user NOBODY by the other domain, probably with
39 1.1 mycroft undesirable consequences. Any user not owning any files in the shared
40 1.1 mycroft sub-trees need not be given a UID in the other domain.
41 1.1 mycroft
42 1.1 mycroft Groups work similarly. The umap layer can translate group ID's between
43 1.1 mycroft domains in the same manner as UID's. Again, any group that wishes to
44 1.1 mycroft participate must have a group ID in both domains,
45 1.1 mycroft though it need not be the same GID in both. If a group in one domain is not
46 1.1 mycroft known in the other domain, that group will be treated as being NULLGROUP.
47 1.1 mycroft The umap layer has no provisions for enrolling UID's from other domains
48 1.1 mycroft as group members, but, since each user from each domain must have some
49 1.1 mycroft UID in every domain, the UID in the local domain can be used to enroll
50 1.1 mycroft the user in the local groups.
51 1.1 mycroft
52 1.1 mycroft NOBODY and NULLGROUP are special reserved UID's and GID's, respectively.
53 1.1 mycroft NOBODY is user 32767. NULLGROUP is group 65534. If the system administrator
54 1.1 mycroft wants to have an appropriate text string appear when these UID's are
55 1.1 mycroft encountered by programs like {\sf ls -l}, he should add these values to
56 1.1 mycroft the password and {\sf /etc/groups} file, or to the appropriate yellow pages.
57 1.1 mycroft If these IDs are already in use in that domain, different values can be
58 1.1 mycroft used for NOBODY and NULLGROUP, but that will require a recompilation of
59 1.1 mycroft the umap layer code and, as a result, the entire kernel. These
60 1.1 mycroft values are defined in the {\sf umap\_info.h} file, kept with the rest of the
61 1.1 mycroft umap source code.
62 1.1 mycroft
63 1.1 mycroft When the umap layer is in use, one of the participating domains is declared
64 1.1 mycroft to be the master. All UID and GID information stored for participating files
65 1.1 mycroft will be stored in vnodes using its mappings, no matter what site the copies of
66 1.1 mycroft the files are stored at. The master domain therefore need not run a copy
67 1.1 mycroft of the umap layer, as it already has all of the correct mappings. All
68 1.1 mycroft other domains must run a umap layer on top of any other layers they use.
69 1.1 mycroft
70 1.1 mycroft \subsection{Setting Up a umap Layer}
71 1.1 mycroft
72 1.1 mycroft The system administrator of a system needing to use the umap layer
73 1.1 mycroft must take several actions.
74 1.1 mycroft First, he must create files containing the necessary UID
75 1.1 mycroft and GID mappings. There is a separate file for user and group IDs. The
76 1.1 mycroft format of the files is the same. The first line contains the total number
77 1.1 mycroft of entries in the file. Each subsequent line contains one mapping. A
78 1.1 mycroft mapping line consists of two numerical UIDs, separated by white space.
79 1.1 mycroft The first is the UID of a user on the local machine. The second is the
80 1.1 mycroft UID for the same user on the master machine. The maximum number of users
81 1.1 mycroft that can be mapped for a single shared sub-tree is 64. The maximum number of
82 1.1 mycroft groups that can be mapped for a single sub-tree is 16. These constants
83 1.1 mycroft are set in the {\sf umap\_info.h} file, and can be changed, but changing them
84 1.1 mycroft requires recompilation. Separate mapping files can be used for each shared
85 1.1 mycroft subtree, or the same mapping files can be shared by several sub-trees.
86 1.1 mycroft
87 1.1 mycroft Below is a sample UID mapping file. There are four entries. UID 5 is mapped
88 1.1 mycroft to 5, 521 to 521, and 7000 to 7000. UID 2002 is mapped to 604. On this
89 1.1 mycroft machine, the UID's for users 5, 521, and 7000 are the same as on the master,
90 1.1 mycroft but UID 2002 is for a user whose UID on the master machine is 604. All
91 1.1 mycroft files in the sub-tree belonging to that user have UID 604 in their inodes,
92 1.1 mycroft even on this machine, but the umap layer will ensure that anyone running
93 1.1 mycroft under UID 2002 will have all files in this sub-tree owned by 604 treated as if
94 1.1 mycroft they were owned by 2002. An {\sf ls -l} on a file owned by 604 in this sub-tree
95 1.1 mycroft will show the login name associated with UID 2002 as the owner.
96 1.1 mycroft
97 1.1 mycroft \noindent4\newline
98 1.1 mycroft 5 5\newline
99 1.1 mycroft 521 521\newline
100 1.1 mycroft 2002 604\newline
101 1.1 mycroft 7000 7000\newline
102 1.1 mycroft
103 1.1 mycroft The user and group mapping files should be owned by the root user, and
104 1.1 mycroft should be writable only by that user. If they are not owned by root, or
105 1.1 mycroft are writable by some other user, the umap mounting command will abort.
106 1.1 mycroft
107 1.1 mycroft Normally, the sub-treeis grafted directly into the place in
108 1.1 mycroft the file hierarchy where the it should appear to users.Using the umap
109 1.1 mycroft layer requires that the sub-tree be grafted somewhere else, and
110 1.1 mycroft the umap layer be mounted in the desired position in the file hierarchy.
111 1.1 mycroft Depending on the situation, the underlying sub-tree can be wherever is
112 1.1 mycroft convenient.
113 1.1 mycroft
114 1.1 mycroft \subsection{Troubleshooting umap Layer Problems}
115 1.1 mycroft
116 1.1 mycroft The umap layer code was not built with special convenience or
117 1.1 mycroft robustness in mind, as it is expected to be superseded with a better
118 1.1 mycroft user ID mapping strategy in the near future. As a result, it is not
119 1.1 mycroft very forgiving of errors in being set up. Here are some possible
120 1.1 mycroft problems, and what to do about them.
121 1.1 mycroft
122 1.1 mycroft \begin{itemize}
123 1.1 mycroft
124 1.1 mycroft
125 1.1 mycroft \item{Problem: A file belongs to NOBODY, or group NULLGROUP.
126 1.1 mycroft
127 1.1 mycroft Fixes: The mapping files don't know about this file's real user or group.
128 1.1 mycroft Either they are not in the mapping files, or the counts on the number of
129 1.1 mycroft entries in the mapping files are too low, so entries at the end (including
130 1.1 mycroft these) are being ignored. Add the entries or fix the counts, and either
131 1.1 mycroft unmount and remount the sub-tree, or reboot.}
132 1.1 mycroft
133 1.1 mycroft \item{Problem: A normal operation does not work.
134 1.1 mycroft
135 1.1 mycroft Fixes: Possibly, some mapping has not been set properly. Check to
136 1.1 mycroft see which files are used by the operation and who they appear to be
137 1.1 mycroft owned by. If they are owned by NOBODY or some other suspicious user,
138 1.1 mycroft there may be a problem in the mapping files. Be sure to check groups,
139 1.1 mycroft too. As above, if the counts of mappings in the mapping files are lower
140 1.1 mycroft than the actual numbers of pairs, pairs at the end of the file will be
141 1.1 mycroft ignored. If any changes are made in the mapping files, you will need to
142 1.1 mycroft either unmount and remount or reboot before they will take effect.
143 1.1 mycroft
144 1.1 mycroft Another possible problem can arise because not all Unix utilities
145 1.1 mycroft rely exclusively on numeric UID for identification. For instance,
146 1.1 mycroft SCCS saves the login name in files. If a user's login name on two machines
147 1.1 mycroft isn't the same, SCCS may veto an operation even though Unix file permissions,
148 1.1 mycroft as checked by the umap layer, may say it's OK. There's not much to be
149 1.1 mycroft done in such cases, unless the login name can be changed or one fiddles
150 1.1 mycroft improperly with SCCS information. There may be other, undiscovered cases
151 1.1 mycroft where similar problems arise, some of which may be even harder to handle.}
152 1.1 mycroft
153 1.1 mycroft \item{Problem: Someone has access permissions he should not have.
154 1.1 mycroft
155 1.1 mycroft Fixes: This is probably caused by a mistake in the mapping files. Check
156 1.1 mycroft both user and group mapping files. If any changes are made in the mapping
157 1.1 mycroft files, you will need to unmount and remount the sub-tree or reboot before they
158 1.1 mycroft will take effect.}
159 1.1 mycroft
160 1.1 mycroft \item{Problem: {\sf ls -l} (or a similar program) shows the wrong user for a file.
161 1.1 mycroft
162 1.1 mycroft Fixes: Probably a mistake in the mapping files. In particular, if
163 1.1 mycroft two local UIDs are mapped to a single master UID, stat calls will assign
164 1.1 mycroft ownership to the first local UID occurring in the file, which may or may
165 1.1 mycroft not be what was intended. (Generally speaking, mapping two local UIDs to
166 1.1 mycroft a single master UID is a bad idea, but the software will not prevent it.
167 1.1 mycroft Similarly, mapping a single local UID to two master UIDs is a bad idea,
168 1.1 mycroft but will not be prevented. In this case, only the first mapping of the
169 1.1 mycroft local UID will be done. The second, and all subsequent ones, will be
170 1.1 mycroft ignored.) If any changes are made in the mapping files, you will need to
171 1.1 mycroft unmount and remount the sub-tree or reboot before they will take effect.}
172 1.1 mycroft
173 1.1 mycroft \end{itemize}
174 1.1 mycroft
175 1.1 mycroft \end{document}
176