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

Merge branch '5863-supanntypeentite-should-contain-supann-prefix' into '1.3-dev'

Resolve "supannTypeEntite should contain {SUPANN} prefix"

See merge request fusiondirectory/fd!349
Showing with 46 additions and 0 deletions
+46 -0
...@@ -1610,6 +1610,47 @@ sub migrate_phones { ...@@ -1610,6 +1610,47 @@ sub migrate_phones {
$unbind->code && warn "! Unable to unbind from LDAP server: ", $unbind->error."\n"; $unbind->code && warn "! Unable to unbind from LDAP server: ", $unbind->error."\n";
} }
# function that migrates supannTypeEntite from FD<1.3 to FD>=1.3
sub migrate_supanntypeentite {
# initiate the LDAP connexion
my %hash_ldap_param = get_ldap_connexion();
# LDAP's connection's parameters
my $base = $hash_ldap_param{base};
my $ldap = $hash_ldap_param{ldap};
my $mesg = $ldap->search(
filter => '(&(supannTypeEntite=*)(!(supannTypeEntite={*}*)))',
base => $base
);
$mesg->code && die $mesg->error;
if ($mesg->count > 0) {
print ("The following entries are missing prefix in supannTypeEntite value:\n");
my @entries = $mesg->entries;
foreach my $entry (@entries) {
print $entry->dn().": ".$entry->get_value("supannTypeEntite")."\n";
}
if (ask_yn_question("Migrate these entries to add the {SUPANN} prefix?")) {
foreach my $entry (@entries) {
$entry->replace("supannTypeEntite" => "{SUPANN}".$entry->get_value("supannTypeEntite"));
$mesg = $entry->update($ldap);
if ($mesg->code) {
print $entry->dn().": ".$mesg->error."\n";
next;
}
}
}
}
# unbind to the LDAP server
my $unbind = $ldap->unbind;
$unbind->code && warn "! Unable to unbind from LDAP server: ", $unbind->error."\n";
}
# List LDAP attributes which have been deprecated # List LDAP attributes which have been deprecated
sub list_deprecated { sub list_deprecated {
my ($obsolete_attrs, $obsolete_classes) = get_deprecated(); my ($obsolete_attrs, $obsolete_classes) = get_deprecated();
...@@ -1852,6 +1893,7 @@ die ("! You have to run this script as root\n") if ($<!=0); ...@@ -1852,6 +1893,7 @@ die ("! You have to run this script as root\n") if ($<!=0);
$commands{"--migrate-systems"} = ["Migrating your systems from FD < 1.1", \&migrate_systems, 1]; $commands{"--migrate-systems"} = ["Migrating your systems from FD < 1.1", \&migrate_systems, 1];
$commands{"--migrate-winstations"} = ["Migrating your winstations from FD < 1.1", \&migrate_winstations, 1]; $commands{"--migrate-winstations"} = ["Migrating your winstations from FD < 1.1", \&migrate_winstations, 1];
$commands{"--migrate-dhcp"} = ["Migrating DHCP configurations for FD >= 1.0.17",\&migrate_dhcp, 1]; $commands{"--migrate-dhcp"} = ["Migrating DHCP configurations for FD >= 1.0.17",\&migrate_dhcp, 1];
$commands{"--migrate-supannentite"} = ["Fixing supannTypeEntite from FD < 1.3", \&migrate_supanntypeentite];
$commands{"--delete-gosa-locks"} = ["Delete lock tokens using old gosaLockEntry class", \&delete_gosa_locks]; $commands{"--delete-gosa-locks"} = ["Delete lock tokens using old gosaLockEntry class", \&delete_gosa_locks];
$commands{"--install-plugins"} = ["Installing FusionDirectory's plugins", \&install_plugins]; $commands{"--install-plugins"} = ["Installing FusionDirectory's plugins", \&install_plugins];
$commands{"--encrypt-passwords"} = ["Encrypt passwords in fusiondirectory.conf", \&encrypt_passwords]; $commands{"--encrypt-passwords"} = ["Encrypt passwords in fusiondirectory.conf", \&encrypt_passwords];
...@@ -1968,6 +2010,10 @@ This option replace old winstations objectClasses by new objectClasses from FD 1 ...@@ -1968,6 +2010,10 @@ This option replace old winstations objectClasses by new objectClasses from FD 1
This option moves DHCP configurations from systems branch to DHCP branch, which is necessary for FusionDirectory 1.0.17 and above. This option moves DHCP configurations from systems branch to DHCP branch, which is necessary for FusionDirectory 1.0.17 and above.
=item --migrate-supannentite
This option adds the {SUPANN} prefix that was missing in supannTypeEntite values before FD 1.3.
=item --delete-gosa-locks =item --delete-gosa-locks
This option will delete old GOsa style lock tokens from 1.0.15 or older This option will delete old GOsa style lock tokens from 1.0.15 or older
......
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