History log of /freebsd-9.3-release/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 129654 24-May-2004 stefanf

Include <rpc/rpc_com.h> for a _rpc_dtablesize() prototype.

Approved by: das (mentor)


# 114601 03-May-2003 obrien

Use __FBSDID over rcsid[]. Protect copyright[] where needed.


# 90298 06-Feb-2002 des

ANSIfy and remove some dead code.

Sponsored by: DARPA, NAI Labs


# 90297 06-Feb-2002 des

Apply the following mechanical transformations in preparation for
ansification and constification:

s{\s+__P\((\(.*?\))\)}{$1}g;
s{\(\s+}{\(}g;
s{\s+\)}{\)}g;
s{\s+,}{,}g;
s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g;
s{return ([^\(].*?);}{return ($1);}g;
s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g;
s{\s+$}{\n};g

Also add $FreeBSD$ where needed.

MFC after: 1 week


# 69793 09-Dec-2000 obrien

Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.


# 62989 11-Jul-2000 kris

Don't call syslog() without a format string.


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 36642 04-Jun-1998 wpaul

Darnit, that last commit was only supposed to change files in the
-current branch. I mistakenly checked out the 2.2.x rpc.ypxfrd into my
-current working directory. No harm done, but I got really confused
when I went to check out rpc.ypxfrd again and found the changes I
wanted to make were already there. (I'm going to fix the other 2.2.x
versions of the other programs in a minute.)

Anyway: protect errno in the signal handler, in the -current version
of rpc.ypxfrd this time.


# 30378 13-Oct-1997 charnier

Use err(3). Remove multiply defined Id string.


# 24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 23716 11-Mar-1997 peter

Update to work under Lite2 includes


# 22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 16126 05-Jun-1996 wpaul

This commit was generated by cvs2svn to compensate for changes in r16125,
which included commits to RCS files with non-trunk default branches.


# 16125 05-Jun-1996 wpaul

Import rpc.ypxfrd.

This server impliments an RPC-based file transfer protocol that allows
an NIS slave server to copy a raw map database file from an NIS master.

The goal here is to speed up the transfer of very large maps. If you
have, for example, an NIS password database with 30,000 records in it,
it can take around 8 to 10 minutes to regenerate it (four hash databases
are created). As it stands now, ypxfr(8) transfers a map by sucking all
the records from ypserv(8) on the master using yp_all() and writing them
to a new database using the db(3) library. This adds up to another 8 to 10
minutes, per slave. With as the number of slaves increases, this latency
becomes prohibitive.

With rpc.ypxfrd, all the slave has to do is copy the already-built
hash database file from the master and move it into place. Even with a
multi-megabyte file, this reduces the master to slave transfer time
to well under a minute. (This is using TCP.)

Access restrictions are applied using the same mechanism as in ypserv:
you can control access using /var/yp/securenets, and the server will
not transmit the master.passwd.* maps unless the transfer request originates
on a reserved port.

Note: this server is based on my hastily contrived protocol and is _NOT_
compatible with Sun's protocol of the same name. It can't be compatible
for a couple of reasons. For one thing, Sun's protocol has not been published
anywhere that I know of. It is not included in any of the SunRPC source
distributions that I've been able to find. Second, Sun's NIS v2 code
uses old style ndbm maps while FreeBSD uses Berkeley DB. The file formats
are incompatible, so being able to transfer maps between FreeBSD and SunOS
hosts wouldn't do any good anyway. (You could always port the FreeBSD NIS
code to SunOS if you really wanted to do it. :)

(There's also the little fact that SunOS/SPARC is big-endian and FreeBSD/i386
is little-endian. Berkeley DB can handle byte ordering differences; ndbm
probably can't.)