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