#19281 [Bgs]: OpenLDAP 2.1.4 requires version
| From: | mose at ns dot cune dot edu | Date: | Mon, 09 Sep 2002 14:31:21 +0000 |
| Subject: | #19281 [Bgs]: OpenLDAP 2.1.4 requires version | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18792@lists.php.net to get a copy of this message | ||
ID: 19281
User updated by: mose@ns.cune.edu
Reported By: mose@ns.cune.edu
Status: Bogus
Bug Type: LDAP related
Operating System: RH 7.3, 2.4.19
PHP Version: 4CVS-2002-09-07
New Comment:
Your decision violates the law of least surprise. Allowing a default
version to be specified at compile time would be the more prudent
option. Otherwise a lot of PHP software using LDAP will break when
OpenLDAP and PHP are upgraded.
Previous Comments:
------------------------------------------------------------------------
[2002-09-09 05:03:59] sniper@php.net
Not a bug..
------------------------------------------------------------------------
[2002-09-09 01:44:24] venaas@php.net
I see your reasoning, but I'm opposed to this change. PHP
always defaulted to v2 since the LDAP library did, and if
one used v3 server one had to set the version. To use v3
do as follows before binding:
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
------------------------------------------------------------------------
[2002-09-07 10:37:36] mose@ns.cune.edu
imap-2002.RC5
Apache 2.0.40
mysql 3.23.49
openldap 2.1.4
configure --with-apxs2=/local/apache/bin/apxs
--enable-force-cgi-redirect --disable-cli
--with-imap=/home/mose/imap-2002.RC5 --with-ldap
--with-mysql=/local/mysql
It appears that since version 2.1.3 of openldap, it requires that the
LDAP version be set to 3 when making a connection. The php routines do
not set the version. The following lines inserted in ext/ldap/ldap.c
in the function ldap_connect() seem to work for me.
int version;
and then inside #ifdef LDAP_API_FEATURE_X_OPENLDAP
ldap = ldap_init(host, port);
}
version = LDAP_VERSION3;
(void)ldap_set_option (ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
#else
Everyone should probably be using version 3. However, you may want to
allow the version to be specified at configuration time or allow the
version to be specified in php with the ldap_connect() call, with a
default of version 3.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19281&edit=1