From 7031acf2057a843c5863ebd42f080b12650bfa97 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 26 Jan 2025 14:51:14 +0200 Subject: [PATCH 1/2] WIP: ipa-migrate: force lowcase for objtclass values Fixes: https://pagure.io/freeipa/issue/9736 Signed-off-by: Alexander Bokovoy --- ipaserver/install/ipa_migrate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ipaserver/install/ipa_migrate.py b/ipaserver/install/ipa_migrate.py index ffee6b11c..9016f9f1d 100644 --- a/ipaserver/install/ipa_migrate.py +++ b/ipaserver/install/ipa_migrate.py @@ -1106,7 +1106,7 @@ class IPAMigrate(): # normalize DN values return self.normalize_vals(new_values) - def get_ldapentry_attr_vals(self, entry, attr): + def get_ldapentry_attr_vals(self, entry, attr, lowercase=False): """ Get the raw attribute values from IPA's LDAPEntry """ @@ -1120,6 +1120,8 @@ class IPAMigrate(): vals.append(ensure_str(val)) else: # Just a string + if lowercase: + val = val.lower() vals.append(val) return self.normalize_vals(vals) @@ -1363,8 +1365,9 @@ class IPAMigrate(): # merge values for val in remote_attrs[attr]: - local_attr_vals = self.get_ldapentry_attr_vals(local_entry, - attr) + lowercase = (attr.lower() == 'objectclass') + local_attr_vals = self.get_ldapentry_attr_vals( + local_entry, attr, lowercase=lowercase) if val not in local_attr_vals: # Check if we should reset the DNA range for this entry if ( -- 2.48.1 From c332d1055155baf118b1fa12b5a9a3e3b37a7211 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 26 Jan 2025 14:58:54 +0200 Subject: [PATCH 2/2] ipa-migrate: pylint false positive initialize db_data so that pylint doesn't fail to understand we cannot get into that branch without db_data being initialized Signed-off-by: Alexander Bokovoy --- ipaserver/install/ipa_migrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ipaserver/install/ipa_migrate.py b/ipaserver/install/ipa_migrate.py index 9016f9f1d..b4cde27de 100644 --- a/ipaserver/install/ipa_migrate.py +++ b/ipaserver/install/ipa_migrate.py @@ -1628,6 +1628,7 @@ class IPAMigrate(): controls = [paged_ctrl] req_pr_ctrl = controls[0] db_filter = ("(objectclass=*)") + db_data = None # Start the paged results search try: -- 2.48.1