]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
make sure we open tmp file with O_CREAT!
authorbert hubert <bert.hubert@netherlabs.nl>
Sun, 10 Dec 2017 18:50:21 +0000 (19:50 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Sun, 10 Dec 2017 18:50:21 +0000 (19:50 +0100)
pdns/pdnsutil.cc

index 05d5dee904bf389a35f9445eb10e348afb8aa2c5..c9a15ff56113f02d88ca3287d0725a38eeefd5c4 100644 (file)
@@ -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)