[SRU] PY3: python3-ldap does not allow bytes for DN/RDN/field names
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Corey Bryant | ||
Rocky |
Fix Released
|
Undecided
|
Unassigned | ||
Stein |
Fix Released
|
Medium
|
Corey Bryant | ||
Ubuntu Cloud Archive |
Fix Released
|
High
|
Unassigned | ||
Rocky |
Fix Released
|
High
|
Unassigned | ||
Stein |
Fix Released
|
High
|
Unassigned | ||
ldappool |
Fix Released
|
Undecided
|
Unassigned | ||
keystone (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Cosmic |
Fix Released
|
High
|
Unassigned | ||
Disco |
Fix Released
|
High
|
Unassigned | ||
python-ldappool (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Cosmic |
Fix Released
|
High
|
Unassigned | ||
Disco |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
Keystone LDAP backend doesn't work for PY3.
Under Python 2, python-ldap uses bytes by default. Under Python 3 this is removed and bytes aren't allowed for DN/RDN/field names.
More details are here: http://
and here: https:/
== initial traceback ==
Here's the initial traceback from the failure: https:/
The last bit of the error is:
File "/usr/lib/
result = func(*args,
TypeError: simple_bind() argument 1 must be str or None, not bytes
A closer look at func shows:
func=<built-in method simple_bind of LDAP object at 0x7f9d0177b760>
args=(b'
== keystone ldap backend use of python-ldap ==
In simple_bind_s() of keystone's ldap backend, who and cred are encoded as byte strings:
https:/
but that appears to no longer be valid use of python-ldap for py3.
[Test Case]
Run charm-keystone-ldap functional tests for OpenStack Rocky or above.
[Regression Potential]
The only regression potential would be for PY2 code paths. PY3 code paths never worked for keystone's LDAP backend. The approach to the patch have purposefully minimized amount of code required and therefore regression potential for PY2. Note that Rocky for Ubuntu supports PY2 but as of Stein Ubuntu has dropped PY2 support.
summary: |
- PY3: python3-ldap does not allow bytes for no bytes for DN/RDN/field - names + PY3: python3-ldap does not allow bytes for DN/RDN/field names |
Changed in keystone: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: ldap |
Changed in keystone: | |
milestone: | none → stein-3 |
tags: | added: cpe-onsite |
tags: | added: field-critical |
Changed in python-ldappool (Ubuntu Disco): | |
status: | Triaged → Fix Released |
Changed in keystone (Ubuntu Disco): | |
status: | Triaged → Fix Released |
summary: |
- PY3: python3-ldap does not allow bytes for DN/RDN/field names + [SRU] PY3: python3-ldap does not allow bytes for DN/RDN/field names |
description: | updated |
Changed in cloud-archive: | |
status: | Fix Released → Fix Committed |
tags: | added: py3 |
After fixing the first error locally I hit the following: https:/ /paste. ubuntu. com/p/SrNMDnXZf c/
Seems that all use of the python3-ldap API will need to be considered here with dropping bytes usage for py3. It seems as though it may be limited to keystone/ identity/ backends/ ldap/common. py but I'm not overly familiar with the code.