diff options
author | 1997-03-15 00:08:58 +0000 | |
---|---|---|
committer | 1997-03-15 00:08:58 +0000 | |
commit | cb5c1760242fe6dbf67ec0b494e3f09eb0354692 (patch) | |
tree | 8e3cd8d46de298adfdcf83beebae1e4c4beb31dc | |
parent | Add missing line, doh! (diff) | |
download | wireguard-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.c | 11 |
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); |