]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Support serving signed child zone from its parent's nameserver
authorNicki Křížek <nicki@isc.org>
Thu, 2 Jul 2026 14:00:55 +0000 (16:00 +0200)
committerNicki Křížek <nicki@isc.org>
Thu, 2 Jul 2026 14:00:55 +0000 (16:00 +0200)
When a signed zone is served by the same nameserver instance as
its parent, the child's dnssec-signzone has already written
dsset-<child>. into that directory. Don't attempt to copy the dsset if
the destination and source files are the same.

Assisted-by: Claude:claude-opus-4-8
bin/tests/system/isctest/zone.py

index 359d0f270743654fbea7c1527c8f492b2c4612fc..7790fa87f899ca267bb470cbca92fe0deaae51a0 100644 (file)
@@ -222,7 +222,11 @@ class FileZoneKey(ZoneKey):
         """
         assert self.zone is not None, "write_dsset requires a zone-attached key"
         src = Path(self.zone.ns.name) / f"dsset-{self.zone.name}."
-        shutil.copy(src, Path(target_dir))
+        dst = Path(target_dir) / src.name
+        if src.resolve() == dst.resolve():
+            debug(f"{self.zone.name}: dsset already in {target_dir}")
+            return
+        shutil.copy(src, dst)
         debug(f"{self.zone.name}: dsset copied to {target_dir}")
 
     @staticmethod