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

Fixes #4515 Fixed a few problems in --migrate-dns

parent 585efce3
...@@ -1341,12 +1341,13 @@ sub migrate_dns { ...@@ -1341,12 +1341,13 @@ sub migrate_dns {
my $relativeDomainName = $2; my $relativeDomainName = $2;
if ($rdn eq $relativeDomainName) { if ($rdn eq $relativeDomainName) {
my %replace = (); my %replace = ();
foreach my $attr (@{$entry->attributes()}) { my @attributes = $entry->attributes();
foreach my $attr (@attributes) {
$replace{$attr} = $entry->get_value($attr, asref => 1) $replace{$attr} = $entry->get_value($attr, asref => 1)
} }
$result = $ldap->modify ( $result = $ldap->modify (
"$rdn,$zoneDn", "$rdn,$zoneDn",
replace => %replace replace => \%replace
); );
$result->code && die "Migration of DNS zone subentry failed, LDAP error: ".$result->error."\n"; $result->code && die "Migration of DNS zone subentry failed, LDAP error: ".$result->error."\n";
$result = $ldap->delete ($entry->dn()); $result = $ldap->delete ($entry->dn());
......
Supports Markdown
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