Changeset 803
- Timestamp:
- 11/06/20 10:59:29 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bind2hosts
r802 r803 145 145 my $curatom = 'class'; 146 146 ##fixme: maybe wrap this in an eval() instead of the warn/badrec/last bits? 147 eval { 147 148 for (; $nc < 3; $nc++) { 148 149 my ($atom) = ($rec =~ /^([\w\d.]+)\s/); … … 153 154 #print "a$nc: d: atom [$atom]\n $rec\n" if $i == $debugid; 154 155 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; 158 160 } else { 159 161 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; 163 166 } 164 167 $curatom = 'ttl'; … … 169 172 #print "a$nc: d2: atom [$atom]\n $rec\n" if $i == $debugid; 170 173 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; 174 178 } 175 179 $curatom = 'class'; … … 182 186 $type = $atom; 183 187 } 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; 187 192 } 188 193 } … … 190 195 #print "a$nc: next: $rec\n" if $i == $debugid; 191 196 } # class/type/TTL loop 197 }; 198 if ($@) { 199 warn $@; 200 next; 201 } 202 192 203 193 204 #last if $i > 15; 194 next if $badrec;205 # next if $badrec; 195 206 196 207 #print Dumper(\%reverse_typemap); … … 210 221 if ($type eq 'SOA') { 211 222 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; 213 224 $rdata =~ s/([\w.]+)\s+([\w.]+)\s+\(\s*//; 214 225
Note:
See TracChangeset
for help on using the changeset viewer.