From: bert hubert Date: Sun, 10 Dec 2017 18:50:21 +0000 (+0100) Subject: make sure we open tmp file with O_CREAT! X-Git-Tag: dnsdist-1.3.1~136^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=896c251ef97d8b5d8973b94da213581df6efdc1f;p=thirdparty%2Fpdns.git make sure we open tmp file with O_CREAT! --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 05d5dee904..c9a15ff561 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -838,7 +838,7 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { di.backend->list(zone, di.id); pre.clear(); post.clear(); { - if(tmpfd < 0 && (tmpfd=open(tmpnam, O_WRONLY | O_TRUNC, 0600)) < 0) + if(tmpfd < 0 && (tmpfd=open(tmpnam, O_CREAT | O_WRONLY | O_TRUNC, 0600)) < 0) unixDie("Error reopening temporary file "+string(tmpnam)); string header("; Warning - every name in this file is ABSOLUTE!\n$ORIGIN .\n"); if(write(tmpfd, header.c_str(), header.length()) < 0)