From 20b23bad3a2c9534d9423de52045125ac22d06e1 Mon Sep 17 00:00:00 2001 From: Mats O Jansson Date: Sat, 14 Feb 1998 10:05:28 +0000 Subject: Don't install a new map if yp_all failed. Noticed by Theo. -moj --- usr.sbin/ypserv/common/yplib_host.c | 5 ++--- usr.sbin/ypserv/ypxfr/ypxfr.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c index 40ad46ce540..7d7282a7d00 100644 --- a/usr.sbin/ypserv/common/yplib_host.c +++ b/usr.sbin/ypserv/common/yplib_host.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yplib_host.c,v 1.8 1998/01/12 20:45:19 maja Exp $ */ +/* $OpenBSD: yplib_host.c,v 1.9 1998/02/14 10:05:26 maja Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -32,7 +32,7 @@ */ #ifndef LINT -static char *rcsid = "$OpenBSD: yplib_host.c,v 1.8 1998/01/12 20:45:19 maja Exp $"; +static char *rcsid = "$OpenBSD: yplib_host.c,v 1.9 1998/02/14 10:05:26 maja Exp $"; #endif #include @@ -307,7 +307,6 @@ struct ypall_callback *incallback; (void) clnt_call(client, YPPROC_ALL, xdr_ypreq_nokey, &yprnk, xdr_ypresp_all_seq, &status, tv); - xdr_free(xdr_ypresp_all_seq, (char *)&status); /* not really needed... */ if(status != YP_FALSE) return ypprot_err(status); diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c index a5b79602cea..11b6f6205e2 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.c +++ b/usr.sbin/ypserv/ypxfr/ypxfr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypxfr.c,v 1.23 1998/01/08 22:36:49 maja Exp $ */ +/* $OpenBSD: ypxfr.c,v 1.24 1998/02/14 10:05:27 maja Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.23 1998/01/08 22:36:49 maja Exp $"; +static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.24 1998/02/14 10:05:27 maja Exp $"; #endif #include @@ -183,15 +183,23 @@ u_int32_t *rordernum; return status; } -void +int get_map(client,domain,map,incallback) CLIENT *client; char *domain; char *map; struct ypall_callback *incallback; { - (void)yp_all_host(client, domain, map, incallback); - + int status; + + status = yp_all_host(client, domain, map, incallback); + if ((status == 0) || (status == YPERR_NOMORE)) { + status = YPPUSH_SUCC; + } else { + status = YPPUSH_YPERR; + } + + return(status); } DBM * @@ -596,7 +604,7 @@ char *argv[]; if(status > 0) { callback.foreach=ypxfr_foreach; - get_map(client,domain,map,&callback); + status = get_map(client,domain,map,&callback); } /* Close db */ -- cgit v1.2.3