History log of /freebsd-10.0-release/usr.bin/ypwhich/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

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

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

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


209342 19-Jun-2010 gavin

Variable 'getmap' is unused.

Found by: clang static analyzer


201386 02-Jan-2010 ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.


200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


194968 25-Jun-2009 brian

Support shadow.byname and shadow.byuid maps, protecting them by
insisting on privileged port access.

Include /var/yp/Makefile.local if it exists and suggest using
it to override /var/yp/Makefile behaviour.

Approved by: re (kib)
MFC after: 3 weeks


165579 28-Dec-2006 ru

Fix markup nit.


131491 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


127856 04-Apr-2004 charnier

Be consistant while reporting error conditions.


121551 26-Oct-2003 peter

Fix up warnings. There were some biggies here. There seems to be two
different sets of definitions in /usr/include/rpcsvc, mostly compatable,
but with different names. Will the real one please stand up?
In order to get prototypes for yp_maplist, we had to use the 'other'
naming system.


95124 20-Apr-2002 charnier

Use `The .Nm utility'


91377 27-Feb-2002 dwmalone

1) Remove blank line between include of sys/cdefs.h and __FBSDID
2) compare return value of inet_addr to INADDR_NONE rather than -1.


90416 08-Feb-2002 markm

Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3.


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


89362 14-Jan-2002 ru

yp(4) -> yp(8).

PR: docs/30797


87672 11-Dec-2001 markm

WARNS=2 fixes
__FBSDID() additions
some include file sorting.
Some Makefile sorting.

WARNS?=2 is not added to the Makefile, because it is going to be
default for usr.bin/
NO_WERROR is set because there are rpc*.h file issues.


70410 27-Dec-2000 ru

Prepare for mdoc(7)NG.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


36914 12-Jun-1998 peter

#include <arpa/inet.h>
Also, use real struct in_addr rather than u_long.


36649 04-Jun-1998 steve

Fix a bunch of spelling errors.

PR: 6856
Submitted by: Josh Gilliam <josh@quick.net>


34801 23-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.


29658 21-Sep-1997 wosch

Add ypwhich(1) and yppoll(8) manual pages.

Obtained from: NetBSD, slightly modified


28895 29-Aug-1997 charnier

Use err(3). Cosmetic in usage(). Delay the compute of defaultdomain (from
OpenBSD).
Obtained from: OpenBSD.


27345 12-Jul-1997 peter

Add an alias for master.passwd -> master.passwd.byname to the list
of convenience map aliases.


23012 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.


12862 15-Dec-1995 wpaul

More XDR routine cleanups. These three programs should be the only
ones that require this: the others call the yplib functions in libc.


9594 20-Jul-1995 wollman

Slightly better message for `ypwhich -x':

was: Use "foo" for "foo.bar"
now: "foo" is an alias for "foo.bar"


8874 30-May-1995 rgrimes

Remove trailing whitespace.


8091 26-Apr-1995 wpaul

ypbind.c: Major overhaul.

- Moved to a more client-driven model. We aggressively attempt to keep
the default domain bound (as before) but we give up on non-default
domains if we lose contact with a server and fail to get a response
after one round of broadcasting. This helps drastically reduce the
amount of network bandwitdh that ypbind consumes: if a client references
the secondary domain at some later point, this will prod ypbind into
establishing a new binding anyway, so continuously broadcasting without
need is pointless.

Note that we still actively seek out a binding for our default domain
even if no client program has queried us yet. I'm not exactly sure if
this matches SunOS's behavior or not, but I decided to do it this way
since we can get into all sorts of trouble if our default domain comes
unbound. Even so, we're still much quieter than we used to be.

- Removed a bunch of no-longer pertinent comments and a couple of
chunks of #ifdef 0'ed code that no longer fit in to the new layout.

- Theo deRaadt must have become frustrated with the callback mechanism
in clnt_broadcast(), because he shamelessly stole the clnt_broadcast()
code right out of the RPC library and hacked it up to suit his needs.
(Comments and all! :)

I can understand why: clnt_broadcast() blocks while awaiting replies.
Changing this behavior requires surgery. However, you can work around
this: fork the broadcast into a child process and relay the results
back to the parent via a pipe. (Careful obervation has shown that the
SunOS ypbind forks children for broadcasting too, though I can only
guess what sort of interprocess communication it uses. pipe() seems to
do the job well enough.)

This may seem like the long way around, but it's not really that
hard to implement, and I'd prefer to use documented RPC library functions
wherever possible. We're careful to limit the number of simultaneous
broadcasters to avoid swamping the system (the current limit is 5).
Each clnt_broadcast() call only sends out a small number of packets
at increasing intervals. We're also careful not to spawn more than one
bradcaster for a given domain.

- Used clntudp_bufcreate() and clnt_call() to implement a ping()
function for directly querying a particular server so that we can
check if it's still alive. This lets me completely remove the old
bradcasting code and use actual RPC library calls instead, at the
cost of more than a few handfulls of torn-out hair. (Make no mistake
folks: I *HATE* RPC.) Currently, the ping interval is one minute.

- Fixed another potential 'nfds too big for select()' bug: use
_rpc_dtablesize() instead of getdtablesize().

- Quieted gcc -Wall a bit.

- Probably a bunch of other stuff that I've forgotten.

ypbind.8:

- Updated man page to reflect modifications.

ypwhich.c:

- Small mind-o fix from last time: decode error results from
ypbind correctly (*groan*)

yplib.c:

- same as above

- Change behavior of _yp_dobind() a little: if we get back a 'Domain
not bound' error for a given domain, retry a few times before giving
up and passing the error back to the caller. We have to sleep for a
few seconds between tries since the 'Domain not bound' error comes
back immediately (by repeatedly looping, we end up pounding on ypbind).
We retry at most 20 times at 5 second intervals. This gives us a full
minute to get a response. This seems to deviate a bit from SunOS
behavior -- it appears to wait forever -- but I don't like the idea
of perpetually hanging inside a library call.

Note that this should fix the problems some people have with bindings
not being established fast enough at boot time; sometimes amd is started
in /etc/rc after ypbind has run but before it gets a binding set up. The
automounter gets annoyed at this and tends to exit. By pausing ther YP
calls until a binding is ready, we avoid this situation.

- Another _yp_dobind() change: if we determine that our binding files
are unlocked or nonexistent, jump directly to code that pokes ypbind
into restablishing the binding. Again, if it fails, we'll time out
eventually and return.


7990 22-Apr-1995 wpaul

Make Rod Grimes's life a little simpler: replace all exit(1)'s with
seperate exit values depending on the error. (The error values are
#defined and commented near the top of the file for clarity). This
is to help write a small bit of shell script for /etc/rc that calls
ypwhich a few times after ypbind is invoked to make sure we're
actually bound to a server before proceeding (if we aren't, the
automounter can fail if it's using NIS maps).


7982 21-Apr-1995 wpaul

small NIS binding fixes:

ypbind.c: if a client program asks ypbind for the name of the server
for a particular domain, and there isn't a binding for that domain
available yet, ypbind needs to supply a status value along with its
failure message. Set yprespbody.ypbind_error before returning from
a ypbindproc_domain request.

yplib.c: properly handle the error status messages ypbind now has the
ability to send us. Add a ypbinderr_string() function to decode the
error values.

ypwhich.c: handle ypbind errors correctly: yperr_string() can't handle
ypbind_status messages -- use ypbinderr_string instead.


1930 08-Aug-1994 wollman

Move more YP user programs over.