History log of /freebsd-current/libexec/ypxfr/ypxfr_main.c
Revision Date Author Comments
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 3a166b33 06-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

yp*: fix -fno-common build

This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days


# df57947f 18-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133


# 033af09d 27-Jul-2015 Marcelo Araujo <araujo@FreeBSD.org>

Staticfy and constify some variables and clean up the code a bit to make it
more readable. No functional change.

Differential Revision: D3166
Reviewed by: kib
Sponsored by: gandi.net


# 89482baa 31-May-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

ypxfr(8): Use the correct enum member for checking yp_errno.

Found-by: gcc47

Submitted by: Sascha Wildner <swildner@dragonflybsd.org>
Obtained from: DragonFlyBSD (commit d0b3a17c3c6)


# 3eb9425c 16-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to
convert the incompatible enums, as the numerical values are the same
(either by accident, design, or the phase of the moon at that time).

MFC after: 1 week


# db83a391 16-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Revert r228592, as the non-messy way of fixing ypxfr breaks other yp
programs (e.g. usr.sbin/rpc.yppasswdd).

Spotted by: np
MFC after: 1 week


# 8f553bfb 16-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Attempt to fix the numerous incompatible enum conversions in
libexec/ypxfr in the least disruptive way.

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# b08f8f39 17-Oct-2004 Stefan Farfeleder <stefanf@FreeBSD.org>

Remove definition of struct dom_binding, it's non-standard C code and
unnecessary since src/include/rpcsvc/ypclnt.h's revision 1.10.


# d988f6de 25-Oct-2003 Peter Wemm <peter@FreeBSD.org>

Tidy up some xdrproc_t related warnings.


# 22e9bc15 03-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID vs. rcsid[].


# 425dd8ac 06-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix warnings.

Sponsored by: DARPA, NAI Labs


# dc584ddb 06-Feb-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

ANSIfy and remove some dead code.

Sponsored by: DARPA, NAI Labs


# ed4d1c46 06-Feb-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

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


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# f9d553ad 10-May-1999 Bill Paul <wpaul@FreeBSD.org>

Fix ypxfr so that it can be run from cron.

Patch submitted by: Dan Nelson <dnelson@emsphone.com>


# bb6ae0a4 02-Aug-1998 Bruce Evans <bde@FreeBSD.org>

Fixed printf format errors.


# 27eed7e3 08-Dec-1997 Philippe Charnier <charnier@FreeBSD.org>

Use full path in synopsis. Sort #includes. Use .Tn for NIS.


# 23677e98 30-Sep-1997 Bill Paul <wpaul@FreeBSD.org>

Putting records with zero-length keys into a Berkeley DB hash database
is asking for trouble (sequential database enumerations can get caught
in an infinite loop). The yp_mkdb(8) utility avoids putting such records
into a database, but ypxfr does not. Today I got bit by a NULL entry in
one of the amd maps on my network, which is served by a SunOS master.
The map was transfered successfully to my FreeBSD slave, but attempting
to dump it with ypcat(1) caused ypserv(8) to transmit the same record
over and over again, making the map appear to be infinitely large. I
finally noticed the problem while testing a new version of amd under
development at the Columbia CS department, which began gobbling up insane
amounts of memory while trying to swallow the map.

To deal with this problem, I'm modifying ypxfr to watch for records
with zero-length keys and turn them into something less destructive
before writing them to the database.


# 91477cc4 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

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


# 9e522f7a 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# 81a82d4d 25-Oct-1996 Bill Paul <wpaul@FreeBSD.org>

Give ypxfr the ability to detect the presence of the YP_INTERDOMAIN
and YP_SECURE flags so that it can properly add them to newly created
maps when needed. This applies only when using the 'standard' method
for map transfers. When using rpc.ypxfrd, the whole map is copied
verbatim, along with any special entries that may be encoded in it.

Also made -Wall a little quieter for ypxfrd_getmap.c.


# 2c33b20a 20-Oct-1996 Bill Paul <wpaul@FreeBSD.org>

Add a couple of reserved port checks: don't talk to either ypserv
or rpc.ypxfrd processes on remote systems that aren't bound to reserved
ports. The servers already do reserved port checks on the clients.

Obtained from: scrutinizing the OpenBSD ypxfr sources. (Note that this
applies to the ypserv check only; OpenBSD doesn't have an rpc.ypxfrd.)


# 16deb43a 04-Jun-1996 Bill Paul <wpaul@FreeBSD.org>

Add support for rpc.ypxfrd and document it in the man page.

Also generallize the yp_dbwrite functions a little: allow the caller
to specify certain flags. I need this mostly for some changes to
rpc.yppasswdd to allow in-place updates.

Also change Makefile a little to use the same format as ypserv.


# 34a042e8 10-Jan-1996 Bill Paul <wpaul@FreeBSD.org>

- Fix error reporting when checking order number via NIS: we return zero
on a failure, but if we're checking a corrupt map we could also get back
a zero from ypserv without really encountering any actual error. Flag this
condition and generate an meaningful error message.

- Fix transmission of ypxfr_clear to ypserv: error checking was wrong
and we sending YPXFR_YPERR as an error status instead of YPXFR_CLEAR.

- To help avoid a race condition (or at least reduce the likelyhood of
it occuring), use rename() to move a newly transfered map into place
instead of unlink()ing the old one first and then renaming. Da man page
sez that rename should do the unlink() for us. This prevents ypserv
from returning 'no such map in domain' when asked to query a map which
ypxfr has just unlink()ed but not yet replaced.


# d6cab902 06-Jan-1996 Bill Paul <wpaul@FreeBSD.org>

Sync with my sources at home (these are really tiny changes):

- Fix a SEGV condition in ypxfr_main.c that reared its ugly head while I
was working on the 'parallel jobs' feature of the new yppush. After we've
completed the map transfer and created a local temporary copy, we check
the order number of the map on ypserv again to make sure it didn't change
while the transfer was in progress (map skew). If for some reason we flat
out fail to get the order number from the server, we flag this as an
error and bail, telling ypxfr_exit() to clean up our temporary files
for us. However, ypxfr_exit() tries to close the database before unkining
it, not realizing that it has already been closed prior to the skew check.
The second attempt to close the database causes a SEGV somewhere inside
the DB code.

(Well, it does on my 2.0.5 machine anyway. I haven't seen anyone modify
the DB library code in ages, so the condition is probably still there.)

To work around this, we deliberately set dbp to NULL after closing the
database and check for the condition in ypxfr_exit(), being careful to
avoid the second close if we see the NULL.

- In yp_dbwrite.c, make yp_open_db_rw() open the database with O_EXLOCK
flag set. This probably won't affect much of anything, but I feel better
having it there.


# 665823d0 24-Dec-1995 Bill Paul <wpaul@FreeBSD.org>

Import the new ypxfr, written by yours truly. Functionally equivalent
to the old one, except that it supports an additional option (-p path)
that lets you specify the top level path wiere your NIS maps live.
(ypserv allows you to specify a path like this, so it makes sense that
ypxfr should too. ypserv will automagically pass the -p flag to ypxfr
if you use a path other than /var/yp when you start it.)

This program uses client stub code generated by rpcgen as well as
the yp_dblookup.c module from ypserv.