summaryrefslogtreecommitdiffstats
path: root/lib/libc/yp
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-09-02 04:16:21 +0000
committerwpaul <wpaul@FreeBSD.org>1995-09-02 04:16:21 +0000
commit0863217995c71be6cbd89180d178bdc0653dc6bb (patch)
tree86154d430e88d88d08d5d5fb33231fb92deef73e /lib/libc/yp
parent6e8a774b0bbbf0bee95cbe6a5e67124fd0a51292 (diff)
downloadFreeBSD-src-0863217995c71be6cbd89180d178bdc0653dc6bb.zip
FreeBSD-src-0863217995c71be6cbd89180d178bdc0653dc6bb.tar.gz
Clear up a minor bogosity in yp_match(): we have YPMATCHCACHE turned
on, which is fine, except that _yp_dobind() is called before we check the cache. The means we can return from the cache check (if we have a hit) without calling _yp_unbind(). We should do the cache check first and _then_ drop into the section that binds the server and does the yp_match query.
Diffstat (limited to 'lib/libc/yp')
-rw-r--r--lib/libc/yp/yplib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 5e5a655..3d9e2ca 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -28,7 +28,7 @@
*/
#ifndef LINT
-static char *rcsid = "$Id: yplib.c,v 1.10 1995/05/30 05:42:15 rgrimes Exp $";
+static char *rcsid = "$Id: yplib.c,v 1.11 1995/07/05 06:04:20 wpaul Exp $";
#endif
#include <sys/param.h>
@@ -423,10 +423,6 @@ int *outvallen;
indomain == NULL || !strlen(indomain))
return YPERR_BADARGS;
-again:
- if( _yp_dobind(indomain, &ysd) != 0)
- return YPERR_DOMAIN;
-
#ifdef YPMATCHCACHE
if( !strcmp(_yp_domain, indomain) && ypmatch_find(inmap, inkey,
inkeylen, &yprv.valdat.dptr, &yprv.valdat.dsize)) {
@@ -438,6 +434,10 @@ again:
}
#endif
+again:
+ if( _yp_dobind(indomain, &ysd) != 0)
+ return YPERR_DOMAIN;
+
tv.tv_sec = _yplib_timeout;
tv.tv_usec = 0;
OpenPOWER on IntegriCloud