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