From:  "kapil.surlaker@gmail.com" <kapil.surlaker@gmail.com>
Date:  30 Dec 2005 07:10:49 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.directory
Subject:  

Version 3 client not following referrals automatically on windows

NNTP-Posting-Host:  71.130.37.114

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
this:

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.

Thanks,
Kapil


 /* 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,
my_filter2,
     attrs, 0, &result );