From: bert hubert Date: Fri, 29 Jan 2016 12:29:44 +0000 (+0100) Subject: rectify-zone if required in edit-zone, clarify message about absolute paths, clarify... X-Git-Tag: dnsdist-1.0.0-alpha2~24^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21dd5918a92ad373bf6e1778439b348da82b5984;p=pdns rectify-zone if required in edit-zone, clarify message about absolute paths, clarify error if editor not found --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index f6b2071eb..a3c1ec66d 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -961,7 +961,7 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { { if(tmpfd < 0 && (tmpfd=open(tmpnam, O_WRONLY, 0600)) < 0) unixDie("Error reopening temporary file "+string(tmpnam)); - string header("; Warning - all zone names in this file are ABSOLUTE!\n$ORIGIN .\n"); + string header("; Warning - every name in this file is ABSOLUTE!\n$ORIGIN .\n"); if(write(tmpfd, header.c_str(), header.length()) < 0) unixDie("Writing zone to temporary file"); while(di.backend->get(rr)) { @@ -983,8 +983,9 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { if(gotoline > 0) cmdline+="+"+std::to_string(gotoline)+" "; cmdline += tmpnam; - if(system(cmdline.c_str()) < 0) { - unixDie("Editing file with: "+cmdline); + int err=system(cmdline.c_str()); + if(err) { + unixDie("Editing file with: '"+cmdline+"', perhaps set EDITOR variable"); } cmdline.clear(); stat(tmpnam,&statafter); @@ -1071,6 +1072,9 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { } di.backend->replaceRRSet(di.id, c.first, QType(c.second), vrr); } + if(dk.isSecuredZone(zone)) { + rectifyZone(dk, zone); + } return 0; }