ID:               25827
 User updated by:  pennington at rhodes dot edu
 Reported By:      pennington at rhodes dot edu
-Status:           Feedback
+Status:           Open
 Bug Type:         LDAP related
 Operating System: Windows 2000
 PHP Version:      4.3.3
 New Comment:

OK, you're right, after a few minutes, I found an ldapsearch command
that would work:

ldapsearch -x -b "CN=_some_user_,CN=Users,DC=rhodes,DC=edu" -D
"CN=_search_auth_user_,CN=Users,DC=rhodes,DC=edu" -H
ldap://someserver.rhodes.edu -W

The "memberof" attribute results look like this:

memberOf: CN=STAFF_DL,OU=Distribution Lists,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=Planning,OU=Security Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=FACSTAFF,OU=Security Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=Council,OU=Distribution Lists,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=PRESIDENT,OU=Security Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=FACTBOOK,OU=Security Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=INFO_SERVICES,OU=Security
Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=CABINET,OU=Security Groups,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=Senior2006,OU=Distribution
Lists,OU=Groups,DC=rhodes,DC=edu
memberOf: CN=NT Users,CN=Users,DC=rhodes,DC=edu
memberOf: CN=NTSETUP,CN=Users,DC=rhodes,DC=edu
memberOf: CN=Domain Users,CN=Users,DC=rhodes,DC=edu

Again, only 12 results were returned rather than the 13 that exist
there in Active Directory.

However, I've started doing a count based on attributes found by
ldapsearch and Softerra's LDAPBrowser (which I think also uses
openldap) and found that people missing an attibute value in ldapsearch
were missing the same value in LDAPBrowser.

Anyway, I think what we are down to is one of two possibilities:

1) OpenLDAP's search tool is not receiving all attribute values for a
particular search; or

2) Active Directory is not supplying the missing value when queried for
it using LDAP but does reply properly when Microsoft admin tools are
used.

I guess we could solve this if someone knows a good, freely-available,
non-openldap-based LDAP search utility.

Regardless, this doesn't look like a PHP bug per se, thought it could
be a OpenLDAP bug that has found its way into PHP with the rest of the
OpenLDAP code...


Previous Comments:
------------------------------------------------------------------------

[2003-10-14 12:26:58] [EMAIL PROTECTED]

There is no kerberos support in PHP ldap either, and that partially
works, so why would you need it with the command line binary?


------------------------------------------------------------------------

[2003-10-14 11:59:27] pennington at rhodes dot edu

It appears that ldapsearch at that URL is not compiled with Kerberos
support, which may be required to search Active Directory LDAP servers.
I'm still doing research, however...

D:\openldap\bin>ldapsearch -LLL -H ldap://someserver.rhodes.edu -P 3 -D
pennington -k
ldapsearch: not compiled with Kerberos support

I tried it with just SASL and that wasn't appreciated either:

D:\openldap\bin>ldapsearch -LLL -H ldap://someserver.rhodes.edu -P 3 -D
pennington -I
ldap_sasl_interactive_bind_s: Unknown authentication method (86)
        additional info: SASL(-4): no mechanism available: Unable to
find a call
back: 2

Can anyone verify that Kerberos support is required to search Active
Directory LDAP servers? Is anyone using the OpenLDAP ldapsearch program
to search Active Directory LDAP servers? If so, what kind of command
should I use to get ldapsearch to search Active Directory?

I am using "CN=Users,DC=rhodes,DC=edu" for the Base DN,
"CN=_search_value_" for the name to search for, and to bind to the
Active Directory LDAP server, you have to use this string as the
username: "CN=_authorized_user_,CN=Users,DC=rhodes,DC=edu"

------------------------------------------------------------------------

[2003-10-14 11:12:30] [EMAIL PROTECTED]

PHP uses OpenLDAP libraries for ldap functionality in the windows
binaries. So try your query with the openldap 'ldapsearch.exe' found in
this package:

http://prdownloads.sf.net/acctsync/openldap-binaries-2.1.16-04APR03.zip



------------------------------------------------------------------------

[2003-10-13 12:05:40] pennington at rhodes dot edu

I obviously can't provide general access for testing to our Active
Directory server, because you need an account on the Active Directory
server to even search the directory, as with most LDAP servers.

I find it strange that no one has seen this before, because Microsoft's
Active Directory is probably the most widely-used commercial LDAP
server in the world.

However, it is obvious that, if an attribute has 13 values when looking
at it via another LDAP query tool and if PHP thinks that it has the
same number of values because it creates that many keys in the array,
the error must be that PHP is not setting the last value in the array
(for which there already is a key) or Active Directory is not giving
the last value to PHP for it to set in the array.

Is anyone else using AD and PHP/LDAP seeing similar behavior? Can we
not put this in feedback mode and request more information?

------------------------------------------------------------------------

[2003-10-13 11:55:58] [EMAIL PROTECTED]

Please provide access to this 'active directory' thing.
(If you can't, we can't fix it either)


------------------------------------------------------------------------

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
    http://bugs.php.net/25827

-- 
Edit this bug report at http://bugs.php.net/?id=25827&edit=1

Reply via email to