$NetBSD: patch-ab,v 1.1 2000/11/22 10:44:52 rh Exp $ --- ispman-utils/bin/ldap2named.orig Sat Sep 23 01:24:28 2000 +++ ispman-utils/bin/ldap2named @@ -31,7 +31,10 @@ if ($soa) { - print ZONE "@ IN SOA $soa->{'primary'}. $soa->{'rootmail'}. (\n"; + my $primary = $soa->{'primary'}; + $primary="$primary\." if (($primary =~ /\./) && ($primary !~ /\.$/)); + print ZONE "\$TTL $soa->{'minimum'}\n"; + print ZONE "@ IN SOA $primary $soa->{'rootmail'}. (\n"; for (qw(serial refresh retry expire minimum)) { print ZONE "\t $soa->{$_} ; $_\n"; } @@ -45,7 +48,7 @@ print ZONE "\n; NS RECORDS\n"; for (@$nsrecords) { my ($origion, $host)=split(/\s*,\s*/, $_); - $host=($host=~/\.$/)?$host: "$host\."; + $host="$host\." if (($host =~ /\./) && ($host !~ /\.$/)); print ZONE "$origion IN NS $host\n"; } @@ -55,7 +58,7 @@ for (@$mxrecords) { my ($origion, ,$pref, $host)=split(/\s*,\s*/, $_); - $host=($host=~/\.$/)?$host: "$host\."; + $host="$host\." if (($host =~ /\./) && ($host !~ /\.$/)); print ZONE "$origion IN MX $pref $host\n"; } @@ -72,6 +75,7 @@ my $cnames=$ispman->getRecords($domains->{$domain}, "cnames"); for (@$cnames) { my ($alias, $host)=split(/\s*,\s*/, $_); + $host="$host\." if (($host =~ /\./) && ($host !~ /\.$/)); print ZONE "$alias IN CNAME $host\n"; }