Changeset 803


Ignore:
Timestamp:
11/06/20 10:59:29 (4 years ago)
Author:
Kris Deugau
Message:

/trunk

Commit 5th archived iteration of bind2hosts in development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bind2hosts

    r802 r803  
    145145  my $curatom = 'class';
    146146##fixme:  maybe wrap this in an eval() instead of the warn/badrec/last bits?
     147eval {
    147148  for (; $nc < 3; $nc++) {
    148149    my ($atom) = ($rec =~ /^([\w\d.]+)\s/);
     
    153154#print "a$nc: d: atom [$atom]\n $rec\n" if $i == $debugid;
    154155      if (defined($ttl)) {
    155         warn "bad record ($origrec)\n";
    156         $badrec = 1;
    157         last;
     156        die "bad record ($origrec)\n";
     157#        warn "bad record ($origrec)\n";
     158#        $badrec = 1;
     159#        last;
    158160      } else {
    159161        if ($curatom ne 'class' && $curatom ne 'ttl') {
    160           warn "bad record ($origrec)\n";
    161           $badrec = 1;
    162           last;
     162          die "bad record ($origrec)\n";
     163#          warn "bad record ($origrec)\n";
     164#          $badrec = 1;
     165#          last;
    163166        }
    164167        $curatom = 'ttl';
     
    169172#print "a$nc: d2: atom [$atom]\n        $rec\n" if $i == $debugid;
    170173      if ($atom =~ /CS|CH|HS/) {
    171         warn "unsupported class $atom in record ($origrec)\n";
    172         $badrec = 1;
    173         last;
     174        die "unsupported class $atom in record ($origrec)\n";
     175#        warn "unsupported class $atom in record ($origrec)\n";
     176#        $badrec = 1;
     177#        last;
    174178      }
    175179      $curatom = 'class';
     
    182186        $type = $atom;
    183187      } else {
    184         warn "unknown type $atom in record ($origrec)\n";
    185         $badrec = 1;
    186         last;
     188        die "unknown type $atom in record ($origrec)\n";
     189#        warn "unknown type $atom in record ($origrec)\n";
     190#        $badrec = 1;
     191#        last;
    187192      }
    188193    }
     
    190195#print "a$nc: next: $rec\n" if $i == $debugid;
    191196  } # class/type/TTL loop
     197};
     198if ($@) {
     199  warn $@;
     200  next;
     201}
     202
    192203
    193204#last if $i > 15;
    194   next if $badrec;
     205#  next if $badrec;
    195206
    196207#print Dumper(\%reverse_typemap);
     
    210221  if ($type eq 'SOA') {
    211222    my ($ns, $adminmail) = ($rdata =~ /([\w.]+)\s+([\w.]+)\s+\(/);
    212     die "Can't parse gibberish SOAish record: $_\n" if !$ns;
     223    die "Can't parse gibberish SOAish record: $origrec\n" if !$ns;
    213224    $rdata =~ s/([\w.]+)\s+([\w.]+)\s+\(\s*//;
    214225
Note: See TracChangeset for help on using the changeset viewer.