|
|
The file /var/yp/Makefile contains the commands needed to transform the input files into the desired dbm format.
The function of the Makefile is to create the appropriate maps for NIS to use (listed under the target ``all''). In most cases, ypbuild must first clean the input file of comments and other extraneous lines through some sed or awk script. The fields of the file must be ordered correctly for makedbm. This is very clear in the case of passwd. To create the map passwd.byname, the makedbm command must be passed the key/value pair of name/entry; while to create the map passwd.byuid, the pair must be uid/entry. This is accomplished by the awk script that in the first case passes to makedbm the first field of the passwd file and then the whole entry, and in the second case passes the third field followed, again, by the whole entry.