[python-ldap] Inconsistent capitalization breaks schema parsing

Petr Viktorin pviktori at redhat.com
Fri Sep 13 12:51:26 CEST 2013


Hello,
Is this the proper place to bring bugs to the attention of python-ldap 
developers?

I've noticed that inconsistent capitalization of attributes in a schema 
LDIF file can result in a SubSchema with some entries missing.
Use the attached files to reproduce the issue.

The problem is that the LDIF parsing yields to something like 
`{'attributeTypes': [...], 'attributetypes': [...]}`, but when that is 
converted to a case-insensitive dict, one of the keys overwrites the other.

I'm not sure where to do a proper fix. Clean up the dictionary before 
converting? Modify the LDIF parser to normalize attribute names to the 
first value seen? Modify cidict to optionally handle conflicts like these?
I'd be grateful if someone familiar with the code base could give me an 
opinion.

-- 
Petr Viktorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parse-schema.py
Type: text/x-python
Size: 134 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20130913/b34acd4a/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schema.ldif
Type: text/x-ldif
Size: 425 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20130913/b34acd4a/attachment.bin>


More information about the python-ldap mailing list