54 lines
1.8 KiB
Diff
54 lines
1.8 KiB
Diff
From 0a5509665485baa5190f2e3c6fdd765c966a4405 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Bokovoy <abokovoy@redhat.com>
|
|
Date: Mon, 15 Sep 2025 09:41:31 +0300
|
|
Subject: [PATCH] GetEntryFromLDIF: handle DNs case-insensitive
|
|
|
|
LDAP expects case-insensitive DNs, so modify LDIF parser to
|
|
compare DNs as case-insensitive strings and use case-preserving but
|
|
case-insensitive dictionary.
|
|
|
|
Fixes: https://pagure.io/freeipa/issue/9854
|
|
|
|
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
|
|
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
|
|
---
|
|
ipaserver/install/upgradeinstance.py | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
|
|
index b84f50b059c5d9b19719495ec10f06f67e4a7c8a..ecd0a08ea1ef18bf1225ef339ed0e17a9666e4f3 100644
|
|
--- a/ipaserver/install/upgradeinstance.py
|
|
+++ b/ipaserver/install/upgradeinstance.py
|
|
@@ -29,7 +29,7 @@ import traceback
|
|
from ipalib import api
|
|
from ipaplatform.paths import paths
|
|
from ipaplatform import services
|
|
-from ipapython import ipaldap
|
|
+from ipapython import ipaldap, ipautil
|
|
|
|
from ipaserver.install import installutils
|
|
from ipaserver.install import schemaupdate
|
|
@@ -57,8 +57,8 @@ class GetEntryFromLDIF(ldif.LDIFParser):
|
|
returned if list is empty.
|
|
"""
|
|
ldif.LDIFParser.__init__(self, input_file)
|
|
- self.entries_dn = entries_dn
|
|
- self.results = {}
|
|
+ self.entries_dn = [e.lower() for e in entries_dn]
|
|
+ self.results = ipautil.CIDict()
|
|
|
|
def get_results(self):
|
|
"""
|
|
@@ -67,7 +67,7 @@ class GetEntryFromLDIF(ldif.LDIFParser):
|
|
return self.results
|
|
|
|
def handle(self, dn, entry):
|
|
- if self.entries_dn and dn not in self.entries_dn:
|
|
+ if self.entries_dn and dn.lower() not in self.entries_dn:
|
|
return
|
|
|
|
self.results[dn] = entry
|
|
--
|
|
2.53.0
|
|
|