summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgene <gene@openbsd.org>1997-03-15 00:08:58 +0000
committergene <gene@openbsd.org>1997-03-15 00:08:58 +0000
commitcb5c1760242fe6dbf67ec0b494e3f09eb0354692 (patch)
tree8e3cd8d46de298adfdcf83beebae1e4c4beb31dc
parentAdd missing line, doh! (diff)
downloadwireguard-openbsd-cb5c1760242fe6dbf67ec0b494e3f09eb0354692.tar.xz
wireguard-openbsd-cb5c1760242fe6dbf67ec0b494e3f09eb0354692.zip
Fix so yppush will err out if it can't find the ypservers map. This whole
code wants lots of attention, but at least it won't dump core on a virgin installation now.
-rw-r--r--usr.sbin/ypserv/yppush/yppush.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ypserv/yppush/yppush.c b/usr.sbin/ypserv/yppush/yppush.c
index c17db8448d2..a4e774e4692 100644
--- a/usr.sbin/ypserv/yppush/yppush.c
+++ b/usr.sbin/ypserv/yppush/yppush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush.c,v 1.5 1996/12/14 22:10:27 maja Exp $ */
+/* $OpenBSD: yppush.c,v 1.6 1997/03/15 00:08:58 gene Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: yppush.c,v 1.5 1996/12/14 22:10:27 maja Exp $";
+static char rcsid[] = "$OpenBSD: yppush.c,v 1.6 1997/03/15 00:08:58 gene Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -281,6 +281,7 @@ char **argv;
exit(1);
}
+
/* Check map */
snprintf(map_path,sizeof map_path,"%s/%s/%s%s",
YP_DB_PATH,domain,Map,YPDB_SUFFIX);
@@ -324,7 +325,11 @@ char **argv;
yp_bind(Domain);
- r = yp_master(Domain, ypmap, &master);
+ r = yp_master(Domain, ypmap, &master);
+ if (r != 0) {
+ fprintf(stderr, "yppush: could not get ypservers map\n");
+ exit(1);
+ }
if (hostname != NULL) {
push(strlen(hostname), hostname);