ldap/admin/src/scripts/DSUtil.pm.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 3204074fc52ab7afb9bede059c86c53ce4765f40
Author: Thierry Bordaz <tbordaz(a)redhat.com>
Date: Fri Oct 21 16:28:59 2016 +0200
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();
}