freebsd-src/lib
Bill Paul 456ebbf8f5 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.
1995-04-26 19:03:16 +00:00
..
csu/i386 Install the dlopen.3 manpage. 1995-03-30 06:40:31 +00:00
libc ypbind.c: Major overhaul. 1995-04-26 19:03:16 +00:00
libcom_err Don't call _doprnt, which doesn't exist; use vfprintf. 1995-01-23 22:53:12 +00:00
libcompat The implementation of rexec() missed the function ruserpass(), so the 1995-04-11 19:52:10 +00:00
libcrypt
libcurses Use __tty_fileno instead of STDERR_FILENO when detecting window size 1995-03-28 22:20:19 +00:00
libedit
libf2c
libF77
libforms Removed the y.tab.h file from the sources. It is automatically generated 1995-04-15 17:15:11 +00:00
libftp Fix a number of additional warnings. 1995-04-26 14:04:36 +00:00
libI77
libkvm Comment out declaration of kvm_uread until it can be fixed correctly. 1995-03-20 16:35:11 +00:00
libm
libmd Clean a bunch of -Wall warnings. 1995-02-24 08:51:34 +00:00
libmytinfo Remove duplicates: parm rindex & scroll right 1995-03-27 05:13:31 +00:00
libncurses Add a bit more docs 1995-04-20 21:36:15 +00:00
libpam/modules
libpcap Fix typo: pcap.h.h 1995-02-23 18:47:06 +00:00
libresolv
librpc
librpcsvc If we are going to set the OBJS target, don't add to the old target. This 1995-03-04 17:39:24 +00:00
libscsi Clean up handling of unspecified names. Clarify man page. 1995-01-26 23:48:41 +00:00
libskey Change strtok() to strsep(), strtok() usage is depricated 1995-03-24 17:27:22 +00:00
libss Remove private mkdir for /usr/include/ss, no handled by mtree. 1995-03-18 08:34:42 +00:00
libtelnet
libterm
libtermcap Continue of previous fix: eliminate backslashes too. 1995-03-26 00:47:02 +00:00
libutil Fix suspended vipw hangs 1995-03-09 21:53:12 +00:00
liby
msun Submitted by: J.T. Conklin <jtc@wimsey.com> 1995-04-07 23:23:27 +00:00
ncurses/ncurses Add a bit more docs 1995-04-20 21:36:15 +00:00
rpcsvc
Makefile Add libftp to list of targets. 1995-04-25 15:08:52 +00:00
Makefile.inc