- Timestamp:
- 04/29/22 15:45:16 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tiny-import.pl
r797 r843 3 3 ## 4 4 # $Id$ 5 # Copyright 2012-2014,2020 Kris Deugau <kdeugau@deepnet.cx>5 # Copyright 2012-2014,2020-2022 Kris Deugau <kdeugau@deepnet.cx> 6 6 # 7 7 # This program is free software: you can redistribute it and/or modify … … 28 28 use Time::TAI64 qw(:tai); 29 29 30 # push "the directory the script is in" into @INC 31 use FindBin; 32 use lib "$FindBin::RealBin/"; 30 # Taint-safe (ish) voodoo to push "the directory the script is in" into @INC. 31 use File::Spec (); 32 use File::Basename (); 33 my $path; 34 BEGIN { 35 $path = File::Basename::dirname(File::Spec->rel2abs($0)); 36 if ($path =~ /(.*)/) { 37 $path = $1; 38 } 39 } 40 use lib $path; 33 41 34 42 use DNSDB; … … 200 208 chomp; 201 209 s/\s*$//; 210 s/:+$//; 202 211 my $recstat = recslurp($_, $filecnt); 203 212 $ok++ if $recstat; … … 405 414 $host =~ s/\.$//; 406 415 $host =~ s/^\\052/*/; 407 $ttl = -1 if $ttl eq '';416 $ttl = -1 if !defined($ttl) || $ttl eq ''; 408 417 $stamp = '' if !$stamp; 409 418 $loc = '' if !$loc; … … 542 551 $host =~ s/\.$//; 543 552 $host =~ s/^\\052/*/; 544 $ttl = -1 if $ttl eq '';553 $ttl = -1 if !defined($ttl) || $ttl eq ''; 545 554 $stamp = '' if !$stamp; 546 555 $loc = '' if !$loc; … … 605 614 if ($zone =~ /\.arpa$/) { 606 615 ($code,$msg) = DNSDB::_zone2cidr($zone); 607 $dbh->do("INSERT INTO revzones (revnet,group_id,status,default_location, zserial) VALUES (?,?,1,?,?)",616 $dbh->do("INSERT INTO revzones (revnet,group_id,status,default_location,sertype,zserial) VALUES (?,?,1,?,'U',?)", 608 617 undef, ($msg, $importcfg{group}, $loc, $serial)); 609 618 my ($rdns) = $dbh->selectrow_array("SELECT currval('revzones_rdns_id_seq')"); … … 614 623 $loc, $stamp, $expires, $stampactive); 615 624 } else { 616 $dbh->do("INSERT INTO domains (domain,group_id,status,default_location, zserial) VALUES (?,?,1,?,?)",625 $dbh->do("INSERT INTO domains (domain,group_id,status,default_location,sertype,zserial) VALUES (?,?,1,?,'U',?)", 617 626 undef, ($zone, $importcfg{group}, $loc, $serial)); 618 627 my ($domid) = $dbh->selectrow_array("SELECT currval('domains_domain_id_seq')");
Note:
See TracChangeset
for help on using the changeset viewer.