.\"
.\" ypmake.conf(5)
.\"	Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
.\"
.TH ypmake.conf 5 "16 July 1996"
.\"------------------------------------------------------------------
.SH NAME
ypmake.conf \- configuration file for ypmake
.\"------------------------------------------------------------------
.SH SYNOPSIS
.B @(YPMAPDIR)/ypmake.conf
.\"------------------------------------------------------------------
.SH DESCRIPTION
The
.B ypmake.conf
file can be used to tailor the NIS map generation process on a per-domain
basis. In this file, you can specify alternative source files, special
file protection modes for individual maps, and instruct
.I ypmake
how to generate additional maps.
.P
The file is organized in several sections, one for each domain. The
start of a section is signalled by the
.B domain
keyword, followed by the name of the NIS domain name.
.P
The hash character (#) starts a comment that extends until the end of
the line. Currently, commands cannot be continued across newlines.
.\"------------------------------------------------------------------
.SH OPTIONS
This paragraph details the commands recognized by
.IR ypmake .
In this description,
.I map_spec
denotes a generic map name, whereas
.I map_file
denotes the file name of the map proper, as installed in @(YPMAPDIR)
after having been built successfully. For builtin maps such as
.BR passwd.byname ,
the
.I map_spec
is always derived by replacing the dot by an underscore. This subtle
distinction was added to support the use of short filenames.
.P
A
.I map_alias
denotes a generic name such as
.BR passwd ,
referring to all maps derived directly from
.BR /etc/passwd .
The special alias
.B default
denotes the default set of maps to be rebuilt when
.I ypmake
is invoked without arguments.
.TP
.BI domain " domainname
Signals the start of a new section. All subsequent statements will
apply exclusively to the specified NIS domain. The section is terminated
either by another
.B domain
statement, or the end of file.
.TP
.BI alias " map_alias map_spec:map_spec:...
Instructs
.I ypmake
to treat
.I map_alias
as an alias for the list of maps or aliases listed. If the alias already
exists, the specified maps will be appended to the alias, rather than
replacing it.
.TP
.BI source " map_spec filename " [ command ]
Instructs 
.I ypmake
to generate the specified map from 
.I filename
rather than from the system-wide configuration file located in
.IR /etc .
.TP
.BI mode " map_spec fileprot
By default,
.I ypmake
creates all map files with a protection of 0444. This can be overridden
with the
.B mode
command.
.TP
.BI privport " map_spec
Causes
.I ypmake
to add the
.B YP_SECURE
entry to the specified NIS map. This instructs
.I ypserv 
to reject all map queries that do not originate from a privileged port.
This is supposed to add some kind of marginal protection when distributing
your shadow password over NIS.
.IP
Note that the current Linux
.I ypserv 
uses a different protection scheme based on a configuration file.
.TP
.BI secure " map_spec
Causes
.I ypmake
to add the
.B YP_AUTHDES
entry to the specified NIS map. This tells
.I ypserv
to reject all map queries that do not use secure RPC.
.IP
Note that this feature has not been added to
.IR ypserv " yet.
It's not a very useful feature, anyway, because a NIS domain should either
perform all its NIS business over secure RPC, or you can dump it altogether.
.TP
.BR push " [" yes | no ]
If set to
.BR yes ", " ypmake
will try to push newly built maps to all slave servers using
.BR yppush .
Otherwise, maps will not be propagated to slave servers.
.P
The following set of options deal with the addition of new maps to
.IR ypmake :
.TP
.BI map " map_spec map_file
Tells
.I ypmake
to install the target
.I map_spec
as a handle for the given map file.
.TP
.BI module " map_spec script
Tells
.I ypmake
where to find the map builder for the specified map. This can be anywhere
in
.IR perl 's
default include path, or in
.BR @(YPMODDIR) .
The file has to contain a
.I perl
function that derives the map information and prints out key-value pairs
to the file
.BR OUT ,
separated by a tab. All generic processing (such as creation and locking
of the map file itself) is handled transparently by
.IR ypmake .
.SH EXAMPLES
To add new maps to the default map set that is rebuilt whenever you
invoke
.I ypmake
without arguments, put something like this into your
.IR ypmake.conf :
.IP
.nf
alias   default          netgroup:revnetgroup
.fi
.P
This adds the
.IR netgroup.byuser ", " netgroup.byhost ", and " netgroup
maps to the list of default targets.
.P
.ne 12
As another example of a
.I ypmake.conf
file, consider the following:
.IP
.nf
# Alias for maps relevant to secure rpc
alias   secure          publickey:netid
# get the following maps from alternative sources
source  passwd          /etc/master/passwd
source  group           /etc/master/group
source  hosts           /etc/master/hosts
source  netgroup        /etc/master/netgroup
source  publickey       /etc/master/publickey
.fi
.P
This defines the alias
.B secure
as a shorthand for the
.BR publickey.byname " and " netid.byname
maps, and installs alternative source files for a number of maps.
.P
The following example demonstrates how to protect the shadow NIS maps
from unauthorized access (at least as long as no packet spoofing is
involved):
.IP
.nf
privport shadow        # require root privs
privport gshadow       # require root privs
.fi
.P
Finally, here's an example how to implement a new pair of maps called
.BR foo.byname " and " foo.bynumber :
.IP
.nf
map      foo_byname    foo.byname
map      foo_bynumber  foo.bynumber
alias    foo           foo_byname:foo_bynumber
source   foo           /etc/master/foo
module   foo           @(YPMODDIR)/foo
.fi
.P
First, this defines the handles
.BR foo_byname " and " foo_bynumber
for the two maps, and installs an alias called
.B foo
for the pair. The
.B source
command tells 
.I ypmake
where to look for the source file when deciding whether to rebuild the
map or not. If it decides that the maps have to be rebuilt, it includes
the 
.I perl
module
.B @(YPMODDIR)/foo
and invokes the 
.BR foo_byname " and/or " foo_bynumber 
functions that should be defined in this file. The
.B @(YPMODDIR)
contains the implementations of the generic maps supported by
.IR ypmake ,
which could serve as an example on how to implement customized maps.
.SH FILES
.TP
.BI @(YPMAPDIR)/ domain /ypmake.conf
Location of the configuration file for
.IR domain .
.TP
.B @(YPBINDIR)/ypmake
Location of the
.I ypmake
script.
.TP
.B @(YPMODDIR)
Location of the perl include files that generate the individual maps.
.SH AUTHOR
Olaf Kirch, <okir@monad.swb.de>
