]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Let ZoneParserTNG keep a list of all visited files (such as includes).
authorMiod Vallat <miod.vallat@powerdns.com>
Mon, 25 Aug 2025 10:13:11 +0000 (12:13 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Mon, 25 Aug 2025 10:13:11 +0000 (12:13 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/zoneparser-tng.cc
pdns/zoneparser-tng.hh

index e004e3f21146ac64af35a634ba7e0320e7088e13..bfdda3ce02f53851083552de36ebad892d0a0e8c 100644 (file)
@@ -90,6 +90,7 @@ void ZoneParserTNG::stackFile(const std::string& fname)
   filestate fs(fp, fname);
   d_filestates.push(fs);
   d_fromfile = true;
+  d_fileset.emplace_back(std::make_pair(fname, st.st_ctime));
 }
 
 ZoneParserTNG::~ZoneParserTNG()
index 595f7d1545de742cc8755c3a824ece74f2ebc585..174643760570c77e751ee898bff7e9a057a6eb99 100644 (file)
@@ -58,6 +58,7 @@ public:
     d_defaultttl = ttl;
     d_havespecificttl = true;
   }
+  std::vector<std::pair<std::string, time_t>> getFileset() const { return d_fileset; }
 private:
   bool getLine();
   bool getTemplateLine();
@@ -91,4 +92,5 @@ private:
   bool d_generateEnabled{true};
   bool d_upgradeContent;
   bool d_templateCounterWrapped{false};
+  std::vector<std::pair<std::string, time_t>> d_fileset;
 };