[python-ldap] ldap.initialize() URLs must only contain scheme and hostport components: Commas break inside OpenLDAP
michael at stroeder.com
Wed Aug 16 04:28:31 EDT 2017
Karl Kornel wrote:
> I have a documentation issue that I'd like to report, specific to
> `ldap.initialize()`, and the note regarding the URL parameter.
Thanks for spotting this.
> According to OpenLDAP documentation for the `ldap_initialize` function…
>> The uri parameter may be a comma- or whitespace-separated list of URIs containing
>> only the schema, the host, and the port fields.
> So, you can pass `ldap_initialize` a "URL" like this:
> Here's a diff of my proposed changes, for each application:
> - on that server. Parameter *uri* has to be a valid LDAP URL.
> + on that server. Parameter *uri* has to be a valid LDAP URL containing
> + *only* the scheme and hostport components.
Hmm, maybe we should just repeat the wording from ldap_initialize(3):
"The uri parameter may be a comma- or whitespace-separated list of URIs containing only
the schema, the host, and the port fields."
> Another option would be to modify `ldap.initialize()` to accept any URL, and then pull
> out only the parts we want. But that seems like it wouldn't be worth it.
The caller should use ldapurl.LDAPUrl() to parse the full LDAP URL and pass the result of
LDAPUrl.initializeUrl() to ldap.initialize().
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3829 bytes
Desc: S/MIME Cryptographic Signature
More information about the python-ldap