xref: /freebsd/usr.sbin/yp_mkdb/yp_mkdb.8 (revision f2e366a1057c0492a8abdf936898879a630e633e)
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.\" $FreeBSD$
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 f
49.Op Fl i Ar inputfile
50.Op Fl o Ar outputfile
51.Op Fl d Ar domainname
52.Op Fl m Ar mastername
53.Ar inputfile
54.Ar dbname
55.Sh DESCRIPTION
56.Nm Yp_mkdb
57creates
58.Xr db 3
59style databases for use with FreeBSD's NIS server.
60.Nm Yp_mkdb
61reads data from
62.Ar inputfile ,
63and writes it to
64.Ar dbname
65in
66.Xr db 3
67format (using the hash table method).
68The input should be in 'key data' format, which is to say
69two fields of
70.Tn ASCII
71data separated by white space.
72The first field
73is assumed to be the key, and everything else is assumed to be
74the data.
75These databases are typically stored in
76.Pa /var/yp/[domainname]
77where
78.Ar domainname
79is the name of the NIS domain being served.
80.Nm Yp_mkdb
81is usually invoked by
82.Pa /var/yp/Makefile .
83.Nm Yp_mkdb
84can also be used to dump an NIS database file so that its
85contents can be examined.
86For security reasons, all databases that
87.Nm
88creates are readable and writable by owner only (and usually the
89owner is root).
90.Pp
91The following options are available:
92.Bl -tag -width indent
93.It Fl c
94Cause
95.Nm
96to send a YPPROC_CLEAR request to
97.Xr ypserv 8
98on the local host.
99This signal tells the server to close any open
100database descriptors and flush out its database cache.
101If used alone,
102this flag signals the server and does nothing else.
103If used as part
104of a database creation command,
105.Nm
106will send the signal only after the new database has been successfully
107created.
108.It Fl b
109Cause
110.Nm
111to add a special entry to the database with a key of
112.Em YP_INTERDOMAIN
113and an empty data field.
114If this key is present in a map, it alters the
115behavior of the 'match' procedure in
116.Xr ypserv 8
117slightly.
118If a match query fails (because the server couldn't find
119a record that matched the supplied key), and the
120.Em YP_INTERDOMAIN
121key exists within the queried map,
122.Xr ypserv 8
123will try to match the entry again using a DNS lookup.
124Note that this
125special behavior only applies to the
126.Em hosts
127maps.
128Using the
129.Fl b
130flag for other maps has no effect.
131.It Fl s
132This flag is used to add a special entry to the database with a key of
133.Em YP_SECURE
134and an empty data field.
135If this key is present in a map,
136.Xr ypserv 8
137will deny access to the map to any client that is not using a
138reserved port for its query.
139This is used mainly for the
140.Em master.passwd
141maps, which should be restricted to privileged access only.
142.It Fl f
143This flag is used to turn on filtering of lines in the source file
144input that start with ``+'' or ``-'' characters.
145These characters
146have special meaning for the
147.Pa group ,
148.Pa passwd
149and
150.Pa master.passwd
151maps and hence should not be allowed to appear in them as the first
152character of a key or datum.
153If the
154.Fl f
155flag is used,
156.Nm
157will reject any source line that starts with a ``+'' or ``-''
158character and issue a warning message displaying the line that
159was dropped.
160.It Fl u Ar dbname
161Dump (or 'unwind') an NIS database.
162This option can be used to
163inspect the contents of an existing NIS database.
164.It Fl i Ar inputfile
165When generating an NIS map, encode
166.Ar inputfile
167as a special entry in the database with a key of
168.Em YP_INPUT_FILE .
169.It Fl o Ar outputfile
170When generating an NIS map, encode
171.Ar outputfile
172as a special entry in the database with a key of
173.Em YP_OUTPUT_FILE .
174.It Fl d Ar domainname
175When generating an NIS map, encode
176.Ar domainname
177as a special entry in the database with a key of
178.Em YP_DOMAIN_NAME .
179.It Fl m Ar mastername
180When generating an NIS map, encode
181.Ar mastername
182as a special entry in the database with a key of
183.Em YP_MASTER_NAME .
184This entry in the database is frequently used by various NIS utilities
185to determine the name of an NIS master server for a domain.
186By default,
187.Nm
188assumes that the local host is the NIS master; the
189.Fl m
190option is used to override this default.
191.Sh FILES
192.Bl -tag -width /var/yp/Makefile -compact
193.It Pa /var/yp/Makefile
194the Makefile that calls
195.Nm
196to build the NIS databases
197.Sh SEE ALSO
198.Xr db 3 ,
199.Xr ypserv 8
200.Sh AUTHORS
201.An Bill Paul Aq wpaul@ctr.columbia.edu
202