Bug #72753 [NEW]: ldap_search returns zero results when searching for large integers
| From: | justinasu at gmail dot com | Date: | Thu, 04 Aug 2016 09:35:42 +0000 |
| Subject: | Bug #72753 [NEW]: ldap_search returns zero results when searching for large integers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-202914@lists.php.net to get a copy of this message | ||
From: justinasu at gmail dot com
Operating system: windows 8.1 x64
PHP version: 7.0.9
Package: LDAP related
Bug Type: Bug
Bug description:ldap_search returns zero results when searching for large integers
Description:
------------
<ldapserver> and <base dn> in test script should be substituted with
some ldap server that you have access to and you need to have read
permission to usnchanged attribute.
when searching for entries by usnchanged which is a Microsoft proposed
way of polling for changes, the test script returns 0 results. But if
you run the same filter query in Active Directory explorer or some other
tool i get many results - couple of thousand.
if the value is smaller lets say (usnchanged>=261605367) i get expected
results.
i suspect that somewhere in LDAP php internals the value gets
interpreted as 32bit integer and since it's max is 4,294,967,295, the
query with higher values never returns any results. usnchanged field is
8bit INTERGER (BIGINT) in Active Directory.
tried on linux Centos 6.8 x64 the result is the same.
Test script:
---------------
$res = ldap_connect('ldap://<ldapserver>');
ldap_set_option($res, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($res)
$response = ldap_search($res, '<base dn>', '(usnchanged>=4261605367)');
$result = ldap_get_entries($res, $response);
var_dump($result);
Expected result:
----------------
array with count > 0
Actual result:
--------------
array with count === 0
--
Edit bug report at https://bugs.php.net/bug.php?id=72753&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72753&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72753&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72753&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72753&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72753&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72753&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72753&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72753&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72753&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72753&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72753&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72753&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72753&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72753&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72753&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72753&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72753&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72753&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72753&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72753&r=mysqlcfg