Bug 43420 - univention.uldap.access.getAttr() is not case sensitive aware
univention.uldap.access.getAttr() is not case sensitive aware
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UDM maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-25 13:33 CET by Florian Best
Modified: 2020-06-22 17:10 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-01-25 13:33:24 CET
>>> import univention.uldap
>>> lo = univention.uldap.getMachineConnection()
>>> lo.getAttr(lo.lo.whoami_s()[3:], 'entrydn', required=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/univention/uldap.py", line 280, in getAttr
    raise ldap.NO_SUCH_OBJECT({'desc': 'no object'})
ldap.NO_SUCH_OBJECT: {'desc': 'no object'}
>>> lo.getAttr(lo.lo.whoami_s()[3:], 'entryDN', required=True)
['cn=xen7,cn=dc,cn=computers,dc=school,dc=local']

So to use the function one must know what the LDAP server returns. (openLDAP returns the normalized form.

Aliases are also affected:
>>> lo.getAttr(lo.lo.whoami_s()[3:], 'CN', required=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/univention/uldap.py", line 280, in getAttr
    raise ldap.NO_SUCH_OBJECT({'desc': 'no object'})
ldap.NO_SUCH_OBJECT: {'desc': 'no object'}
>>> lo.getAttr(lo.lo.whoami_s()[3:], 'commonName', required=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/univention/uldap.py", line 280, in getAttr
    raise ldap.NO_SUCH_OBJECT({'desc': 'no object'})
ldap.NO_SUCH_OBJECT: {'desc': 'no object'}
>>> lo.get(lo.lo.whoami_s()[3:], ['commonName'], required=True)
{'cn': ['xen7']}
Comment 1 Florian Best univentionstaff 2017-01-26 12:58:00 CET
Another thing:

univention.uldap.access.getAttr() raises ldap.NO_SUCH_OBJECT if the object exists but only the attribute is missing.