diff options
author | wpaul <wpaul@FreeBSD.org> | 1997-01-20 03:33:36 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1997-01-20 03:33:36 +0000 |
commit | e9b8af16aa8d18a4f939310f422e0259a64022ca (patch) | |
tree | 523f519337a8fa1dc3be11d9a05cf732b0a90a6c /usr.sbin/ypserv/yp_dblookup.c | |
parent | 7a84712547097d3eb58cabf774f32d43d29aa4d0 (diff) | |
download | FreeBSD-src-e9b8af16aa8d18a4f939310f422e0259a64022ca.zip FreeBSD-src-e9b8af16aa8d18a4f939310f422e0259a64022ca.tar.gz |
Fix bug that slipped through last big round of changes: sometimes
yp_next_record() is called without a key (from xdr_my_ypresp_all()),
in which case it returns the first key in the map. When doing this,
it also needs to update the key index in the map queue entry. Without
this, ypproc_all_2_svc() (and hence ypcat) don't work correctly.
Noticed by: Michael L. Hench <hench@watt.cae.uwm.edu>
Diffstat (limited to 'usr.sbin/ypserv/yp_dblookup.c')
-rw-r--r-- | usr.sbin/ypserv/yp_dblookup.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ypserv/yp_dblookup.c b/usr.sbin/ypserv/yp_dblookup.c index 6484a16..5839bd4 100644 --- a/usr.sbin/ypserv/yp_dblookup.c +++ b/usr.sbin/ypserv/yp_dblookup.c @@ -600,8 +600,13 @@ int yp_next_record(dbp,key,data,all,allow) rval = yp_first_record(dbp,key,data,allow); if (rval == YP_NOKEY) return(YP_NOMORE); - else + else { +#ifdef DB_CACHE + qhead.cqh_first->dbptr->key = key->data; + qhead.cqh_first->dbptr->size = key->size; +#endif return(rval); + } } if (ypdb_debug) |