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