2022-10-07 01:52:09 +02:00
|
|
|
|
---
|
|
|
|
|
vendor-files/tools/ldapdump | 14 +++++++++-----
|
|
|
|
|
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
|
|
|
|
2018-06-05 11:30:33 +02:00
|
|
|
|
--- a/vendor-files/tools/ldapdump
|
|
|
|
|
+++ b/vendor-files/tools/ldapdump
|
2022-10-07 01:52:09 +02:00
|
|
|
|
@@ -343,11 +343,11 @@ sub dropStaticZoneEntries {
|
2018-06-05 11:30:33 +02:00
|
|
|
|
};
|
|
|
|
|
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;]/ );
|
2022-10-07 01:52:09 +02:00
|
|
|
|
@@ -587,6 +587,7 @@ sub updateDynamicZone {
|
2018-06-05 11:30:33 +02:00
|
|
|
|
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);
|
2022-10-07 01:52:09 +02:00
|
|
|
|
@@ -596,9 +597,10 @@ sub updateDynamicZone {
|
2018-06-05 11:30:33 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
- 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=$?";
|
|
|
|
|
}
|
2022-10-07 01:52:09 +02:00
|
|
|
|
@@ -686,9 +688,11 @@ sub parseDynEntries {
|
2018-06-05 11:30:33 +02:00
|
|
|
|
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";
|