summaryrefslogtreecommitdiffstats
path: root/lib/libc/yp
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1996-03-19 19:27:03 +0000
committerwpaul <wpaul@FreeBSD.org>1996-03-19 19:27:03 +0000
commit11fb5722e2f671a26c53af2c2c4ddf4dbf12be4b (patch)
treecd59ad0e690643c8b6023b96daa9498d50f76123 /lib/libc/yp
parentc3a3da90acb3b15f258282d3528051435b1b817d (diff)
downloadFreeBSD-src-11fb5722e2f671a26c53af2c2c4ddf4dbf12be4b.zip
FreeBSD-src-11fb5722e2f671a26c53af2c2c4ddf4dbf12be4b.tar.gz
Fix yp_all() so that it doesn't bogusly return YP_NOMORE at the end
of a successful map retrieval. (This has to do with a previous change to xdr_ypresp_all_seq() and ypxfr_get_map(); originally, yp_all() would look for a return value of YP_FALSE to signal success, but now it should be looking for YP_NOMORE. It should not be passing YP_NOMORE back up to the caller though.) Noticed by: <aagero@aage.priv.no> There is also another small bug here, which is that the call to xdr_free() that happens immediately after the clnt_call() in yp_all() clobbers the return status value. I've worked around this for now, but I think the xdr_free() is actually bogus and should be removed. I want to check some more before I do that though.
Diffstat (limited to 'lib/libc/yp')
-rw-r--r--lib/libc/yp/yplib.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 9614fb0..1043fe2 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.13 1995/11/05 05:39:04 wpaul Exp $";
+static char *rcsid = "$Id: yplib.c,v 1.15 1995/12/15 03:26:40 wpaul Exp $";
#endif
#include <sys/param.h>
@@ -649,7 +649,7 @@ struct ypall_callback *incallback;
struct timeval tv;
struct sockaddr_in clnt_sin;
CLIENT *clnt;
- u_long status;
+ u_long status, savstat;
int clnt_sock;
/* Sanity check */
@@ -680,11 +680,12 @@ struct ypall_callback *incallback;
(void) clnt_call(clnt, YPPROC_ALL,
xdr_ypreq_nokey, &yprnk, xdr_ypresp_all_seq, &status, tv);
clnt_destroy(clnt);
+ savstat = status;
xdr_free(xdr_ypresp_all_seq, (char *)&status); /* not really needed... */
_yp_unbind(ysd);
- if(status != YP_FALSE)
- return ypprot_err(status);
+ if(savstat != YP_NOMORE)
+ return ypprot_err(savstat);
return 0;
}
OpenPOWER on IntegriCloud