From e9b8af16aa8d18a4f939310f422e0259a64022ca Mon Sep 17 00:00:00 2001 From: wpaul Date: Mon, 20 Jan 1997 03:33:36 +0000 Subject: 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 --- usr.sbin/ypserv/yp_dblookup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ypserv') 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) -- cgit v1.1