1.\" Copyright (c) 1995, 1996 2.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by Bill Paul 15.\" 4. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" $Id: yp_mkdb.8,v 1.7 1997/10/27 12:29:24 charnier Exp $ 32.\" 33.Dd March 12, 1996 34.Dt YP_MKDB 8 35.Os 36.Sh NAME 37.Nm yp_mkdb 38.Nd "generate the NIS databases" 39.Sh SYNOPSIS 40.Nm yp_mkdb 41.Fl c 42.Nm yp_mkdb 43.Fl u Ar dbname 44.Nm yp_mkdb 45.Op Fl c 46.Op Fl b 47.Op Fl s 48.Op Fl i Ar inputfile 49.Op Fl o Ar outputfile 50.Op Fl d Ar domainname 51.Op Fl m Ar mastername 52.Ar inputfile 53.Ar dbname 54.Sh DESCRIPTION 55.Nm Yp_mkdb 56creates 57.Xr db 3 58style databases for use with FreeBSD's NIS server. 59.Nm Yp_mkdb 60reads data from 61.Ar inputfile , 62and writes it to 63.Ar dbname 64in 65.Xr db 3 66format (using the hash table method). 67The input should be in 'key data' format, which is to say 68two fields of 69.Tn ASCII 70data separated by white space. The first field 71is assumed to be the key, and everything else is assumed to be 72the data. 73These databases are typically stored in 74.Pa /var/yp/[domainname] 75where 76.Ar domainname 77is the name of the NIS domain being served. 78.Nm Yp_mkdb 79is usually invoked by 80.Pa /var/yp/Makefile . 81.Nm Yp_mkdb 82can also be used to dump an NIS database file so that its 83contents can be examined. For security reasons, all databases that 84.Nm 85creates are readable and writable by owner only (and usually the 86owner is root). 87.Sh OPTIONS 88The 89.Nm 90command supports the following flags and options: 91.Bl -tag -width indent 92.It Fl c 93Cause 94.Nm 95to send a YPPROC_CLEAR request to 96.Xr ypserv 8 97on the local host. This signal tells the server to close any open 98database descriptors and flush out its database cache. If used alone, 99this flag signals the server and does nothing else. If used as part 100of a database creation command, 101.Nm 102will send the signal only after the new database has been successfully 103created. 104.It Fl b 105This flag causes 106.Nm 107to add a special entry to the database with a key of 108.Em YP_INTERDOMAIN 109and an empty data field. If this key is present in a map, it alters the 110behavior of the 'match' procedure in 111.Xr ypserv 8 112slightly. If a match query fails (because the server couldn't find 113a record that matched the supplied key), and the 114.Em YP_INTERDOMAIN 115key exists within the queried map, 116.Xr ypserv 8 117will try to match the entry again using a DNS lookup. Note that this 118special behavior only applies to the 119.Em hosts 120maps. Using the 121.Fl b 122flag for other maps has no effect. 123.It Fl s 124This flag is used to add a special entry to the database with a key of 125.Em YP_SECURE 126and an empty data field. If this key is present in a map, 127.Xr ypserv 8 128will deny access to the map to any client that is not using a 129reserved port for its query. This is used mainly for the 130.Em master.passwd 131maps, which should be restricted to privileged access only. 132.It Fl u Ar dbname 133Dump (or 'unwind') an NIS database. This option can be used to 134inspect the contents of an existing NIS database. 135.It Fl i Ar inputfile 136When generating an NIS map, encode 137.Ar inputfile 138as a special entry in the database with a key of 139.Em YP_INPUT_FILE . 140.It Fl o Ar outputfile 141When generating an NIS map, encode 142.Ar outputfile 143as a special entry in the database with a key of 144.Em YP_OUTPUT_FILE . 145.It Fl d Ar domainname 146When generating an NIS map, encode 147.Ar domainname 148as a special entry in the database with a key of 149.Em YP_DOMAIN_NAME . 150.It Fl m Ar mastername 151When generating an NIS map, encode 152.Ar mastername 153as a special entry in the database with a key of 154.Em YP_MASTER_NAME . 155This entry in the database is frequently used by various NIS utilities 156to determine the name of an NIS master server for a domain. By default, 157.Nm 158assumes that the local host is the NIS master; the 159.Fl m 160option is used to override this default. 161.Sh FILES 162.Bl -tag -width /var/yp/Makefile -compact 163.It Pa /var/yp/Makefile 164the Makefile that calls 165.Nm 166to build the NIS databases 167.Sh SEE ALSO 168.Xr db 3 , 169.Xr ypserv 8 170.Sh AUTHORS 171.An Bill Paul Aq wpaul@ctr.columbia.edu 172