From 1bafab5ae1e894ae3680679e03e457b9ace7e7d2 Mon Sep 17 00:00:00 2001 From: Thierry Bordaz Date: Nov 03 2016 14:04:00 +0000 Subject: Ticket 49016 - (un)register/migration/remove may fail if there is no suffix on 'userRoot' backend Bug Description: If an instance has no suffix on 'userRoot' backend, then the info structure may contain empty 'Suffix'. In fact if the last backend has no suffix (like cn=config), it overwite all previsously found value. This affect register (and possibly unregister/migrate/remove) Fix Description: Before overwriting the 'Suffix' value, check that the found backend contains 'nsslapd-suffix'. https://fedorahosted.org/389/ticket/49016 Reviewed by: Noriko Hosoi (Thank you Noriko) Platforms tested: RHEL 7.2 Flag Day: no Doc impact: no --- diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in index 756d6ea..eac59a3 100644 --- a/ldap/admin/src/scripts/DSUtil.pm.in +++ b/ldap/admin/src/scripts/DSUtil.pm.in @@ -975,7 +975,9 @@ sub createInfFromConfig { } # use the userRoot suffix if available while ($ent) { - $suffix = $ent->getValues('nsslapd-suffix'); + if ($ent->getValues('nsslapd-suffix')) { + $suffix = $ent->getValues('nsslapd-suffix'); + } last if ($ent->hasValue('cn', 'userRoot', 1)); $ent = $conn->nextEntry(); }