]> granicus.if.org Git - php/commit
ext/ldap: Allow default host from ldap.conf to work.
authorDavid Caldwell <david@galvanix.com>
Thu, 25 May 2017 00:41:12 +0000 (00:41 +0000)
committerCôme Bernigaud <mcmic@php.net>
Tue, 30 May 2017 15:30:32 +0000 (17:30 +0200)
commit747e93eabcc59646c24bfa99c5abe37f4fd11ee4
treeead135a0e62b15bdf41f13fcdc40c22709a7474b
parent65edf44291814c0bd0231b518a10a42e9530796f
ext/ldap: Allow default host from ldap.conf to work.

This fixes an regression introduced in
e7af0fe1eb89e40671e86a588aa1b78607b85461. Previously, calling
ldap_connect() with no parameters would pass NULL to ldap_init(),
which causes it to use the default host specified in
/etc/ldap/ldap.conf (on Ubuntu).

When the code changed to use ldap_initialize(), it initialized a uri,
even if there were no parameters passed to ldap_connect(). Because of
this, there's no way to pass a NULL into ldap_initialize(), making it
impossible to use the default uri from ldap.conf.

This commit bypasses the uri creation when there is no host argument,
passing on a NULL to ldap_initialize() which restores the old PHP 5.5
behavior.
ext/ldap/ldap.c