[Date Prev][Date Next] [Chronological] [Thread] [Top]

Win2K WinLDAP question



Title: Message
Using LDP.exe(distributed by Microsoft as an LDAP client) on Win2K, a certain query returns
Result <0>:(null)
In spite of this, it reports specifics for the one entry I have and I get what I expect.
Cool.
 
But, when I replicate this action in code, I also get the result of 0 for ldap_count_entries(). 
There appear to be no errors along teh way to the actual search.
 
Here is the code
/* connectivity works for other queries but not one to return user information*/
...
#define BASEDN "CN=Users,DC=www,DC=xyz,DC=com"
#define SCOPE LDAP_SCOPE_SUBTREE 
#define FILTER "(sn=*)"
...
  rc = ldap_search_s( ld, BASEDN, SCOPE, FILTER, NULL, 0, &result );
 
  if ( rc != LDAP_SUCCESS )
  /* error out here, but I get no
 errors  */
 
  // this returns ZERO
  int nCount = ldap_count_entries( ld, result);
  printf("[%d] entries found\n", nCount);
 
/* This loop gets null first time around */ 
for ( e = ldap_first_entry( ld, result ); e != NULL;  e = ldap_next_entry( ld, e ) )
  {
    if ( (dn = ldap_get_dn( ld, e )) != NULL )
   {
      printf( "dn: %s\n", dn );
      ldap_memfree( dn );
    }
  }
...
 
 
1  Why does the MS tool, LDP.exe report a result of ZERO but returns the user I want? 
The anser to this might be why I get ZERO in my ldap_count_entries and I am unable to enumerate with ldap_first_entry
 
2  Is there something wrong with WinLDAP and how can it be patched?
 
Thanks