Bug #74788 [Opn->Nab]: Cannot use ldap_connect passing a list of IPs
| From: | heiglandreas@php.net | Date: | Sun, 01 Oct 2017 06:30:52 +0000 |
| Subject: | Bug #74788 [Opn->Nab]: Cannot use ldap_connect passing a list of IPs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211480@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74788&edit=1
ID: 74788
Updated by: heiglandreas@php.net
Reported by: brenocobra at gmail dot com
Summary: Cannot use ldap_connect passing a list of IPs
-Status: Open
+Status: Not a bug
Type: Bug
Package: LDAP related
Operating System: Linux RHEL 7.0
PHP Version: 7.0.20
Block user comment: N
Private report: N
New Comment:
The documentation clearly states that a list of URIs can be used. Not a list of IPs!
This is the result on my local machine (sadly 3v4l.org hasn't ldap-extension installed)
heiglandreas@172.20.10.4 ~ $ php -v
PHP 7.1.8 (cli) (built: Aug 7 2017 15:02:45) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies
heiglandreas@172.20.10.4 ~ $ php -a
Interactive shell
php > var_dump(ldap_connect('ldap://123.234.12.12 ldaps://12.23.34.45'));
php shell code:1:
resource(1) of type (ldap link)
So it works perfectly with LDAP-URIs
Adding a test would be appreciated though ;)
Previous Comments:
------------------------------------------------------------------------
[2017-09-27 15:37:52] mcmic@php.net
(just translating)
The problem reported is ldap_connect will fail when passed a list of IPs separated by spaces, while
this worked with PHP 5.3.
The english documentation for ldap_connect does indeed state that passing a list of URI is possible
(but not a list of IPs), so Iâll need to test this.
Quote: "You can also provide multiple LDAP-URIs separated by a space as one string"
There is no test for this in ext/ldap/tests so one should be added anyway as the feature is
documented.
Then this may need to be fixed if it is indeed not working.
------------------------------------------------------------------------
[2017-06-20 20:41:53] brenocobra at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.ldap-connect
---
No PHP Version 5.3.17 executo o ldap_connect passando uma lista de ip´s de servidores AD e a
função identificava o primeiro ativo e a partir deste teste já mando fazer o ldap_bind
neste servidor ativo.
No PHP Version 7.0.4 executo o ldap_connect passando uma lista de ip´s de servidores AD e recebo
o erro " ldap_connect(): Could not create session handle: Bad parameter to an ldap routine
"
"ESTE ERRO OCORRE APENAS QUANDO PASSO UMA "LISTA DE IP´S""
Test script:
---------------
if ($ds = ldap_connect("IP1 IP2 IP3")){
//Conectou OK em algum dos servidores da lista
...
}else{
// Não foi possÃvel conectar a nenhum servidor de AD
}
OBS.: em IP1, IP2 e IP3 passo o endereço IP dos respectivos servidores
Expected result:
----------------
Era esperado que com este teste (if ($ds = ldap_connect("IP1 IP2 IP3")){) fosse validado o
primeiro servidor de AD disponÃvel da lista que foi enviada como acontecia na versão 5.3.17.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74788&edit=1