--- vendor-files/tools/ldapdump | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/vendor-files/tools/ldapdump +++ b/vendor-files/tools/ldapdump @@ -343,11 +343,11 @@ sub dropStaticZoneEntries { }; print PIPE "server $server\n" or die "can’t write to $nsupdate pipe: $!"; } - print STDERR "\t\tupdate add $zone. 1234 NS ldapdump_kill_me\n" if( $DEBUG ); + print STDERR "\t\tupdate add $zone. 1234 NS ldapdump.kill.me\n" if( $DEBUG ); if( $DONSUPDATE ) { # create dummy NS record # sadly this one is needed if we want to change the last NS record - print PIPE "update add $zone. 1234 NS ldapdump_kill_me\n" or die "can’t write to $nsupdate pipe: $!"; + print PIPE "update add $zone. 1234 NS ldapdump.kill.me\n" or die "can’t write to $nsupdate pipe: $!"; } foreach my $e ( @data ) { next if( $e =~ /^[\s;]/ ); @@ -587,6 +587,7 @@ sub updateDynamicZone { my $ref = $zone_entry->get_value($rec.'record', asref => 1); next unless $ref; foreach my $rr ( @$ref ) { + $rdn =~ s/\.$zone\.$//; my $where = ($rdn eq '@')?("$zone."):("$rdn.$zone"); my $command = "update add $where $ttl $rec $rr\n"; print STDERR "\t\t$command" if($DEBUG); @@ -596,9 +597,10 @@ sub updateDynamicZone { } } } - print STDERR "\t\tupdate delete $zone. NS ldapdump_kill_me\n" if($DEBUG); + print STDERR "\t\tupdate delete $zone. NS ldapdump.kill.me\n" if($DEBUG); if( $DONSUPDATE ) { - print PIPE "update delete $zone. NS ldapdump_kill_me\n" or die "can’t write to $nsupdate pipe: $!"; + print PIPE "update delete $zone. NS ldapdump.kill.me\n" or die "can’t write to $nsupdate pipe: $!"; + print PIPE "send\n" or die "can’t write to $nsupdate pipe: $!"; print PIPE "\n\n\n" or die "can’t write to $nsupdate pipe: $!"; close(PIPE) or die "can’t close $nsupdate pipe: status=$?"; } @@ -686,9 +688,11 @@ sub parseDynEntries { my %entries; my $entry = ""; foreach( my $i=0; $i<@data; $i++ ) { - if( $data[$i] =~ /^(\S+)\s+(.*)/ ) { + if( $data[$i] =~ /^(\S+)\s+(.*)/ && $data[$i] !~ /^\$TTL/ ) { $entry = $1; $entries{$1} .= "$2\n"; + } elsif ($data[$i] =~ /^\$TTL/) { + $entries{$entry} .= $data[$i]; } else { $data[$i] =~ /^\s+(.*)/; $entries{$entry} .= "\t$1\n";