php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44878 ldap_get_entries returns empty objectsid
Submitted: 2008-05-01 07:19 UTC Modified: 2008-05-05 05:48 UTC
From: andreivig at yahoo dot com Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 5.2.5 OS: Fedora Core 6
Private report: No CVE-ID: None
 [2008-05-01 07:19 UTC] andreivig at yahoo dot com
Description:
------------
I made an application that used LDAP for checking the user credentials

When i am using ldap_get_entries 
on development environment i get an array that has a binary value for objectsid 

on production environment i get an array that has no value for objectsid.

Can you please give me a hint here.


The development environment:
Fedora Core 7
Apache Version 	Apache/2.2.8 (Fedora) PHP/5.2.5
PHP Version 5.2.5
LDAP Support 	enabled
RCS Version 	$Id: ldap.c,v 1.161.2.3.2.11 2007/07/17 09:09:42 jani Exp $
Total Links 	0/unlimited
API Version 	2004
Vendor Name 	OpenLDAP
Vendor Version 	0


The production environment:
Fedora Core 6
Apache Version: Apache/2.2.4 (Fedora)
PHP Version 5.1.6 
LDAP Support 	enabled
RCS Version 	$Id: ldap.c,v 1.161.2.3 2006/01/01 12:50:08 sniper Exp $
Total Links 	0/unlimited
API Version 	3001
Vendor Name 	OpenLDAP
Vendor Version 	20330



Reproduce code:
---------------
define('LDAP_HOST', '192.168.3.20');
define('LDAP_PORT', '389');
define('LDAP_USERNAME', 'test');
define('LDAP_PASSWORD', 'test');
define('LDAP_BASEDN', 'cn=Users, dc=svdomain1,dc=softvision,dc=ro');
define('DS',@ldap_connect(LDAP_HOST,LDAP_PORT));

ldap_set_option(DS, LDAP_OPT_PROTOCOL_VERSION, 3);

define('LDAPBIND',ldap_bind(DS, LDAP_USERNAME, LDAP_PASSWORD));

....

$r = ldap_search( DS, LDAP_BASEDN, 'sAMAccountName='  .$user, array('objectsid'));
$result = ldap_get_entries( DS, $r);

Expected result:
----------------
Array
   (
   [count] => 1
   [0] => ��������??-????ig??��
   )

Actual result:
--------------
Array
(
    [0] => 
    [count] => 1
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-03 13:42 UTC] jani@php.net
Update your production env. PHP to something more recent. Also check that you have same openldap libraries on both..
 [2008-05-05 05:48 UTC] andreivig at yahoo dot com
Is there any other solution besides upgrading the production environment? This is the only configuration for the server that IT team could provide me.

I tried to run php5.2.4 with FastCGI .. but it runs very slow.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 19:01:31 2024 UTC