mirror of
https://github.com/bklang/ldap2dns.git
synced 2025-10-27 22:34:18 -04:00
* Add new TXT record handling
* Change struct resourcerecord SRV member names to be consistent with other members git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@457 06cd67b6-e706-0410-b29e-9de616bca6e9
This commit is contained in:
@@ -215,7 +215,11 @@ sub read_zone
|
||||
$attr{'DNSttl'} = $2;
|
||||
$attr{'DNSclass'} = $3;
|
||||
$attr{'DNStype'} = $4;
|
||||
$attr{'DNScname'} = $5;
|
||||
if ($rr->type eq "CNAME") {
|
||||
$attr{'DNScname'} = $5;
|
||||
} elsif ($rr->type eq "TXT") {
|
||||
$attr{'DNStxt'} = $5;
|
||||
}
|
||||
add_attrs(\%attr, $zonename);
|
||||
} elsif ($rr->type eq "PTR") {
|
||||
die "Invalid PTR record for ", $rr->name, " " unless ($rr->string =~ /^([0-9.]+\.in-addr\.arpa)\.\s+(\d+)\s+(\w+)\s+(\w+)\s+([0-9a-zA-Z_.+-]+)/);
|
||||
|
||||
@@ -338,12 +338,7 @@ LINE: while(<DATA>) {
|
||||
};
|
||||
|
||||
/^'/ && do {
|
||||
# Currently unsupported
|
||||
print STDERR "Ignoring unsupported TXT record: $_\n";
|
||||
$errorrecs++;
|
||||
print $rejfh "$_\n";
|
||||
next LINE;
|
||||
# Found an MX
|
||||
# Found a TXT record
|
||||
my ($fqdn, $s, $ttl, $timestamp, $loc) = split /:/;
|
||||
$fqdn =~ s/^'//;
|
||||
if (!defined($ttl)) { $ttl = ""; }
|
||||
@@ -359,8 +354,7 @@ LINE: while(<DATA>) {
|
||||
print $outfh "cn: $id\n";
|
||||
print $outfh "dnstype: txt\n";
|
||||
print $outfh "dnsdomainname: $fqdn.\n";
|
||||
# FIXME Add TXT support to ldap2dns
|
||||
# print $outfh "dnstxt: $s\n";
|
||||
print $outfh "dnstxt: $s\n";
|
||||
if ($ttl) { print $outfh "dnsttl: $ttl\n"; }
|
||||
if ($timestamp) { print $outfh "dnstimestamp: $timestamp\n"; }
|
||||
if ($loc) { print $outfh "dnsloc: $loc\n"; }
|
||||
|
||||
Reference in New Issue
Block a user