head	1.9;
access;
symbols
	RELENG_2_1_7_RELEASE:1.6.4.2
	RELENG_2_1_6_1_RELEASE:1.6.4.2
	RELENG_2_1_6_RELEASE:1.6.4.2
	RELENG_2_1_5_RELEASE:1.6.4.2
	RELENG_2_1_0_RELEASE:1.6.4.1
	RELENG_2_1_0:1.6.0.4
	RELENG_2_1_0_BP:1.6
	RELENG_2_0_5_RELEASE:1.6
	RELENG_2_0_5:1.6.0.2
	RELENG_2_0_5_BP:1.6
	RELENG_2_0_5_ALPHA:1.6;
locks; strict;
comment	@# @;


1.9
date	95.12.30.18.44.19;	author peter;	state dead;
branches;
next	1.8;

1.8
date	95.07.25.00.34.06;	author bde;	state Exp;
branches;
next	1.7;

1.7
date	95.07.12.16.28.10;	author wpaul;	state Exp;
branches;
next	1.6;

1.6
date	95.02.15.04.33.52;	author wpaul;	state Exp;
branches
	1.6.4.1;
next	1.5;

1.5
date	95.02.04.21.31.58;	author wpaul;	state Exp;
branches;
next	1.4;

1.4
date	95.02.03.22.01.17;	author wpaul;	state Exp;
branches;
next	1.3;

1.3
date	95.02.03.03.41.38;	author wpaul;	state Exp;
branches;
next	1.2;

1.2
date	95.02.01.01.59.57;	author wpaul;	state Exp;
branches;
next	1.1;

1.1
date	95.01.31.08.58.51;	author wpaul;	state Exp;
branches;
next	;

1.6.4.1
date	95.08.25.11.18.34;	author davidg;	state Exp;
branches;
next	1.6.4.2;

1.6.4.2
date	96.06.25.21.17.57;	author wpaul;	state Exp;
branches;
next	1.6.4.3;

1.6.4.3
date	99.09.05.11.11.35;	author peter;	state Exp;
branches;
next	;


desc
@@


1.9
log
@recording cvs-1.6 file death
@
text
@# $Id: Makefile,v 1.8 1995/07/25 00:34:06 bde Exp peter $
# From:	@@(#)Makefile	8.3 (Berkeley) 4/2/94

PROG=	ypserv
SRCS=	dnslookup.c svc_run.c yp_svc.c yp_xdr.c server.c

CFLAGS+=-Wall -DTCP_WRAPPER=0 -DTCPW_FACILITY=LOG_AUTH
CFLAGS+=-DMAX_CHILDREN=20 -DINSTDIR='"/usr/libexec"'

MAN8= ypserv.8

afterinstall:
	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
		${.CURDIR}/Makefile.yp \
		${DESTDIR}/var/yp/Makefile
	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		${.CURDIR}/mknetid \
		${DESTDIR}/usr/libexec/mknetid

.include <bsd.prog.mk>
@


1.8
log
@Change `install' to `${INSTALL}' so that default install flags can be
specified in the top level Makefiles.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.7 1995/07/12 16:28:10 wpaul Exp $
@


1.7
log
@ypserv performance improvements:

- There are two cases where the server can potentially block for a long
  time while servicing a request: when handling a yp_all() request, which
  could take a while to complete if the map being transfered is large
  (e.g. 'ypcat passwd' where passwd.byname has 10,000 entries in it),
  and while doing DNS lookups when in SunOS compat mode (with the -dns
  flag), since some DNS lookups can take a long time to complete. While
  ypserv is blocked, other clients making requests to the server will
  also block. To fix this, we fork() ypall and DNS lookups into subprocesses
  and let the parent ypserv process go on servicing other incoming
  requests.

  We place a cap on the number of simultaneous processes that ypserv can
  fork (set at 20 for now) and go back to 'linear mode' if it hits the
  limit (which just means it won't fork() anymore until the number of
  simultaneous processes drops under 20 again). The cap does not apply
  to fork()s done as a result of ypxfr calls, since we want to do our
  best to insure that map transfers from master servers succeed.

  To make this work, we need our own special copy of svc_run() so that
  we can properly terminate child processes once the RPC dispatch
  functions have run.

  (I have no idea what SunOS does in this situation. The only other
  possibility I can think of is async socket I/O, but that seems
  like a headache and a half to implement.)

- Do the politically correct thing and use sigaction() instead of
  signal() to install the SIGCHLD handler and to ignore SIGPIPEs.

- Doing a yp_all() is sometimes slow due to the way read_database() is
  implemented. This is turn is due to a certain deficiency in the DB
  hash method: the R_CURSOR flag doesn't work, which means that when
  handed a key and asked to return the key/data pair for the _next_
  key in the map, we have to reset the DB pointer to the start of the
  database, step through until we find the requested key, step one
  space ahead to the _next_ key, and then use that. (The original ypserv
  code used GDBM has a function called gdbm_nextkey() that does
  this for you.) This can get really slow for large maps. However,
  when doing a ypall, it seems that all database access are sequential,
  so we can forgo the first step (the 'search the database until we find
  the key') since the database should remain open and the cursor
  should be positioned at the right place until the yp_all() call
  finishes. We can't make this assumption for arbitrary yp_first()s
  and yp_next()s however (since we may have requests from several clients
  for different maps all arriving at different times) so those we have
  to handle the old way.

  (This would be much easier if R_CURSOR really worked. Maybe I should
   be using something other than the hash method.)
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.6 1995/02/15 04:33:52 wpaul Exp $
d13 1
a13 1
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
d16 1
a16 1
	install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@


1.6
log
@Fix losing Makefile so that it properly honors DESTDIR when installing
/var/yp/Makefile and /usr/libexec/mknetid. *grumble* *mutter* *mutter*
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.5 1995/02/04 21:31:58 wpaul Exp $
d5 1
a5 1
SRCS=	dnslookup.c yp_svc.c yp_xdr.c server.c
d8 1
a8 1
CFLAGS+=-DINSTDIR='"/usr/libexec"'
@


1.6.4.1
log
@Brought in changes from main branch.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.6 1995/02/15 04:33:52 wpaul Exp $
d5 1
a5 1
SRCS=	dnslookup.c svc_run.c yp_svc.c yp_xdr.c server.c
d8 1
a8 1
CFLAGS+=-DMAX_CHILDREN=20 -DINSTDIR='"/usr/libexec"'
@


1.6.4.2
log
@Bring in two small fixes from the head:

- Install Makefile.yp as /var/yp/Makefile.dist and only make a link
  to it from /var/yp/Makefile if /var/yp/Makefile doesn't already
  exist. This way we won't clobber an existing copy of /var/yp/Makefile
  which the user may have modified and wants to keep.

- Make the services.byname target generate proper map keys.

This will probably be my last commit to this branch unless the
freeze deadline changes for some reason.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.6.4.1 1995/08/25 11:18:34 davidg Exp $
d15 1
a15 4
		${DESTDIR}/var/yp/Makefile.dist
	@@if [ ! -f ${DESTDIR}/var/yp/Makefile.dist ]; then \
		ln -s   ${DESTDIR}/var/yp/Makefile.dist \
			${DESTDIR}/var/yp/Makefile; fi
@


1.6.4.3
log
@$Id$ -> $FreeBSD$
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.5
log
@Created manual page for ypserv and changed Makefile to install it.

Also tweaked server.c to support newer versions of tcpwrapper (log_tcp.h
is now tcpd.h and FROM_UNKNOWN changed to STRING_UNKNOWN).
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.4 1995/02/03 22:01:17 wpaul Exp $
d12 7
a18 8
afterinstall: /var/yp/Makefile /usr/libexec/mknetid

/var/yp/Makefile: ${.CURDIR}/Makefile.yp
        @@if [ ! -d /var/yp ]; then mkdir /var/yp; fi
	install -c -o bin -g bin -m 444 ${.CURDIR}/Makefile.yp /var/yp/Makefile

/usr/libexec/mknetid: ${.CURDIR}/mknetid
	install -c -o bin -g bin -m 555 ${.CURDIR}/mknetid /usr/libexec/mknetid
@


1.4
log
@Fixed potential Makefile glitch that could arise if /var/yp doesn't exist yet.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.3 1995/02/03 03:41:38 wpaul Exp $
d10 1
a10 1
MAN8=
@


1.3
log
@Put ${.CURDIR}s in front of Makefile.yp and mknetid in the required places.
Also took out uneeded BINDIR & BINMODE stuff.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.2 1995/02/01 01:59:57 wpaul Exp $
d15 1
@


1.2
log
@Added Makefile.yp and mknetid, which are needed to rebuild NIS maps.
mknetid is a script. Both are installed by an afterinstall which as
been added to the main Makefile.
@
text
@d1 1
a1 1
# $Id$
a9 3
BINOWN=	bin
BINMODE=555
BINDIR= /usr/sbin
d14 2
a15 2
/var/yp/Makefile: Makefile.yp
	install -c -o bin -g bin -m 444 Makefile.yp /var/yp/Makefile
d17 2
a18 2
/usr/libexec/mknetid: mknetid
	install -c -o bin -g bin -m 555 mknetid /usr/libexec/mknetid
@


1.1
log
@Obtained from: The NYS project
This is a hacked-up port of the ypserv-0.11 server from the NYS project
written by Peter Eriksson.

The original package included some map creating and dumping tools and
was based on GDBM. This version has been modified in the following
ways:

- GDBM replaced with DB and many weird hacks made to the read_database()
  function because of this.

- implimented the ypxfr service (using ypxfr from the yps-0.21 package,
  aso from the NYS project)

- added code to check the TCP port from which NIS requests originate:
  the server will refuse to serve the master.passwd.{byname|byuid} maps
  if the request doesn't come from a privileged port. Normally, only the
  superuser can issue such a request. Requests for the passwd.{bynam|byuid}
  maps aren't affected. There will be a small change made to getpwent.c
  in libc to complement this.

- added code to do DNS lookups via actual resolver queries instead of
  relying on gethostbyname() and friends. The author noted in the original
  documentation that a loop condition could arise where the server would
  query itself for hostsname lookups. Using direct DNS lookups prevents
  this from happening.

- added code to properly fork() the server into the background unless
  invoked with the -debug flag.

- Added combined syslog/perror function.

- fixed a few bugs (which were probably introduced by all the other
  changes)

- Created a bmake Makefile.

Note that this package can be linked against the tcp_wrapper package
to provide address-based authentication, but this isn't done by default
since the tcp_wrapper package isn't part of FreeBSD.
@
text
@d1 1
d12 4
d17 5
a21 1
MAN8=
@
