freebsd-skq/lib
wpaul 469d167428 Make _yp_dobind() a litle smarter:
Now that we preserve RPC handles instead of rebuilding them each time
a ypcln function is called, we have to be careful about keeping our sockets
in a sane state. It's possible that the caller may call a ypclnt
function, and then decide to close all its file descriptors. This would
also close the socket descriptor held by the yplib code. Worse, it
could re-open the same descriptor number for its own use. If it then calls
another ypclnt function, the subsequent RPC will fail because the socket
will either be gone or replaced with Something Completely Different. The
yplib code will recover by rebinding, but it doing so it may wreck the
descriptor which now belongs to the caller.

To fix this, _yp_dobind() needs to label the descriptor somehow so
that it can test it later to make sure it hasn't been altered between
ypclnt calls. It does this by binding the socket, thus associating a port
number with it. It then saves this port number in the dom_local_port member
of the dom_binding structure for the given domain. When _yp_dobind() is
called again (which it is at the start of each ypclnt function), it checks
to see if the domain is already bound, and if it is, it does a getsockname()
on the socket and compares the port number to the one it saved. If the
getsockname() fails, or the port number doesn't match, it abandons the
socket and sets up a new client handle.

This still incurs some syscall overhead, which is what I was trying to
avoid, but it's still not as bad as before.
1996-06-01 05:08:31 +00:00
..
csu/i386 `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libc Make _yp_dobind() a litle smarter: 1996-06-01 05:08:31 +00:00
libc_r `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libcom_err Change install' to ${INSTALL}' so that default install flags can be 1995-08-06 12:24:38 +00:00
libcompat remove MLINKS regcomp.3 regexec.3 regerror.3 due name clash with libc 1996-05-27 22:52:24 +00:00
libcrypt Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libcurses Change install' to ${INSTALL}' so that default install flags can be 1995-08-06 12:24:38 +00:00
libdisk `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libedit recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
libf2c Update to the 1995/09/20 version. Previous version was 1993/12/17. 1995-09-28 20:49:15 +00:00
libF77 This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
libfakegnumalloc Some fixes: 1996-02-12 12:40:04 +00:00
libforms yacc rule change. 1996-05-30 22:54:10 +00:00
libgnumalloc Some fixes: 1996-02-12 12:40:04 +00:00
libI77 Update to the 1995/09/20 version. Previous version was 1993/12/17. 1995-09-28 20:49:15 +00:00
libipx Do not install the now unsupported netns and netiso 1996-04-08 05:15:09 +00:00
libkse `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libkvm NBPG -> PAGE_SIZE 1996-05-02 09:23:36 +00:00
libm `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libmd Correct two errors in the manual page. 1996-05-28 18:57:31 +00:00
libmytinfo This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
libncurses remove MLINKS tparm.3 due name clash with libtermcap 1996-05-27 22:58:29 +00:00
libpam/modules #include <kerberosIV/des.h> -> #include <des.h> 1996-02-11 09:18:18 +00:00
libpcap yacc rule change. 1996-05-30 23:01:04 +00:00
libpthread `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libresolv BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
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 Add a couple more man page links and some minor formatting fixes. 1996-02-09 02:49:14 +00:00
libskey /etc/skeykeys was basically suffering from the same vulnerability 1996-04-26 21:33:18 +00:00
libss `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
libtelnet recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
libtermcap Another round of man page cleanups. 1996-02-12 04:57:03 +00:00
libutil If the two recently added sysctl variables exist, use those rather than 1996-02-24 14:37:30 +00:00
libxpg4 Add more stuff moved out from XPG3 1995-11-03 09:03:00 +00:00
liby BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
msun Don't trash %ebp. 1996-02-25 20:29:46 +00:00
ncurses/ncurses remove MLINKS tparm.3 due name clash with libtermcap 1996-05-27 22:58:29 +00:00
Makefile Add libdisk. 1996-03-18 18:59:08 +00:00
Makefile.inc From 1.1.5: define default shared library versions. For 2.0, use version 1994-08-04 22:44:00 +00:00