freebsd-dev/usr.sbin/ypserv
wpaul 8229fd43bf Fix a bug in the database handle caching. This has to do with the way the
underlying database code works. When dealing with first/next queries, you
have the notion of a database 'cursor,' which is essentially a file pointer
for the database. To select the first entry, you do a fetch with the
R_FIRST flag set, then you can use the R_NEXT flag to enumerate the other
entries in the database. Unfortunately, doing a direct fetch with no flag
does _not_ set the 'cursor,' so you can't do a direct fetch and then
enumerate the table from there.

The bug is that cached handles generated as the result of a YPPROC_MATCH
were being treated as though they were the same as handles generated by
a YPPROC_FIRST, which is not the case. The manifestation is that if you
do a 'ypmatch first-key-in-map map' followed by a yp_first()/yp_next()
pair, the yp_first() and yp_next() both return the first key in the
table, which makes the entry appear to be duplicated.

A couple smaller things since I'm here:

- yp_main.c and yp_error.c both have a global 'int debug' in them.
  For some reason, our cc/ld doesn't flag this as a multiply defined
  symbol even though it should. Removed the declaration from yp_main.c;
  we want the one in yp_error.c.

- The Makefile wasn't installing ypinit in the right place.
1998-02-11 19:15:32 +00:00
..
Makefile Fix a bug in the database handle caching. This has to do with the way the 1998-02-11 19:15:32 +00:00
Makefile.yp Fix Makefile.yp so that it no longer creates a temporary file called 1998-02-04 16:16:58 +00:00
yp_access.c Typos in man page. Cosmetics in error strings. 1997-10-29 07:25:05 +00:00
yp_dblookup.c Fix a bug in the database handle caching. This has to do with the way the 1998-02-11 19:15:32 +00:00
yp_dnslookup.c Typos in man page. Cosmetics in error strings. 1997-10-29 07:25:05 +00:00
yp_error.c Typos in man page. Cosmetics in error strings. 1997-10-29 07:25:05 +00:00
yp_extern.h Typos in man page. Cosmetics in error strings. 1997-10-29 07:25:05 +00:00
yp_main.c Fix a bug in the database handle caching. This has to do with the way the 1998-02-11 19:15:32 +00:00
yp_server.c Fix a bug in the database handle caching. This has to do with the way the 1998-02-11 19:15:32 +00:00
yp_svc_udp.c Typos in man page. Cosmetics in error strings. 1997-10-29 07:25:05 +00:00
ypinit.8 Some touchups courtesy of Philippe Charnier. 1997-11-16 03:49:12 +00:00
ypinit.sh Some touchups courtesy of Philippe Charnier. 1997-11-16 03:49:12 +00:00
ypserv.8 Fix typo: 129.168.128.0 -> 192.168.128.0 1997-11-01 15:55:09 +00:00