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