summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypserv/ypxfr/ypxfr.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c
index 33a83373ff8..7bf5665adef 100644
--- a/usr.sbin/ypserv/ypxfr/ypxfr.c
+++ b/usr.sbin/ypserv/ypxfr/ypxfr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypxfr.c,v 1.9 1996/10/01 01:53:08 deraadt Exp $ */
+/* $OpenBSD: ypxfr.c,v 1.10 1996/12/24 19:28:03 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.9 1996/10/01 01:53:08 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.10 1996/12/24 19:28:03 deraadt Exp $";
#endif
#include <stdio.h>
@@ -571,12 +571,19 @@ char *argv[];
}
if (status == YPPUSH_SUCC) {
+ int fd;
/* Create temporary db */
- mktemp(mapname);
- db = create_db(domain,map,mapname);
- if(db == NULL) {
+ fd = mkstemp(mapname);
+ if (fd == -1)
status = YPPUSH_DBM;
+ else
+ close(fd);
+
+ if (status > 0) {
+ db = create_db(domain,map,mapname);
+ if(db == NULL)
+ status = YPPUSH_DBM;
}
/* Add ORDER */