diff options
author | gene <gene@cvs.openbsd.org> | 1997-03-15 00:08:59 +0000 |
---|---|---|
committer | gene <gene@cvs.openbsd.org> | 1997-03-15 00:08:59 +0000 |
commit | 7f37b5549958b33ca270a041e4624e6e79dd1722 (patch) | |
tree | 5f5942db54efa5c855b73983a123718d766f29dc /usr.sbin/ypserv | |
parent | 0803b95aa06ffc7f32b696f65d8d5bf628eb9169 (diff) |
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.
Diffstat (limited to 'usr.sbin/ypserv')
-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); |