From:  "" <>
Date:  30 Dec 2005 07:10:49 Hong Kong Time

Version 3 client not following referrals automatically on windows


I am using the netscape-sdk libraries (downloaded from RedHat) on both
windows and linux.
On Linux, once I set the version to 3, the referrals are followed
automatically while on windows, the ldap_search_s call still returns an
errorcode of 9 (?).
Also, if the set_option call is done before the bind, the seach fails
with an error code of 1 (OPERATIONS_ERROR) and I get an error such as

ldap_search_s: Operations error
ldap_search_s: additional info: 00000000: LdapErr: DSID-0C090627,
comment: In or
der to perform this operation a successful bind must be completed on
the connect
ion., data 0, vece

Any help will be highly appreciated.


 /* Bind to the LDAP server. */
   rc = ldap_simple_bind_s( ld, UserName, Password);
   if ( rc != LDAP_SUCCESS ) {
     fprintf(stderr, "ldap_simple_bind_s: %s\n", ldap_err2string(rc));
     return( 1 );

   version = LDAP_VERSION3;
   rc = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
   if ( rc != LDAP_SUCCESS ) {
     fprintf(stderr, "Cannot set option: %s\n", ldap_err2string(rc));
     return( 1 );

   rc = ldap_search_s( ld, my_searchbase, LDAP_SCOPE_SUBTREE,
     attrs, 0, &result );