Commit 99288c49 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4634 Fixed migrate-dns for PTR records

parent 48333c0e
......@@ -1363,7 +1363,27 @@ sub migrate_dns {
$result->code && die "Migration of DNS zone subentry failed, LDAP error: ".$result->error."\n";
}
# Fix reverse zone PTR records DNs
$mesg = $ldap->search(
base => $zoneDn,
filter => "(&(objectClass=dNSZone)(!(relativeDomainName=@))(|(zoneName=*.arpa)(zoneName=*.arpa.)))"
);
$mesg->code && die $mesg->error;
@entries = $mesg->entries;
foreach my $entry (@entries) {
$entry->dn() =~ m/^([^,]+),(relativeDomainName=[^,]+),([^,]+,$zoneDn)$/ or next;
$result = $ldap->moddn (
$entry->dn(),
newrdn => $1,
deleteoldrdn => '1',
newsuperior => $2
);
$result->code && die "Migration of DNS reverse zone subentry ".$entry->dn()." failed, LDAP error: ".$result->error."\n";
}
# Add DNS tab on server
$mesg = $ldap->search(
base => $systemdn,
scope => 'base',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment