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