Correctly handle RRSIG records, converting numeric type codes into their textual equivalents

This commit is contained in:
2025-10-18 19:20:34 +02:00
parent 2586becfba
commit 090d719f0d

View File

@@ -143,7 +143,8 @@ def export_all_zones(trigger_path: str = "filesystem-change") -> list[Path]:
return written_files return written_files
def replace_type_codes(content): def validate_zone(zone_name, content) -> bool:
def replace_type_codes(content):
pattern = re.compile(r'(RRSIG\s+)(\d+)(\s+)') pattern = re.compile(r'(RRSIG\s+)(\d+)(\s+)')
def repl(match): def repl(match):
@@ -157,8 +158,6 @@ def replace_type_codes(content):
return pattern.sub(repl, content) return pattern.sub(repl, content)
def validate_zone(zone_name, content) -> bool:
try: try:
dns.zone.from_text(replace_type_codes(content), zone_name + '.', relativize=False) dns.zone.from_text(replace_type_codes(content), zone_name + '.', relativize=False)
logging.info(f"Zone {zone_name} parsed successfully") logging.info(f"Zone {zone_name} parsed successfully")