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