c14a06
From 3c4f9e7347965ff9a887147df34e720224ffa7cc Mon Sep 17 00:00:00 2001
c14a06
From: Florence Blanc-Renaud <flo@redhat.com>
c14a06
Date: Tue, 7 Sep 2021 17:06:53 +0200
c14a06
Subject: [PATCH] migrate-ds: workaround to detect compat tree
c14a06
c14a06
Migrate-ds needs to check if compat tree is enabled before
c14a06
migrating users and groups. The check is doing a base
c14a06
search on cn=compat,$SUFFIX and considers the compat tree
c14a06
enabled when the entry exists.
c14a06
c14a06
Due to a bug in slapi-nis, the base search may return NotFound
c14a06
even though the compat tree is enabled. The workaround is to
c14a06
perform a base search on cn=users,cn=compat,$SUFFIX instead.
c14a06
c14a06
Fixes: https://pagure.io/freeipa/issue/8984
c14a06
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
c14a06
---
c14a06
 ipaserver/plugins/migration.py | 3 ++-
c14a06
 1 file changed, 2 insertions(+), 1 deletion(-)
c14a06
c14a06
diff --git a/ipaserver/plugins/migration.py b/ipaserver/plugins/migration.py
c14a06
index db5241915..6ee205fc8 100644
c14a06
--- a/ipaserver/plugins/migration.py
c14a06
+++ b/ipaserver/plugins/migration.py
c14a06
@@ -922,7 +922,8 @@ migration process might be incomplete\n''')
c14a06
         # check whether the compat plugin is enabled
c14a06
         if not options.get('compat'):
c14a06
             try:
c14a06
-                ldap.get_entry(DN(('cn', 'compat'), (api.env.basedn)))
c14a06
+                ldap.get_entry(DN(('cn', 'users'), ('cn', 'compat'),
c14a06
+                                  (api.env.basedn)))
c14a06
                 return dict(result={}, failed={}, enabled=True, compat=False)
c14a06
             except errors.NotFound:
c14a06
                 pass
c14a06
-- 
c14a06
2.31.1
c14a06