Home | History | Annotate | only in /src/usr.sbin/ypserv
History log of /src/usr.sbin/ypserv
RevisionDateAuthorComments
 1.6 09-Jan-2001  lukem convert to using .WAIT
 1.5 16-Oct-1997  lukem clean up previous
 1.4 16-Oct-1997  lukem fix race condition when building libcommon with make -j
 1.3 06-Oct-1997  lukem add mkalias & revnetgroup
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.8 28-May-2007  tls Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
 1.7 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.6 07-Jan-2001  enami Use PRINTOBJDIR.
 1.5 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.4 25-Oct-1997  lukem use CPPFLAGS instead of CFLAGS
 1.3 18-Oct-1997  lukem branches: 1.3.2;
enable WARNS=1 by default, but disable in unclean 3rd party code
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 08-Nov-1997  lukem sync with trunk (approved by thorpej)
 1.11 03-May-2008  lukem Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
 1.10 23-May-2004  lukem branches: 1.10.24;
Use MKPRIVATELIB=yes instead of providing an empty libinstall:: target and
setting NOLINT, NOPIC, NOPROFILE (etc)
 1.9 18-Sep-2002  lukem minor makefile delint
 1.8 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.7 13-Mar-1999  lukem set MKLINT=no. noted by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp>
 1.6 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 22-Jan-1999  thorpej Remove old access control list definitions, and remove the home-grown
logging code.
 1.4 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.3 11-Oct-1997  mycroft GC some garbage variables.
 1.2 11-Oct-1997  veego Don't install this libraries, we only this during the build.
 1.1 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.10.24.1 18-May-2008  yamt sync with head.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 06-Jul-2002  wiz branches: 1.8.30;
ANSIfy, remove __P().
 1.7 09-Dec-2000  thorpej Rewrite this to use getaddrinfo(), and to use the canonical name of the
host rather than the hostname as returned by gethostname() if the hostname
does not appear to be fully qualified.
 1.6 06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.5 23-Apr-1998  kleink Use <sys/param.h> instead of <sys/types.h>: <netdb.h> and MAXHOSTNAMELEN are
not related to each other, and it should not be assumed that inclusion of the
former makes visible the latter.
 1.4 13-Oct-1997  lukem - hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.3 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.8.30.1 18-May-2008  yamt sync with head.
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 06-Jul-2002  wiz branches: 1.5.30;
ANSIfy, remove __P().
 1.4 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.3 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.2 30-Jul-1997  jtc branches: 1.2.2;
Fix files using old TNF copyright notice
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukem)
 1.5.30.1 18-May-2008  yamt sync with head.
 1.4 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.3 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.2 13-Oct-1997  lukem branches: 1.2.2;
- hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukem)
 1.13 01-Aug-2023  mrg convert explicit length check before unchecked snprintf() with just a
overflow checked snprintf(). for res_debug.c and res_query.c, convert
from sprintf() to snprintf().

tested scp and rcp fail properly with too-long paths.
tested getaddrinfo fails as expected for too-long domains.
tested dig and ping for similar (res_debug.c/res_query.c).
created a temporary fs with quotas to test edquota with a long EDITOR.
did not test ypserv directly, but it's the same pattern.

avoids GCC 12 snprintf() warnings, and reduces total code size.
 1.12 10-Jan-2017  christos need <sys/stat.h>
 1.11 29-Feb-2008  lukem branches: 1.11.46;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.10 20-Jun-2005  lukem branches: 1.10.10; 1.10.16;
ypdb_open():
* Clarify what it does (adds YPDB_SUFFIX if it's missing).
* Add some explicit pathname length checks and display a warning if exceeded.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.8 06-Jul-2002  wiz ANSIfy, remove __P().
 1.7 26-Jul-1999  lukem remove superfluous casts
 1.6 25-Jul-1999  lukem because the ypserv struct datum and the db(3) struct DBT are not exactly
the same (datum is { char *, int }, DBT is { void *, size_t /* u_int */ }),
copy info to appropriate temporary variables before calling underlying
db(3) operations.
 1.5 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.4 13-Oct-1997  lukem branches: 1.4.2;
- hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.3 07-Oct-1997  lukem nuke register & unnecessary extern's, factor out common code
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.2.1 28-Nov-1997  mellon Pull rev 1.5 up from trunk (lukem)
 1.10.16.1 24-Mar-2008  keiichi sync with head.
 1.10.10.1 23-Mar-2008  matt sync with HEAD
 1.11.46.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5 29-Feb-2008  lukem Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.4 07-Aug-2003  agc branches: 1.4.22; 1.4.28;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.3 06-Jul-2002  wiz ANSIfy, remove __P().
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.28.1 24-Mar-2008  keiichi sync with head.
 1.4.22.1 23-Mar-2008  matt sync with HEAD
 1.5 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.4 06-Jul-2002  wiz ANSIfy, remove __P().
 1.3 06-Jun-1999  thorpej Use pidfile(3).
 1.2 22-Jan-1999  thorpej Remove old access control list definitions, and remove the home-grown
logging code.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.9 30-Aug-2011  plunky Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
 1.8 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.7 30-Oct-2004  dsl branches: 1.7.34;
Add (unsigned char) cast to ctype functions
 1.6 10-Dec-2003  agc Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
 1.5 06-Jul-2002  wiz ANSIfy, remove __P().
 1.4 31-Jan-1999  mrg KNF nit.
 1.3 13-Oct-1997  lukem - hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.7.34.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.4 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.3 10-Dec-2003  agc branches: 1.3.40;
Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
 1.2 06-Jul-2002  wiz ANSIfy, remove __P().
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.40.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 22-Jan-1999  thorpej Remove old access control list definitions, and remove the home-grown
logging code.
 1.5 24-Jun-1998  kleink Need <time.h> for time().
 1.4 13-Oct-1997  lukem - hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.3 07-Oct-1997  lukem nuke register & unnecessary extern's, factor out common code
 1.2 17-Apr-1997  christos PR/3504: Brian Baird:
- Do what the manual page says; don't create the log file if it does not exist.
- Limited support for ypserv v1; apparently sunos4 clients use it and sunos5
server provides the same.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2 22-Jan-1999  thorpej Remove old access control list definitions, and remove the home-grown
logging code.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4 12-Nov-2003  grant s/netbsd.org/NetBSD.org/i
 1.3 06-Jul-2002  wiz ANSIfy, remove __P().
 1.2 13-Oct-1997  lukem - hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
format is found to be more efficient, just add the code to open it
prior to that of the other formats; this maintains backward
compatibility with older databases whilst providing new functionality...
- add rcsid's
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.7 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.6 09-Feb-2020  fox usr.sbin/ypserv: Suppress -Werror=format-truncation= error.

Add GCC_NO_FORMAT_TRUNCATION makedbm.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
 1.5 02-Oct-1997  lukem branches: 1.5.110;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.110.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 07-Oct-1997  lukem grabage collect this
 1.2 07-Oct-1997  lukem use err instead of errx, so the user has some idea why the file wasn't opened
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.16 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.15 20-Jul-2013  wiz Use Mt for email addresses.
 1.14 08-Apr-2012  wiz branches: 1.14.2; 1.14.4;
Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.13 20-Oct-2009  snj branches: 1.13.6;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.12 26-Feb-2005  wiz Bump date for previous.
 1.11 26-Feb-2005  thorpej YP -> NIS
 1.10 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.9 02-Feb-2002  wiz Sort SEE ALSO, use standard headers and markup in AUTHORS section.
 1.8 19-Jan-2002  wiz Whitespace nits.
 1.7 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.6 28-Apr-1998  fair Fix man to mdoc conversion mistakes, mostly of the form ^\.[A-Z][A-Z]
 1.5 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.4 13-Oct-1997  lukem branches: 1.4.2;
- ignore trailing NUL in database key/value pairs (which sendmail's
aliases.db has)
- add rcsid
 1.3 07-Oct-1997  lukem cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.2.1 28-Nov-1997  mellon Oull rev 1.5 up from trunk (lukem)
 1.13.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.6.1 17-Apr-2012  yamt sync with head
 1.14.4.1 23-Jul-2013  riastradh sync with HEAD
 1.14.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25 30-Aug-2011  joerg static + __dead
 1.24 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.23 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.22 29-Feb-2008  lukem branches: 1.22.10;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.21 20-Jun-2005  lukem branches: 1.21.10; 1.21.16;
tweak filename length check
 1.20 30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.19 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.18 06-Jul-2002  wiz ANSIfy, remove __P().
 1.17 19-Feb-2001  cgd convert to use getprogname()
 1.16 25-Jul-1999  lukem fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
 1.15 07-Jun-1999  mrg note that the calls to mktemp() are OK.
 1.14 24-Jun-1998  kleink Need <time.h> for time().
 1.13 10-Jun-1998  kleink Fix an LP64 botch introduced in last commit; reported by Tim Rightnour.
 1.12 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.11 01-Jun-1998  kleink Need <stdlib.h> for mktemp() prototype.
 1.10 13-Nov-1997  thorpej Fix int vs. size_t lossage.
 1.9 04-Nov-1997  lukem add { } in the right place; indentation alone isn't sufficient for
if (test1)
if (test2)
error()
else {
...
}
this happened when i changed test2 from a void statement to actually
checking its return value.

the effect of this? a YP_MASTER_KEY value wasn't being added to the
generated databases, which was Not Good.
 1.8 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.7 18-Oct-1997  lukem branches: 1.7.2;
use string.h instead of strings.h
 1.6 13-Oct-1997  lukem - ignore trailing NUL in database key/value pairs (which sendmail's
aliases.db has)
- add rcsid
 1.5 07-Oct-1997  lukem use err instead of errx, so the user has some idea why the file wasn't opened
 1.4 08-Sep-1997  mikel add missing newline in usage(); from Hubert Feyrer in PR bin/4064
 1.3 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.2 22-Mar-1997  lukem use O_EXCL with O_CREAT when making the temporary db files
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.7.2.1 28-Nov-1997  mellon Pull rev 1.8, 1.9 and 1.10 up from trunk (lukem)
 1.21.16.1 24-Mar-2008  keiichi sync with head.
 1.21.10.1 23-Mar-2008  matt sync with HEAD
 1.22.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2 06-Oct-1997  lukem - KNFify
- cleanup for WARNS
- cleanup man page
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem mkalias - generate YP version of sendmail aliases
 1.13 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.12 20-Jul-2013  wiz Use Mt for email addresses.
 1.11 20-Oct-2009  snj branches: 1.11.6; 1.11.12; 1.11.16;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.10 26-Feb-2005  thorpej YP -> NIS
 1.9 07-Apr-2003  wiz Some e.g. cleanup: replace "eg" with "e.g.,". From Igor Sobrado in PR 19692.
 1.8 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section.
 1.7 19-Jan-2002  wiz Whitespace nits.
 1.6 08-Oct-1999  msaitoh s/ a a / a /
 1.5 05-Jul-1999  agc branches: 1.5.2;
Correct typo in synopsis.
 1.4 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.3 07-Oct-1997  lukem cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 06-Oct-1997  lukem - KNFify
- cleanup for WARNS
- cleanup man page
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem mkalias - generate YP version of sendmail aliases
 1.5.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.16.1 23-Jul-2013  riastradh sync with HEAD
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18 30-Aug-2011  joerg static + __dead
 1.17 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.16 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.15 29-Feb-2008  lukem branches: 1.15.10;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.14 11-May-2006  mrg branches: 1.14.10; 1.14.16;
res_search() takes u_char * as 4th argument - pass one.
 1.13 20-Jun-2005  lukem tweak filename length check
 1.12 30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.11 14-Jul-2003  itojun use bounded string ops (one strcpy remaining)
 1.10 06-Jul-2002  wiz ANSIfy, remove __P().
 1.9 19-Feb-2001  cgd convert to use getprogname()
 1.8 07-Jun-1999  mrg note that the calls to mktemp() are OK.
 1.7 24-Jun-1998  kleink Need <time.h> for time().
 1.6 01-Jun-1998  kleink Need <stdlib.h> for mktemp() prototype.
 1.5 04-Nov-1997  lukem use in-house localhostname instead of gethostname - returns FQDN
 1.4 13-Oct-1997  lukem branches: 1.4.2;
s/LINT/lint
 1.3 07-Oct-1997  lukem use err instead of errx, so the user has some idea why the file wasn't opened
 1.2 06-Oct-1997  lukem - KNFify
- cleanup for WARNS
- cleanup man page
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem mkalias - generate YP version of sendmail aliases
 1.4.2.1 28-Nov-1997  mellon Pull rev 1.5 up from trunk (lukem)
 1.14.16.1 24-Mar-2008  keiichi sync with head.
 1.14.10.1 23-Mar-2008  matt sync with HEAD
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.5 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.14 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.13 20-Jul-2013  wiz Use Mt for email addresses.
 1.12 08-Apr-2012  wiz branches: 1.12.2; 1.12.4;
Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.11 20-Oct-2009  snj branches: 1.11.6;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.10 26-Feb-2005  wiz Sort SEE ALSO, bump date for previous.
 1.9 26-Feb-2005  thorpej YP -> NIS
 1.8 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.7 02-Feb-2002  wiz Sort sections, use standard headers and markup in AUTHORS section.
 1.6 19-Jan-2002  wiz Whitespace nits.
 1.5 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.4 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.3 07-Oct-1997  lukem branches: 1.3.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 up fromt runk (lukme)
 1.11.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.6.1 17-Apr-2012  yamt sync with head
 1.12.4.1 23-Jul-2013  riastradh sync with HEAD
 1.12.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19 19-Oct-2013  christos fix unused variable warnings.
 1.18 30-Aug-2011  joerg branches: 1.18.2; 1.18.8;
static + __dead
 1.17 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.16 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.15 30-Oct-2004  dsl branches: 1.15.34;
Add (unsigned char) cast to ctype functions
 1.14 12-Nov-2003  grant s/netbsd.org/NetBSD.org/i
 1.13 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.12 06-Jul-2002  wiz ANSIfy, remove __P().
 1.11 19-Feb-2001  cgd convert to use getprogname()
 1.10 25-Jul-1999  lukem fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
 1.9 11-Jun-1998  kleink Fix LP64 botches introduced in last commit.
 1.8 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.7 13-Nov-1997  thorpej Fix int vs. size_t lossage.
 1.6 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.5 13-Oct-1997  lukem branches: 1.5.2;
add rcsid
 1.4 08-Oct-1997  lukem fix cutnpasto
 1.3 07-Oct-1997  lukem simplify test for skippable lines
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.2.1 28-Nov-1997  mellon Pull rev 1.6 and 1.7 up from trunk (lmuke)
 1.15.34.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.18.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.11 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.10 20-Jul-2013  wiz Use Mt for email addresses.
 1.9 20-Oct-2009  snj branches: 1.9.6; 1.9.12; 1.9.16;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.8 26-Feb-2005  thorpej YP -> NIS
 1.7 12-Jun-2002  wiz Do not xref to ourselves, use Nm.
 1.6 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.5 02-Feb-2002  wiz Sort sections, use standard headers and markup in AUTHORS section.
 1.4 19-Jan-2002  wiz Whitespace nits.
 1.3 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.2 02-Oct-1997  lukem branches: 1.2.2;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukes)
 1.9.16.1 23-Jul-2013  riastradh sync with HEAD
 1.9.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 06-Oct-1997  lukem KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.5 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.4 18-Mar-2006  bouyer branches: 1.4.28;
Fix memory leak if we're adding an existing group name.
Coverity ID 1568.
 1.3 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.2 06-Oct-1997  lukem KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.4.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.2 06-Oct-1997  lukem KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.5 14-Jul-2003  itojun use bounded string ops (one strcpy remaining)
 1.4 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.3 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.2 06-Oct-1997  lukem KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.14 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.13 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.12 20-Jul-2013  wiz Use Mt for email addresses.
 1.11 08-Apr-2012  wiz branches: 1.11.2; 1.11.4;
Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.10 26-Feb-2005  wiz branches: 1.10.48;
Bump date for previous.
 1.9 26-Feb-2005  thorpej YP -> NIS
 1.8 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.7 11-Feb-2002  wiz s/seperate/separate/
 1.6 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.5 02-Feb-2002  wiz Drop a .Pp, use standard headers, mark up AUTHORS sections.
 1.4 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.3 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.2 06-Oct-1997  lukem branches: 1.2.2;
KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (mekul)
 1.10.48.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.48.1 17-Apr-2012  yamt sync with head
 1.11.4.1 23-Jul-2013  riastradh sync with HEAD
 1.11.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15 30-Aug-2011  joerg static + __dead
 1.14 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.13 30-Oct-2004  dsl branches: 1.13.34;
Add (unsigned char) cast to ctype functions
 1.12 21-Oct-2003  fvdl Don't compare an int to NULL.
Some whitespace nits.
 1.11 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.10 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.9 19-Feb-2001  cgd convert to use getprogname()
 1.8 07-Jul-2000  itojun errx?/warnx? audit. do not pass variable alone, use %s. idea from openbsd
 1.7 25-Jul-1999  lukem branches: 1.7.8;
fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
 1.6 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.5 03-Feb-1998  perry change includes to fix compiler warning
 1.4 13-Nov-1997  thorpej Fix int vs. size_t lossage.
 1.3 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.2 06-Oct-1997  lukem branches: 1.2.2;
KNF & WARNSify
 1.1 06-Oct-1997  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 06-Oct-1997  lukem revnetgroup - generate extra netgroup maps for YP
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 and 1.4 up from trunk (lukem)
 1.7.8.1 27-Jul-2000  itojun pullup (approved by releng-1-5)
printf-like format pedant. do not pass string variable alone. use "%s".
from openbsd.

/cvsroot/basesrc/usr.sbin/netgroup_mkdb/netgroup_mkdb.c 1.9 -> 1.10
/cvsroot/basesrc/usr.sbin/pwd_mkdb/pwd_mkdb.c 1.17 -> 1.18
/cvsroot/basesrc/usr.sbin/quotaon/quotaon.c 1.14 -> 1.15
/cvsroot/basesrc/usr.sbin/rdate/rdate.c 1.10 -> 1.11
/cvsroot/basesrc/usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c 1.5 -> 1.6
/cvsroot/basesrc/usr.sbin/traceroute6/traceroute6.c 1.12 -> 1.13
/cvsroot/basesrc/usr.sbin/wsconscfg/wsconscfg.c 1.6 -> 1.7
/cvsroot/basesrc/usr.sbin/ypserv/revnetgroup/revnetgroup.c 1.7 -> 1.8
/cvsroot/basesrc/usr.sbin/ypserv/ypserv/ypserv.c 1.10 -> 1.11
 1.13.34.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 13-Oct-1997  lukem don't use home-grown ether_ntoa() - ether_toa(3) in libc works fine...
 1.5 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.12 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.11 20-Jul-2013  wiz Use Mt for email addresses.
 1.10 20-Oct-2009  snj branches: 1.10.6; 1.10.12; 1.10.16;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.9 26-Feb-2005  thorpej YP -> NIS
 1.8 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.7 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section.
 1.6 19-Jan-2002  wiz Whitespace nits.
 1.5 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.4 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.3 07-Oct-1997  lukem branches: 1.3.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 up from trunk (lukem)
 1.10.16.1 23-Jul-2013  riastradh sync with HEAD
 1.10.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19 30-Aug-2011  joerg static + __dead
 1.18 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.17 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.16 10-Mar-2007  hubertf branches: 1.16.20;
- Remove unused ctype.h
- use EXIT_{SUCCESS,FAILURE} constants instead of 0/1
From: Slava Semushin <php-coder@altlinux.ru>
 1.15 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.14 06-Jul-2002  wiz de__P(), ANSIfy.
 1.13 19-Feb-2001  cgd convert to use getprogname()
 1.12 17-Jan-1999  lukem don't bother looking for comments; fparseln() removes them
 1.11 11-Jun-1998  kleink Fix LP64 botches introduced in last commit.
 1.10 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.9 13-Nov-1997  thorpej Fix int vs. size_t lossage.
 1.8 02-Nov-1997  lukem ensure sizeof hostname buf for ether_(ntohost|line) is >= MAXHOSTNAMELEN + 1
 1.7 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.6 13-Oct-1997  lukem branches: 1.6.2;
don't use home-grown ether_ntoa() - ether_toa(3) in libc works fine...
 1.5 13-Oct-1997  lukem add rcsid
 1.4 07-Oct-1997  lukem simplify test for skippable lines
 1.3 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.2 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej branches: 1.1.1.1.2;
A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.1.1.1.2.1 09-Mar-1997  is Convert to new ARP code.
 1.6.2.1 28-Nov-1997  mellon Pull rev 1.7, 1.9 and 1.8 up from trunk (lukem)
 1.16.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.5 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.13 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.12 20-Jul-2013  wiz Use Mt for email addresses.
 1.11 20-Oct-2009  snj branches: 1.11.6; 1.11.12; 1.11.16;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.10 26-Feb-2005  thorpej YP -> NIS
 1.9 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.8 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section.
 1.7 19-Jan-2002  wiz Whitespace nits.
 1.6 30-Jul-2000  itojun with -n, permit non-IPv4 address in the output.
option name synchronized with solaris 8.
 1.5 07-Mar-1999  mycroft branches: 1.5.10;
Clean up SYNOPSIS formatting.
 1.4 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.3 07-Oct-1997  lukem branches: 1.3.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 up from trunk (lunem)
 1.5.10.1 19-Sep-2000  itojun pullup (approved by releng-1-5)
>with -n, permit non-IPv4 address in the output.
>option name synchronized with solaris 8.

this makes stdhosts(8) to ignore non-IPv4 address by default. stdhosts -n
will allow other address types.
this is to be friendly with /etc/hosts with IPv6 mapping, and to make
hosts.{byname,byaddr} IPv4 only (solaris8 nis practice).

full IPv6 NIS database support (like ipnodes.{byname,byaddr} support
in Makefile.yp) is available in netbsd-current, however, it needs to pass
interop test before going into 1.5.

stdhosts.8 1.5 -> 1.6
stdhosts.c 1.11 -> 1.12
 1.11.16.1 23-Jul-2013  riastradh sync with HEAD
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20 30-Aug-2011  joerg static + __dead
 1.19 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.18 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.17 30-Oct-2004  dsl branches: 1.17.34;
Add (unsigned char) cast to ctype functions
 1.16 30-Nov-2002  lukem tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
 1.15 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.14 18-Aug-2001  ad getopt() returns -1 on error, not EOF.
 1.13 19-Feb-2001  cgd convert to use getprogname()
 1.12 30-Jul-2000  itojun with -n, permit non-IPv4 address in the output.
option name synchronized with solaris 8.
 1.11 25-Jul-1999  lukem branches: 1.11.8;
fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
 1.10 17-Jan-1999  lukem * don't print out entries that couldn't be parsed
* don't look for comments; fparseln strips them
 1.9 11-Jun-1998  kleink Fix LP64 botches introduced in last commit.
 1.8 08-Jun-1998  lukem convert from in-house read_line to fparseln()
 1.7 13-Nov-1997  thorpej Fix int vs. size_t lossage.
 1.6 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.5 13-Oct-1997  lukem branches: 1.5.2;
add rcsid
 1.4 07-Oct-1997  lukem fix & simplify test for skippable lines
 1.3 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.2 24-Nov-1996  chuck include all host names for an address rather than just the first one
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.2.1 28-Nov-1997  mellon Pull rev 1.6 and 1.7 up from trunk (lkuem)
 1.11.8.1 19-Sep-2000  itojun pullup (approved by releng-1-5)
>with -n, permit non-IPv4 address in the output.
>option name synchronized with solaris 8.

this makes stdhosts(8) to ignore non-IPv4 address by default. stdhosts -n
will allow other address types.
this is to be friendly with /etc/hosts with IPv6 mapping, and to make
hosts.{byname,byaddr} IPv4 only (solaris8 nis practice).

full IPv6 NIS database support (like ipnodes.{byname,byaddr} support
in Makefile.yp) is available in netbsd-current, however, it needs to pass
interop test before going into 1.5.

stdhosts.8 1.5 -> 1.6
stdhosts.c 1.11 -> 1.12
 1.17.34.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 15-Oct-1997  lukem - major cleanup of Makefile.yp to use modern make(1) variables, and
follow our formatting convetions.
- add support for aliases, amd.home, master.passwd and netgroup maps
[initially from openbsd, reworked as above]
- if INSECURE != "yes" then the passwd.by* maps will not contain the
encrypted version of the passwd - privileged clients will request
info from the master.passwd.by* maps.
FreeBSD originally implemented this, and & OpenBSD supports it too.
[from openbsd].

By default, passwd maps are INSECURE, but in a *BSD-only environment,
this could be disabled to allow for a [slightly] higher degree of
security from non-root users...
 1.5 24-Mar-1997  christos Makefile cleanups
 1.4 27-Jan-1997  cjs Format and install ypinit manual page. (PR 3139 from
Andrew Wheadon <andrew@wipux2.wifo.uni-mannheim.de>.)
 1.3 18-Oct-1996  thorpej Use ${INSTALL}.
 1.2 09-Aug-1996  thorpej Install the Makefiles with mode 0644, not ${BINMODE}
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5 30-Jul-2000  itojun generate ipnodes.{byname,byaddr} for IPv4/v6 lookups.
hosts.{byname,byaddr} is still an IPv4 only mapping.
obeys solaris8 practice. see comments in ypinit/Makefile.yp for details.

TODO: interop test with solaris8 (any takers?)
 1.4 25-Apr-1999  lukem split line
 1.3 15-Oct-1997  lukem - major cleanup of Makefile.yp to use modern make(1) variables, and
follow our formatting convetions.
- add support for aliases, amd.home, master.passwd and netgroup maps
[initially from openbsd, reworked as above]
- if INSECURE != "yes" then the passwd.by* maps will not contain the
encrypted version of the passwd - privileged clients will request
info from the master.passwd.by* maps.
FreeBSD originally implemented this, and & OpenBSD supports it too.
[from openbsd].

By default, passwd maps are INSECURE, but in a *BSD-only environment,
this could be disabled to allow for a [slightly] higher degree of
security from non-root users...
 1.2 12-Oct-1997  mycroft Make this work again, and add ethers to the list of recursive targets.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.23 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.22 19-Jul-2013  hauke Commit the patches in Wolfgang Stukenbrock's PR bin/41896.

(1) Do not serve UIDs below MINUID in master.passwd.* maps,
just like in passwd.* maps.

(2) Since stdethers(8) and stdhosts(8) strip comments, we do
not have to do it here, much less inconsistently.
 1.21 07-Oct-2006  elad branches: 1.21.40; 1.21.46; 1.21.52;
PR/31956: Andrew Daugherity: Makefile.yp: shadow.byname map should respect
MINUID

Patch applied and verified by francisg@#NetBSD-code, thanks!
 1.20 29-Dec-2004  grant when generating maps, use -n argument to stdhosts(1) so ipv6 addresses
are allowed.
 1.19 20-Apr-2003  christos PR/5999: Todd Vierling: minor nits about Makefile.yp
Provide MINUID and MINGID variables to specify the minimum uid and gid to
be included in the password and group maps.
 1.18 06-Aug-2001  christos - Filter out the YP_ keys from mail.aliases. How did this ever work?
- Don't be verbose when creating the amd maps.
 1.17 05-Aug-2001  hubertf * Allow generating more than one amd map, by storing the maps to create
in a variable that can be added other maps than amd.home. Patch submitted
in PR 11826 by Anthony Mallet <anthony.mallet@ficus.yi.org>
* Slightly optimize calculation of DOMAIN
 1.16 03-Jul-2001  christos Fix bogus awk + sed combination to handle continuations and empty lines.
It broke a sequence of:

key1 \
value1 \
value2 \
value3 \


key2 \
value4 \


etc.

Handle both the netgroup rule and the amd.home rule using a .USEBEFORE
macro rule, since they contain the same code.
XXX: Needs new make(1)
 1.15 19-Jun-2001  wiz `accessible' only has one `a'.
 1.14 16-Jan-2001  scottr Fix the sorting introduced in rev 1.9 for the netgroup map:
handle entries that span multiple lines correctly.
 1.13 11-Oct-2000  itojun /etc/mail/aliases, not /etc/aliases. PR 10167.
 1.12 19-Sep-2000  christos oops, use MAKEDBM_S
 1.11 19-Sep-2000  christos add a non-enabled rule to build solaris and linux shadow files.
 1.10 30-Jul-2000  itojun generate ipnodes.{byname,byaddr} for IPv4/v6 lookups.
hosts.{byname,byaddr} is still an IPv4 only mapping.
obeys solaris8 practice. see comments in ypinit/Makefile.yp for details.

TODO: interop test with solaris8 (any takers?)
 1.9 19-Nov-1999  abs branches: 1.9.4;
Our db btree(3) implementation is tuned for ordered insertion, so pipe
through sort before makedbm.
This drops Erik Rungi's <rungus@openface.ca> passwd.byname generation for
3000 entries from 25-30 seconds down to 0.75 seconds.
 1.8 08-Jun-1998  lukem branches: 1.8.2; 1.8.6;
disable INSECURE=yes now that libc support master.passwd YP maps
 1.7 18-Nov-1997  lukem note that INSECURE=no isn't yet supported for netbsd clients
 1.6 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.5 15-Oct-1997  lukem branches: 1.5.2;
- major cleanup of Makefile.yp to use modern make(1) variables, and
follow our formatting convetions.
- add support for aliases, amd.home, master.passwd and netgroup maps
[initially from openbsd, reworked as above]
- if INSECURE != "yes" then the passwd.by* maps will not contain the
encrypted version of the passwd - privileged clients will request
info from the master.passwd.by* maps.
FreeBSD originally implemented this, and & OpenBSD supports it too.
[from openbsd].

By default, passwd maps are INSECURE, but in a *BSD-only environment,
this could be disabled to allow for a [slightly] higher degree of
security from non-root users...
 1.4 29-Jul-1997  mikel pushed ethers, not hosts
 1.3 09-Aug-1996  thorpej Alter the ypservers rule a bit to always make sure that this map
exists.
 1.2 09-Aug-1996  thorpej Add a rule for the `ypservers' map (the map containing a list of
slaves for the YP domain). This map is not built by default, but the
rule exists to make adding slave servers a bit easier.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.2.1 28-Nov-1997  mellon Pull rev 1.6 and 1.7 up from trunk (lukem)
 1.8.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.2.2 30-Jan-2001  he Pull up revision 1.14 (requested by sr):
Handle multi-line netgroup entries correctly.
 1.8.2.1 20-Nov-1999  he Pull up revision 1.9 (requested by abs):
Sort maps before makedbm. Can speed up large maps over tenfold.
 1.9.4.2 03-Feb-2001  he Pull up revision 1.14 (requested by scottr):
Handle multiple-line netgroup entries correctly.
 1.9.4.1 16-Oct-2000  tv Pullup 1.13 [itojun]:
/etc/mail/aliases, not /etc/aliases. PR 10167.
 1.21.52.1 23-Jul-2013  riastradh sync with HEAD
 1.21.46.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.40.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19 25-Sep-2018  wiz New sentence, new line. Use An/Mt.
 1.18 23-Sep-2018  kre Switch from getopt to getopts - and as part of that, update the usage,
and the man page, to reflect modern usage rather than some ancient style
that getopt[s] does not support (options, and their args when they exist)
always come before non-option agrs.

While here, update uses of test(1) to avoid obsolescent forms (and
even when still defined, prefer sh structures over test when possible).
 1.17 03-Jul-2017  wiz branches: 1.17.4; 1.17.6;
Remove workaround for ancient HTML generation code.
 1.16 30-Apr-2008  martin Convert TNF licenses to new 2 clause variant
 1.15 26-Feb-2005  thorpej branches: 1.15.24;
YP -> NIS
 1.14 12-Nov-2003  grant s/netbsd.org/NetBSD.org/i
 1.13 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.12 21-Dec-2002  wiz Foundation has only one a, from Adrian Mrva.
 1.11 06-Jul-2002  wiz Use .Aq instead of \*[Lt]...\*[Gt] in two places. End sentence with a dot.
 1.10 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.9 02-Feb-2002  wiz Sort SEE ALSO, use standard headers.
 1.8 01-Aug-2001  garbled Add a -l argument to ypinit that allows adding servers in the format
server1,server2,server3 on the command line. This allows the user to
optionally avoid the interactive mode of ypinit. If the -l flag is not
supplied, the old behavior is retained.

This allows users to do things like rsh out creation of YP clients, and
sushi to generate yp clients/servers/slaves.
 1.7 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.6 08-Jun-1998  lukem add ypinit -c (setup yp client)
 1.5 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.4 07-Oct-1997  lukem branches: 1.4.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.3 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.2 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.1 05-Jan-1997  cjs New manual page for ypinit(8).
 1.4.2.1 28-Nov-1997  mellon Pull rev 1.5 up from trunk (lukem()
 1.15.24.1 18-May-2008  yamt sync with head.
 1.17.6.1 10-Jun-2019  christos Sync with HEAD
 1.17.4.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.15 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.14 23-Sep-2018  kre Switch from getopt to getopts - and as part of that, update the usage,
and the man page, to reflect modern usage rather than some ancient style
that getopt[s] does not support (options, and their args when they exist)
always come before non-option agrs.

While here, update uses of test(1) to avoid obsolescent forms (and
even when still defined, prefer sh structures over test when possible).
 1.13 20-Jul-2018  kre PR bin/53458

Bring this script a little up to date - make it work with modern /bin/sh
(avoid HOSTNAME as a random variable) clean up trailing spaces on lines,
use $( ) instead of `` ...
 1.12 05-Oct-2004  tron branches: 1.12.82; 1.12.88; 1.12.90;
Fix bug which caused "ypinit" to die with a strange error message if
"/var/yp/binding" doesn't exist.
 1.11 12-Nov-2003  grant branches: 1.11.4;
s/netbsd.org/NetBSD.org/i
 1.10 01-Aug-2001  garbled Add a -l argument to ypinit that allows adding servers in the format
server1,server2,server3 on the command line. This allows the user to
optionally avoid the interactive mode of ypinit. If the -l flag is not
supplied, the old behavior is retained.

This allows users to do things like rsh out creation of YP clients, and
sushi to generate yp clients/servers/slaves.
 1.9 18-Jun-2001  lukem use mktemp(1) as appropriate
 1.8 08-Jun-1998  lukem add ypinit -c (setup yp client)
 1.7 18-Nov-1997  lukem overhaul code, provide saner error messages, etc
 1.6 01-Nov-1997  lukem * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
- store info in internal buffer
- fix \\ support
- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
- improve error handling
- take advantage of rewritten read_line(), and cleanup line parsing
- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
- remove leading spaces in variable assignment (from Chuck Cranor)
 1.5 25-Oct-1997  lukem fix spellos and incorrect man page references
 1.4 08-Oct-1997  lukem branches: 1.4.2;
- set the umask to 077, to protect the created directory
- clean up a couple of the messages
 1.3 09-Aug-1996  thorpej Remove hard-coded a /var/yp.
 1.2 09-Aug-1996  thorpej Make this script a little more sane.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.2.3 28-Nov-1997  mellon Pull rev 1.7 up from trunk (lulkm)
 1.4.2.2 06-Nov-1997  mellon Pull rev 1.6 up from trunk (lukem)
 1.4.2.1 26-Oct-1997  mellon Pull rev 1.5 up from trunk (lukem)
 1.11.4.1 12-Jan-2005  he Pull up evision 1.12 (requested by tron in ticket #893):
Fix a bug which caused "ypinit" to die with a strange error message
if "/var/yp/binding" does not exist.
 1.12.90.1 10-Jun-2019  christos Sync with HEAD
 1.12.88.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.12.88.1 28-Jul-2018  pgoyette Sync with HEAD
 1.12.82.1 27-Jul-2018  martin Pull up following revision(s) (requested by kre in ticket #943):

usr.sbin/ypserv/ypinit/ypinit.sh: revision 1.13

PR bin/53458

Bring this script a little up to date - make it work with modern /bin/sh
(avoid HOSTNAME as a random variable) clean up trailing spaces on lines,
use $( ) instead of `` ...
 1.7 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.6 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.5 02-Oct-1997  lukem branches: 1.5.110;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.110.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13 08-Apr-2012  wiz Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.12 20-Oct-2009  snj branches: 1.12.6;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.11 26-Feb-2005  thorpej YP -> NIS
 1.10 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.9 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section.
 1.8 19-Jan-2002  wiz Whitespace nits.
 1.7 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.6 19-Aug-1998  tv "featch" -> "fetched"
 1.5 18-Nov-1997  lukem rewritten yppush from Chuck Cranor.
 1.4 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.3 07-Oct-1997  lukem branches: 1.3.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 and 1.5 up from trunk (lukem)
 1.12.6.1 17-Apr-2012  yamt sync with head
 1.25 24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.24 30-Aug-2011  joerg static + __dead
 1.23 01-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.

no functional change with this commit.
 1.22 19-Apr-2009  lukem branches: 1.22.2;
Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.21 29-Feb-2008  lukem branches: 1.21.10;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.20 27-Feb-2008  lukem Correct the argument order to ypdb_open().
 1.19 30-Oct-2004  dsl branches: 1.19.16; 1.19.22;
Add (unsigned char) cast to ctype functions
 1.18 06-Jul-2002  wiz ANSIfy, de-__P(), and remove unused SIG_PF define.
 1.17 19-Feb-2001  cgd convert to use getprogname()
 1.16 11-Jan-2001  lukem oops, forgot syslog.h
 1.15 11-Jan-2001  lukem add openlog(...,pid, daemon)
 1.14 13-Sep-2000  thorpej Don't abort if pushing to one server in the ypservers map fails.
There might be serveral more waiting to be pushed to.

This is only 1/2 of the fix. ypxfer(8) also needs a change to
avoid a false error, but this allows pushes to continue to work,
at least.

Problem noted by aflury@zembu.com and agordon@zembu.com.
 1.13 04-Jul-2000  matt More #include <stdlib.h> string, etc. cleanup
 1.12 03-Jun-2000  fvdl branches: 1.12.2;
The interal SVCXPRT field xp_sock was used, but this is now xp_fd.
 1.11 25-Jul-1999  lukem branches: 1.11.6;
don't call ypdb_close() until after we're finished using data returned
by a previous ypdb_*() operation. seems to fix a problem noted in [bin/8064]
 1.10 11-Jan-1999  kleink In userland, pull in <errno.h> instead of <sys/errno.h> for the declaration
of errno.
 1.9 18-Nov-1997  thorpej Need <string.h> for prototypes.
 1.8 18-Nov-1997  lukem rewritten yppush from Chuck Cranor.
 1.7 19-Oct-1997  mycroft branches: 1.7.2;
Use S_IS*(), not S_IF*.
 1.6 13-Oct-1997  lukem add rcsid
 1.5 07-Oct-1997  lukem use err instead of errx, so the user has some idea why the file wasn't opened
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 09-Aug-1996  thorpej Error out if we can't determine the YP domain name to be used for
the RPC.
 1.2 09-Aug-1996  thorpej Use the key, not the val from the datum when reading the `ypservers'
map. SunOS ypservers maps place the host name in the key and the val,
but HP-UX and NetBSD ypservers maps place the hostname only in the
key, leaving the val empty. Since there is no clear standard for this map,
best to play it safe.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.7.2.1 28-Nov-1997  mellon Pull rev 1.8 and 1.9 up from trunk (lukem)
 1.11.6.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.12.2.1 19-Sep-2000  thorpej Pull up rev. 1.14:
Don't abort if pushing to one server in the ypservers map fails.
There might be serveral more waiting to be pushed to.

This is only 1/2 of the fix. ypxfer(8) also needs a change to
avoid a false error, but this allows pushes to continue to work,
at least.

Problem noted by aflury@zembu.com and agordon@zembu.com.
 1.19.22.1 24-Mar-2008  keiichi sync with head.
 1.19.16.1 23-Mar-2008  matt sync with HEAD
 1.21.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.22.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.4 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.3 12-Nov-2003  grant branches: 1.3.40;
s/netbsd.org/NetBSD.org/i
 1.2 06-Jul-2002  wiz ANSIfy, de-__P(), and remove unused SIG_PF define.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.40.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.5 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.4 06-Jul-2002  wiz branches: 1.4.40;
ANSIfy, de-__P(), and remove unused SIG_PF define.
 1.3 13-Oct-1997  lukem add rcsid
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.40.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.5 06-Jul-2002  wiz ANSIfy, de-__P(), and remove unused SIG_PF define.
 1.4 18-Nov-1997  lukem use warn("%s", func()) instead of warn(func())
 1.3 13-Oct-1997  lukem branches: 1.3.2;
add rcsid
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 up from trunk (lukem)
 1.10 30-Aug-2011  plunky Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
 1.9 21-Oct-2009  snj Remove 3rd and 4th clauses. Approved by Mats O Jansson (copyright holder).
 1.8 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.7 12-Nov-2003  grant branches: 1.7.40;
s/netbsd.org/NetBSD.org/i
 1.6 06-Jul-2002  wiz ANSIfy, de-__P(), and remove unused SIG_PF define.
 1.5 18-Nov-1997  lukem use warn("%s", func()) instead of warn(func())
 1.4 13-Oct-1997  lukem branches: 1.4.2;
add rcsid
 1.3 07-Oct-1997  lukem use err instead of errx, so the user has some idea why the file wasn't opened
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4.2.1 28-Nov-1997  mellon Pull rev 1.5 up from trunk (lukem)
 1.7.40.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.24 03-Aug-2023  rin Revert CC_WNO_USE_AFTER_FREE from Makefile's (thanks uwe@)
 1.23 03-Aug-2023  rin Sprinkle CC_WNO_USE_AFTER_FREE for GCC 12

All of them are blamed for idiom equivalent to:
newbuf = realloc(buf, size);
p = newbuf + (p - buf);
 1.22 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.21 07-Mar-2021  christos Add blocklist support to libwrap which enables all programs using libwrap
to block access from hosts we deny. (libwrap support from Greg A. Woods)
 1.20 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.19 15-Aug-2019  kamil Avoid symbol clashes in usr.sbin/ypserv/ypserv under MKSANITIZER

Remove symbol conflicts for: gethostbyname2
 1.18 29-Oct-2009  christos branches: 1.18.46; 1.18.48;
no need for YY_NO here.
 1.17 20-May-2006  christos - fix pointer problems and unsigned int -> int confusion that lead to
undetected errors.
- factor out the socket creation code so that we don't have 4 copies.
- add -p <port> argument
- fix the majority of the lint problems.
- change all the strncpy's to strlcpy's.
 1.16 11-May-2006  mrg sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4.
 1.15 22-Jul-2003  lukem use CPPFLAGS.filename=... to add file-specific overrides
 1.14 18-Sep-2002  lukem use NETBSDSRCDIR as appropriate
 1.13 12-Jan-2001  cgd When building gethnamaddr.o and getnetnamadr.o from libc sources,
define _LIBC so that the weak aliases those files normally define if
built in libc get set properly. Otherwise, this doesn't link statically.
Static linking tested on NetBSD/i386 by sommerfeld, correct runtime
operation not verified (but should be no different than before).
 1.12 06-Jun-1999  thorpej Use pidfile(3).
 1.11 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.10 19-Jan-1999  lukem don't bother with nsdispatch(); just link in the relevant bits of
libc's gethostby*() and getnetby*() directly (with -UYP).
 1.9 09-Apr-1998  tv .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
 1.8 25-Oct-1997  lukem use CPPFLAGS instead of CFLAGS
 1.7 15-Oct-1997  lukem branches: 1.7.2;
database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.6 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.5 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.4 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.3 06-May-1997  gwr Use .PATH.c: ...
 1.2 22-Dec-1996  veego Add y.tab.h to CLEANFILES.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.7.2.1 08-Nov-1997  lukem sync with trunk (approved by thorpej)
 1.18.48.1 16-Aug-2019  martin Pull up following revision(s) (requested by kamil in ticket #66):

usr.sbin/ypserv/ypserv/Makefile: revision 1.19

Avoid symbol clashes in usr.sbin/ypserv/ypserv under MKSANITIZER

Remove symbol conflicts for: gethostbyname2
 1.18.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.5 18-Jan-1999  lukem fix error message
 1.4 15-Oct-1997  lukem database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.3 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.3 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.2 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.3 09-Apr-1998  tv .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
 1.2 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.3 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.2 02-Oct-1997  lukem branches: 1.2.2;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukem)
 1.22 25-Apr-2011  wiz New sentence, new line. Use more markup.
 1.21 05-Apr-2010  joerg No trailing whitespace
 1.20 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.19 16-May-2008  chuck Disable hostname lookup for ypserv(8) libwrap access control,
as they can cause performance problems while ypserv is blocked
waiting for the DNS to respond. initially discussed here:

http://mail-index.netbsd.org/tech-userlevel/2006/11/01/0014.html

This diff is from Doug Needham who found an easy way to get
the desired behavior without having to change libwrap.
 1.18 20-May-2006  christos branches: 1.18.4; 1.18.6; 1.18.18; 1.18.20;
- fix pointer problems and unsigned int -> int confusion that lead to
undetected errors.
- factor out the socket creation code so that we don't have 4 copies.
- add -p <port> argument
- fix the majority of the lint problems.
- change all the strncpy's to strlcpy's.
 1.17 26-Feb-2005  thorpej YP -> NIS
 1.16 12-Nov-2003  grant use An and Aq for name/email address instead of \*[Lt] and \*[Gt].
s/netbsd.org/NetBSD.org/i
 1.15 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.14 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.13 02-Feb-2002  wiz Use standard headers, sort SEE ALSO.
 1.12 19-Jan-2002  wiz Whitespace nits.
 1.11 27-Jul-2001  hubertf Document -f option in synopsis
 1.10 05-Jul-2000  msaitoh remove extra period in SEE ALL section
 1.9 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.8 18-Feb-1999  abs Replace compile time RPC_SVC_FG with -f option to run in the foreground.
 1.7 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.6 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.5 18-Oct-1997  mikel branches: 1.5.2;
xref ypbind(8), not nonexistent ypbind(1)
 1.4 07-Oct-1997  lukem cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.3 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.2 05-Jan-1997  cjs Add reference to ypinit(8).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.2.1 28-Nov-1997  mellon Pull rev 1.6 up from trunk (fvdl)
 1.18.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.18.1 18-May-2008  yamt sync with head.
 1.18.6.1 04-Sep-2008  skrll Sync with netbsd-4.
 1.18.4.1 31-Aug-2008  jdc Pull up revisions:
src/usr.sbin/ypserv/ypserv/ypserv.8:1.19
src/usr.sbin/ypserv/ypserv/ypserv.c:1.22
(requested by chuck in ticket #1150).

Disable hostname lookup for ypserv(8) libwrap access control,
as they can cause performance problems while ypserv is blocked
waiting for the DNS to respond. initially discussed here:

http://mail-index.netbsd.org/tech-userlevel/2006/11/01/0014.html

This diff is from Doug Needham who found an easy way to get
the desired behavior without having to change libwrap.
 1.2 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.4 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.3 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.2 02-Oct-1997  lukem branches: 1.2.2;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukem)
 1.27 07-Mar-2021  christos Add blocklist support to libwrap which enables all programs using libwrap
to block access from hosts we deny. (libwrap support from Greg A. Woods)
 1.26 15-Mar-2012  joerg Add __printflike attribution to use vprintf and friends with an argument
as format string.
 1.25 30-Aug-2011  plunky branches: 1.25.2;
Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
 1.24 25-Apr-2011  wiz Add -f to usage, and make it match man page.
 1.23 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.22 16-May-2008  chuck Disable hostname lookup for ypserv(8) libwrap access control,
as they can cause performance problems while ypserv is blocked
waiting for the DNS to respond. initially discussed here:

http://mail-index.netbsd.org/tech-userlevel/2006/11/01/0014.html

This diff is from Doug Needham who found an easy way to get
the desired behavior without having to change libwrap.
 1.21 15-Dec-2007  perry branches: 1.21.4; 1.21.6;
convert __attribute__s to applicable cdefs.h macros
 1.20 20-May-2006  christos branches: 1.20.4; 1.20.6; 1.20.10;
- fix pointer problems and unsigned int -> int confusion that lead to
undetected errors.
- factor out the socket creation code so that we don't have 4 copies.
- add -p <port> argument
- fix the majority of the lint problems.
- change all the strncpy's to strlcpy's.
 1.19 30-Mar-2005  christos Use SA_NOCLDWAIT instead of catching the signal and waiting. Avoids signal
races the easy way.
 1.18 06-Jul-2002  wiz branches: 1.18.6;
ANSIfy (overlooked some...)
 1.17 06-Jul-2002  wiz Actually, SIG_PF isn't needed in this file at all -- remove it.
 1.16 06-Jul-2002  wiz De-__P(), ANSIfy the one function that wasn't, and unifdef __STDC__.
 1.15 16-Oct-2001  itojun s/IPV6_BINDV6ONLY/IPV6_V6ONLY/ to follow changes made yesterday.
 1.14 19-Feb-2001  cgd convert to use getprogname()
 1.13 11-Jan-2001  lukem use "ypserv" instead of __progname as ident arg to openlog
 1.12 08-Dec-2000  thorpej Convert to TI-RPC, modeled after mountd(8) since we do host-based
access checking (via libwrap) like mountd(8) does.

Also, garbage-collect a bunch of stuff that is normally created by
rpcgen(1) that we'll never use in this program.
 1.11 07-Jul-2000  itojun syslog() audit - do not use it with a variable alone. from openbsd
 1.10 06-Jun-1999  thorpej branches: 1.10.8;
Use pidfile(3).
 1.9 18-Feb-1999  abs Replace compile time RPC_SVC_FG with -f option to run in the foreground.
 1.8 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.7 15-Oct-1997  lukem database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.6 08-Oct-1997  lukem - print a message and exit if the port returned by clnt(udp|tcp)_create isn't
a reserved port
- don't define optarg/optind - it comes from <unistd.h>
- deprecate register
 1.5 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.4 17-Apr-1997  christos PR/3504: Brian Baird:
- Do what the manual page says; don't create the log file if it does not exist.
- Limited support for ypserv v1; apparently sunos4 clients use it and sunos5
server provides the same.
 1.3 05-Mar-1997  mikel don't write the PID file until after calling daemon(3); from Enami
Tsugutomo in PR bin/3280.
fix a typo in the error message while I'm here.
 1.2 02-Oct-1996  ws Use an integer instead of a char to store the getopt() return value in
order to match prototypes.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.10.8.1 27-Jul-2000  itojun pullup (approved by releng-1-5)
printf-like format pedant. do not pass string variable alone. use "%s".
from openbsd.

/cvsroot/basesrc/usr.sbin/netgroup_mkdb/netgroup_mkdb.c 1.9 -> 1.10
/cvsroot/basesrc/usr.sbin/pwd_mkdb/pwd_mkdb.c 1.17 -> 1.18
/cvsroot/basesrc/usr.sbin/quotaon/quotaon.c 1.14 -> 1.15
/cvsroot/basesrc/usr.sbin/rdate/rdate.c 1.10 -> 1.11
/cvsroot/basesrc/usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c 1.5 -> 1.6
/cvsroot/basesrc/usr.sbin/traceroute6/traceroute6.c 1.12 -> 1.13
/cvsroot/basesrc/usr.sbin/wsconscfg/wsconscfg.c 1.6 -> 1.7
/cvsroot/basesrc/usr.sbin/ypserv/revnetgroup/revnetgroup.c 1.7 -> 1.8
/cvsroot/basesrc/usr.sbin/ypserv/ypserv/ypserv.c 1.10 -> 1.11
 1.18.6.1 11-May-2005  tron Pull up revision 1.19 (requested by chuck in ticket #281):
Use SA_NOCLDWAIT instead of catching the signal and waiting. Avoids signal
races the easy way.
 1.20.10.1 09-Jan-2008  matt sync with HEAD
 1.20.6.1 04-Sep-2008  skrll Sync with netbsd-4.
 1.20.4.1 31-Aug-2008  jdc Pull up revisions:
src/usr.sbin/ypserv/ypserv/ypserv.8:1.19
src/usr.sbin/ypserv/ypserv/ypserv.c:1.22
(requested by chuck in ticket #1150).

Disable hostname lookup for ypserv(8) libwrap access control,
as they can cause performance problems while ypserv is blocked
waiting for the DNS to respond. initially discussed here:

http://mail-index.netbsd.org/tech-userlevel/2006/11/01/0014.html

This diff is from Doug Needham who found an easy way to get
the desired behavior without having to change libwrap.
 1.21.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.21.4.1 18-May-2008  yamt sync with head.
 1.25.2.1 17-Apr-2012  yamt sync with head
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 06-Jul-2002  wiz branches: 1.5.30;
De-__P(), ANSIfy the one function that wasn't, and unifdef __STDC__.
 1.4 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.3 15-Oct-1997  lukem database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.2 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.30.1 18-May-2008  yamt sync with head.
 1.23 13-Oct-2020  kamil Convert the CIRCLEQ (from sys/queue.h) usage to TAILQ

The CIRCLEQ API from sys/queue.h is deprecated since NetBSD 7 and is
already gone from FreeBSD and OpenBSD.
 1.22 01-Feb-2011  chuck remove no-longer-valid wustl email address for me.

no functional change with this commit.
 1.21 19-Oct-2009  snj branches: 1.21.2;
Remove third and fourth clauses, as was done upstream in revision 1.25.
 1.20 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.19 29-Feb-2008  lukem branches: 1.19.10;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.18 15-Oct-2006  christos branches: 1.18.8; 1.18.14;
strlcpy off by one errors (from gdamore)
 1.17 20-May-2006  christos - fix pointer problems and unsigned int -> int confusion that lead to
undetected errors.
- factor out the socket creation code so that we don't have 4 copies.
- add -p <port> argument
- fix the majority of the lint problems.
- change all the strncpy's to strlcpy's.
 1.16 07-Sep-2004  jrf Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
 1.15 16-Jul-2003  itojun strlcpy
 1.14 06-Jul-2002  wiz ANSIfy (overlooked some...)
 1.13 06-Jul-2002  wiz De-__P(), ANSIfy the one function that wasn't, and unifdef __STDC__.
 1.12 18-Jun-2002  thorpej Fix some printf formats in debug code.
 1.11 19-Jun-2001  wiz `existent', not `existant'
 1.10 23-Jan-1999  thorpej Fix some debugging printf formats.
 1.9 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.8 19-Jan-1999  lukem don't bother with nsdispatch(); just link in the relevant bits of
libc's gethostby*() and getnetby*() directly (with -UYP).
 1.7 17-Jan-1999  lukem convert from tweaking _res.lookups[] to calling nsdispatch(3) directly
for gethostby{name,addr}() (without methods for the yp lookups).
ypserv will now match names for the `hosts:' entry (ignoring `nis' if
specified).
 1.6 08-Nov-1997  lukem more fixes for OPTIMIZE_DB (seems like this code was an unfinished idea;
i've fixed a lot of bugs in it):
* implement yp_close_map(struct opt_map *), to close a specific map,
using the guts of yp_close_last()
* simplify yp_close_last() to use yp_close_map()
* ypdb_open_db(): add the st_dev, st_ino, and st_mtime of each map to
the cached info, and check if changes if the db is cached; if so, close
the map and reopen it fresh. also uncache entries if the domain or
file disappear
 1.5 15-Oct-1997  lukem branches: 1.5.2;
database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 12-Jan-1997  tls b->mem
 1.2 27-Nov-1996  thorpej Protect against NULL pointer reference in yp_private(). This can happen
with, e.g. an empty "ypservers" map, causing a SEGV in the child which
handles an "all_2" proc.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.2.1 28-Nov-1997  mellon Pull rev 1.6 up from trunk (lukem)
 1.18.14.1 24-Mar-2008  keiichi sync with head.
 1.18.8.1 23-Mar-2008  matt sync with HEAD
 1.19.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.21.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.18 17-Jan-2018  christos PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
XXX: pullup-6,7,8
 1.17 17-Jul-2015  christos branches: 1.17.8;
PR/50057: Wolfgang Stukenbrock: yp-map transfer removes SECURE-flag
 1.16 30-Aug-2011  plunky branches: 1.16.4; 1.16.10; 1.16.16; 1.16.20;
Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
 1.15 01-Jul-2011  joerg Replace malloc + incorrect memset with calloc.
 1.14 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.13 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.12 22-Aug-2007  christos branches: 1.12.16;
PR/36820: Geoff C. Wing: ypserv maplist functionality broken due to off-by-one
error
 1.11 20-May-2006  christos branches: 1.11.4; 1.11.6;
- fix pointer problems and unsigned int -> int confusion that lead to
undetected errors.
- factor out the socket creation code so that we don't have 4 copies.
- add -p <port> argument
- fix the majority of the lint problems.
- change all the strncpy's to strlcpy's.
 1.10 06-Jul-2002  wiz ANSIfy (overlooked some...)
 1.9 16-Mar-2001  tron Don't force numeirc IP address for "-h" argument when invoking "ypxfr"
because neither "ypxfr" nor the YP bits of "libc" can handle IPv6. If the
hostname is used there will be an automatic fallback to IPv4 which makes
server pushed work again in mixed IPv4 and IPv6 environments. This fixes
bin/11755 by myself.
 1.8 09-Dec-2000  thorpej More IPv6-friendliness.
 1.7 22-Jan-1999  thorpej Throw out the old ypserv access control list code. Instead, use libwrap
for access control. Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
 1.6 31-Dec-1997  thorpej Change a couple of exit()s to _exit(), to make it safe for vfork().
 1.5 15-Oct-1997  lukem database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 27-Nov-1996  thorpej Make this compile with -DDEBUG.
 1.2 15-Aug-1996  chuck fix printf format (%s -> %d) in yplog debug statement
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.11.6.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.11.4.1 24-Aug-2007  liamjfoy Pull up following revision(s) (requested by tron in ticket #837):
usr.sbin/ypserv/ypserv/ypserv_proc.c: revision 1.12
PR/36820: Geoff C. Wing: ypserv maplist functionality broken due to off-by-=
one
error
 1.12.16.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.16.20.2 19-Feb-2018  snj Pull up following revision(s) (requested by christos in ticket #1566):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.16.20.1 31-Jul-2015  snj branches: 1.16.20.1.2; 1.16.20.1.6;
Pull up following revision(s) (requested by christos in ticket #919):
usr.sbin/ypserv/ypserv/ypserv_proc.c: revision 1.17
PR/50057: Wolfgang Stukenbrock: yp-map transfer removes SECURE-flag
 1.16.20.1.6.1 19-Feb-2018  snj Pull up following revision(s) (requested by christos in ticket #1566):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.16.20.1.2.1 19-Feb-2018  snj Pull up following revision(s) (requested by christos in ticket #1566):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.16.16.1 10-Apr-2018  snj Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.16.10.1 10-Apr-2018  snj Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.16.4.1 10-Apr-2018  snj Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.17.8.1 11-Feb-2018  snj Pull up following revision(s) (requested by christos in ticket #542):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
 1.4 12-Nov-2003  grant s/netbsd.org/NetBSD.org/i
 1.3 06-Jul-2002  wiz De-__P(), ANSIfy the one function that wasn't, and unifdef __STDC__.
 1.2 15-Oct-1997  lukem database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
refuse to serve information to clients not requesting from an
IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
"/"'s, aren't too long, etc) [idea from openbsd, but using our
_yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.10 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.9 20-Jul-2013  wiz Use Mt for email addresses.
 1.8 20-Oct-2009  snj branches: 1.8.6; 1.8.12; 1.8.16;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.7 26-Feb-2005  thorpej YP -> NIS
 1.6 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section, drop a .Pp.
 1.5 19-Jan-2002  wiz Whitespace nits.
 1.4 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.3 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.2 02-Oct-1997  lukem branches: 1.2.2;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.2.2.1 28-Nov-1997  mellon Pull rev 1.3 up from trunk (lukem)
 1.8.16.1 23-Jul-2013  riastradh sync with HEAD
 1.8.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10 04-May-2017  sevan Drop main() prototype.
 1.9 20-Oct-2009  snj branches: 1.9.36;
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.8 22-Oct-2004  peter Constify.
 1.7 22-Oct-2004  peter Check the status for each test and print the result or an error message
according to the status code. This fixes a core dump in test 4.

Closes PR bin/27145 from ianzag at megasignal.com
Reviewed by christos, jdolecek.
 1.6 06-Jul-2002  wiz de-__P(), ANSIfy.
 1.5 19-Feb-2001  cgd convert to use getprogname()
 1.4 04-Jul-2000  matt More #include <stdlib.h> string, etc. cleanup
 1.3 13-Oct-1997  lukem add rcsid
 1.2 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.9.36.1 11-May-2017  pgoyette Sync with HEAD
 1.7 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.6 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.5 02-Oct-1997  lukem branches: 1.5.110;
- build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.2 06-May-1997  gwr Use .PATH.c: ...
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.5.110.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.15 20-Jul-2013  wiz Use Mt for email addresses.
 1.14 08-Apr-2012  wiz branches: 1.14.2; 1.14.4;
Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.13 25-Apr-2011  wiz branches: 1.13.4;
Remove unimplemented -b option. From YOMURA Masanori.
 1.12 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.11 26-Feb-2005  thorpej YP -> NIS
 1.10 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.9 21-Dec-2002  wiz instead, not insteed; from Adrian Mrva.
 1.8 05-Mar-2002  wiz Drop duplicate .Pp.
 1.7 02-Feb-2002  wiz Use standard headers, mark up AUTHORS section.
 1.6 19-Jan-2002  wiz Whitespace nits.
 1.5 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.4 08-Nov-1997  lukem use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames
 1.3 07-Oct-1997  lukem branches: 1.3.2;
cleanup typos, grammaros, thinkos, and misuse of mdoc macros
 1.2 02-Oct-1997  lukem - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
10% on compilation time)
- clean up the manual pages
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.3.2.1 28-Nov-1997  mellon Pull rev 1.4 up from trunk (lukem)
 1.13.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.4.1 17-Apr-2012  yamt sync with head
 1.14.4.1 23-Jul-2013  riastradh sync with HEAD
 1.14.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21 04-May-2017  sevan Drop main() prototype.
 1.20 25-Apr-2011  wiz branches: 1.20.34;
Make usage match manpage.
 1.19 05-Nov-2009  chuck rev 1.18 un-covered some bugs:

1. add_interdomain and add_secure are optional... not all maps use these
keys. if we are unable to add them due to a YPERR_KEY (meaning they
are not being used), then we should not flag this as a general error.

2. if we have a failure (status <= 0) we unlink_db() the temp database
as part of error handling. but we should not overwrite our error
status code with the return value from unlink_db() because if the
unlink_db() works (likely true) than that success will wipe out our
error code and the calling yppush will think we worked.
 1.18 05-Nov-2009  chuck yppush RPC is supposed to return yppush_status error/status codes
(e.g. YPPUSH_SUCC, YPPUSH_NOMAP, etc.).

Functions like yp_master, yp_order_host, yp_master_host, and
yp_match_host return YPERR-style error codes. YPERR-style error
codes do not directly correspond to yppush_status codes, so it
is a bad idea to just directly YPERR codes into the yppush return
status value (it causes failing yppush runs to print confusing
error messages).

Change ypxfr.c to convert the YPERR codes to YPPUSH codes.
 1.17 20-Oct-2009  snj Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
 1.16 19-Apr-2009  lukem Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
 1.15 29-Feb-2008  lukem branches: 1.15.8; 1.15.10;
Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok. I couldn't test ypxfer.
 1.14 22-Mar-2006  bouyer branches: 1.14.10; 1.14.16;
In add_secure(), change
(status > 0) to (status == 0 && value). It doesn't make sense to handle value
only if there was an error.
Fix coverity ID 1709.
 1.13 19-Jun-2005  lukem snprintf NUL terminates, so there is no need to explicitly do it afterwards
 1.12 06-Jul-2002  wiz de__P, ANSIfy.
 1.11 19-Feb-2001  cgd convert to use getprogname()
 1.10 11-Jan-2001  lukem use "ypxfr" instead of __progname as ident arg to openlog
wrap all debug syslogs in #ifdef DEBUG (rather than just most of them)
 1.9 25-Jul-1999  lukem don't call ypdb_close() until after we're finished using data returned
by a previous ypdb_*() operation. seems to fix a problem noted in [bin/8064]
 1.8 22-Jan-1999  thorpej Use syslog(3) to log debugging info, and only if we're compiled with
-DDEBUG.
 1.7 27-Aug-1998  ross {} fixes from Erik Bertelsen <erik@erik-be.uni-c.dk> (PR 6047) to shut up egcs.
 1.6 13-Oct-1997  lukem add rcsid
 1.5 07-Oct-1997  lukem minor KNFify
 1.4 18-Jul-1997  thorpej Fix compiler warnings (and an awful lot of annoying little bugs).
 1.3 22-Mar-1997  lukem use O_EXCL with O_CREAT when making the temporary db files
 1.2 15-Aug-1996  chuck fix broken case statement for "-C", also check to make sure we've got
the proper number of args for -C and give up if not. fixes yp slave servers.
 1.1 09-Aug-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1 09-Aug-1996  thorpej A ypserv implementation, originally written by Mats O Jansson, with
some changes by me, including misc. cleanup, minor bug fixes, and
brand-new access control list code.
 1.14.16.1 24-Mar-2008  keiichi sync with head.
 1.14.10.1 23-Mar-2008  matt sync with HEAD
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.15.8.1 16-Feb-2011  bouyer Pull up following revision(s) (requested by chuck in ticket #1550):
usr.sbin/ypserv/ypxfr/ypxfr.c: revision 1.16 - 1.19
Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.
thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
yppush RPC is supposed to return yppush_status error/status codes
(e.g. YPPUSH_SUCC, YPPUSH_NOMAP, etc.).
Functions like yp_master, yp_order_host, yp_master_host, and
yp_match_host return YPERR-style error codes. YPERR-style error
codes do not directly correspond to yppush_status codes, so it
is a bad idea to just directly YPERR codes into the yppush return
status value (it causes failing yppush runs to print confusing
error messages).
Change ypxfr.c to convert the YPERR codes to YPPUSH codes.
rev 1.18 un-covered some bugs:
1. add_interdomain and add_secure are optional... not all maps use these
keys. if we are unable to add them due to a YPERR_KEY (meaning they
are not being used), then we should not flag this as a general error.
2. if we have a failure (status <= 0) we unlink_db() the temp database
as part of error handling. but we should not overwrite our error
status code with the return value from unlink_db() because if the
unlink_db() works (likely true) than that success will wipe out our
error code and the calling yppush will think we worked.
 1.20.34.1 11-May-2017  pgoyette Sync with HEAD

RSS XML Feed