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