Changeset 893 for trunk


Ignore:
Timestamp:
06/25/25 18:45:14 (6 days ago)
Author:
Kris Deugau
Message:

/trunk

Copy sub in from tiny-import.pl to convert octal escapes to normal
characters, so ExportBIND.pm can use it on stray TXT records. Exported
as-is these work fine in tinyDNS, but get weirdly unescaped when fed to
BIND et al (assuming they don't just reject the zone outright).

Should arguably remove the copy in tiny-import.pl and reference it from
DNSDB.pm

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r892 r893  
    21592159  return 1;
    21602160} # _check_hostname_form()
     2161
     2162# Reverse a lurking tinydns-centric octal substitution
     2163sub _deoctal {
     2164  my $targ = shift;
     2165  while ($$targ =~ /\\(\d{3})/) {
     2166    my $sub = chr(oct($1));
     2167    $$targ =~ s/\\$1/$sub/g;
     2168  }
     2169} # _deoctal()
    21612170
    21622171
  • trunk/DNSDB/ExportBIND.pm

    r891 r893  
    579579#    ($host,$val) = __revswap($host,$val) if $revrec eq 'y';
    580580#    print {$zonefiles->{$loc}} "$host  $ttl    IN      TXT     \"$val\"\n" or die $!;
     581    # Clean up some lingering tinydns/VegaDNSisms
     582    DNSDB::_deoctal(\$val);
    581583    my $recdata = "$host.       $ttl    IN      TXT     \"$val\"\n";
    582584    __recprint($zonefiles, $loclist, $loc, $recdata);
Note: See TracChangeset for help on using the changeset viewer.