The
yp_mkdb
utility creates
db(3)
style databases for use with
FreeBSD Ns 's
NIS server.
The
yp_mkdb
utility reads data from
inputfile,
and writes it to
dbname
in
db(3)
format (using the hash table method).
The input should be in 'key data' format, which is to say
two fields of
ASCII
data separated by white space.
The first field
is assumed to be the key, and everything else is assumed to be
the data.
These databases are typically stored in
/var/yp/[domainname]
where
domainname
is the name of the NIS domain being served.
The
yp_mkdb
utility is usually invoked by
/var/yp/Makefile.
The
yp_mkdb
utility can also be used to dump an NIS database file so that its
contents can be examined.
For security reasons, all databases that
yp_mkdb
creates are readable and writable by owner only (and usually the
owner is root).
The following options are available:
-c
|
|
Cause
yp_mkdb
to send a YPPROC_CLEAR request to
ypserv(8)
on the local host.
This signal tells the server to close any open
database descriptors and flush out its database cache.
If used alone,
this flag signals the server and does nothing else.
If used as part
of a database creation command,
yp_mkdb
will send the signal only after the new database has been successfully
created.
|
-b
|
|
Cause
yp_mkdb
to add a special entry to the database with a key of
YP_INTERDOMAIN
and an empty data field.
If this key is present in a map, it alters the
behavior of the 'match' procedure in
ypserv(8)
slightly.
If a match query fails (because the server could not find
a record that matched the supplied key), and the
YP_INTERDOMAIN
key exists within the queried map,
ypserv(8)
will try to match the entry again using a DNS lookup.
Note that this
special behavior only applies to the
hosts
maps.
Using the
-b
flag for other maps has no effect.
|
-s
|
|
This flag is used to add a special entry to the database with a key of
YP_SECURE
and an empty data field.
If this key is present in a map,
ypserv(8)
will deny access to the map to any client that is not using a
reserved port for its query.
This is used mainly for the
master.passwd
maps, which should be restricted to privileged access only.
|
-f
|
|
This flag is used to turn on filtering of lines in the source file
input that start with ``+'' or ``-'' characters.
These characters
have special meaning for the
group,
passwd
and
master.passwd
maps and hence should not be allowed to appear in them as the first
character of a key or datum.
If the
-f
flag is used,
yp_mkdb
will reject any source line that starts with a ``+'' or ``-''
character and issue a warning message displaying the line that
was dropped.
|
-u dbname
|
|
Dump (or 'unwind') an NIS database.
This option can be used to
inspect the contents of an existing NIS database.
|
-i inputfile
|
|
When generating an NIS map, encode
inputfile
as a special entry in the database with a key of
YP_INPUT_FILE.
|
-o outputfile
|
|
When generating an NIS map, encode
outputfile
as a special entry in the database with a key of
YP_OUTPUT_FILE.
|
-d domainname
|
|
When generating an NIS map, encode
domainname
as a special entry in the database with a key of
YP_DOMAIN_NAME.
|
-m mastername
|
|
When generating an NIS map, encode
mastername
as a special entry in the database with a key of
YP_MASTER_NAME.
This entry in the database is frequently used by various NIS utilities
to determine the name of an NIS master server for a domain.
By default,
yp_mkdb
assumes that the local host is the NIS master; the
-m
option is used to override this default.
|