Bug #72753 [Asn]: ldap_search returns zero results when searching for large integers
| From: | heiglandreas@php.net | Date: | Tue, 10 Jan 2017 15:07:59 +0000 |
| Subject: | Bug #72753 [Asn]: ldap_search returns zero results when searching for large integers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206469@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72753&edit=1
ID: 72753
Updated by: heiglandreas@php.net
Reported by: justinasu at gmail dot com
Summary: ldap_search returns zero results when searching for
large integers
Status: Assigned
Type: Bug
Package: LDAP related
Operating System: windows 8.1 x64
PHP Version: 7.0.9
Assigned To: heiglandreas
Block user comment: N
Private report: N
New Comment:
Awesome!
And what does
file /lib64/libldap-2.4.so.2.10.3 return? And if that's also a
symbolic link please follow that until the "file" returns something else than
"symbolic link" ð
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2017-01-10 15:02:37] justinasu at gmail dot com
ldd /usr/lib64/php/modules/ldap.so
linux-vdso.so.1 => (0x00007fffe35b3000)
libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00007fb9a99dd000)
libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007fb9a978c000)
liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007fb9a957c000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb9a91e8000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb9a8fe4000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fb9a8dc9000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fb9a8b92000)
libssl3.so => /usr/lib64/libssl3.so (0x00007fb9a894f000)
libsmime3.so => /usr/lib64/libsmime3.so (0x00007fb9a8721000)
libnss3.so => /usr/lib64/libnss3.so (0x00007fb9a83e1000)
libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007fb9a81b5000)
libplds4.so => /lib64/libplds4.so (0x00007fb9a7fb0000)
libplc4.so => /lib64/libplc4.so (0x00007fb9a7dab000)
libnspr4.so => /lib64/libnspr4.so (0x00007fb9a7b6d000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a92200000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fb9a7969000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb9a774c000)
libz.so.1 => /lib64/libz.so.1 (0x00007fb9a7536000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb9a732d000)
file /lib64/libldap-2.4.so.2
/lib64/libldap-2.4.so.2: symbolic link to `libldap-2.4.so.2.10.3'
here you go :)
------------------------------------------------------------------------
[2017-01-10 14:57:51] heiglandreas@php.net
Sorry to bother you again: I assume that you ar erunning the testscript via your webbrowser. And I
also assume that you are using the PHP-Module for apache.
Please run the following command:
ldd /usr/lib64/php/modules/ldap.so
That should show all the dependencies your ldap-extension has. There should be an LDAP-library
within that list (might be the only one). Please do then run
file <path/to/ldap.so>
and post the result here.
Thanks
------------------------------------------------------------------------
[2017-01-10 10:45:03] heiglandreas@php.net
Thanks for the details! I'll see that I dig into it further! I might come back with mor e
questionsâ¦
------------------------------------------------------------------------
[2017-01-10 10:03:03] justinasu at gmail dot com
yes, ldapsearch returns results as expected:
ldapsearch -H 'ldaps://<ldapserver>' -D 'username@domain' -b
'<base dn>' -W -s sub "(usnchanged>=4261605367)" cn sn
# search result
search: 2
result: 4 Size limit exceeded
# numResponses: 1004
# numEntries: 1000
# numReferences: 3
ldapsearch: @(#) $OpenLDAP: ldapsearch 2.4.40 (May 10 2016 23:31:28) $
mockbuild@worker1.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/build-clients/clients/tools
(LDAP library: OpenLDAP 20440)
php is 64bit:
var_dump(PHP_INT_SIZE);
int(8)
this bug is reproduced all the way up to php v5.5. This is the oldest version i have tried.
------------------------------------------------------------------------
[2017-01-09 21:55:13] heiglandreas@php.net
The interesting thing is that the filter is a string and is passed to the underlying LDAP-library
(usually OpenLDAP) as string. So there isn't a conversion to an integer value on PHP-side.
Therefore I'm inclined to say that the conversion to an integer is done in the underlying
LDAP-library. Can you check whether that lib is a 32bit or a 64bit build? And can you get a result
using f.e. ldapsearch instead of the ActiveDirectory explorer?
Thanks for your help!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72753
--
Edit this bug report at https://bugs.php.net/bug.php?id=72753&edit=1