REGISTER_MAIN_LONG_CONSTANT("LDAP_OPT_RESTART", LDAP_OPT_RESTART, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("LDAP_OPT_HOST_NAME", LDAP_OPT_HOST_NAME, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("LDAP_OPT_ERROR_STRING", LDAP_OPT_ERROR_STRING, CONST_PERSISTENT | CONST_CS);
+#ifndef HAVE_NSLDAP
REGISTER_MAIN_LONG_CONSTANT("LDAP_OPT_MATCHED_DN", LDAP_OPT_MATCHED_DN, CONST_PERSISTENT | CONST_CS);
#endif
+#endif
#ifdef ORALDAP
REGISTER_MAIN_LONG_CONSTANT("GSLC_SSL_NO_AUTH", GSLC_SSL_NO_AUTH, CONST_PERSISTENT | CONST_CS);
/* sizelimit */
if(ldap_sizelimit > -1) {
-#if ( LDAP_API_VERSION < 2004 ) || HAVE_NSLDAP
- ldap->ld_sizelimit = ldap_sizelimit;
-#else
+#if ( LDAP_API_VERSION >= 2004 ) || HAVE_NSLDAP
ldap_set_option(ldap, LDAP_OPT_SIZELIMIT, &ldap_sizelimit);
+#else
+ ldap->ld_sizelimit = ldap_sizelimit;
#endif
}
/* timelimit */
if(ldap_timelimit > -1) {
-#if ( LDAP_API_VERSION < 2004 ) || HAVE_NSLDAP
- ldap->ld_timelimit = ldap_timelimit;
-#else
+#if ( LDAP_API_VERSION >= 2004 ) || HAVE_NSLDAP
ldap_set_option(ldap, LDAP_OPT_TIMELIMIT, &ldap_timelimit);
+#else
+ ldap->ld_timelimit = ldap_timelimit;
#endif
}
/* deref */
if(ldap_deref > -1) {
-#if ( LDAP_API_VERSION < 2004 ) || HAVE_NSLDAP
- ldap->ld_deref = ldap_deref;
-#else
+#if ( LDAP_API_VERSION >= 2004 ) || HAVE_NSLDAP
ldap_set_option(ldap, LDAP_OPT_DEREF, &ldap_deref);
+#else
+ ldap->ld_deref = ldap_deref;
#endif
}
/* options with string value */
case LDAP_OPT_HOST_NAME:
case LDAP_OPT_ERROR_STRING:
+#ifndef HAVE_NSLDAP
case LDAP_OPT_MATCHED_DN:
+#endif
{
char *val;
if (ldap_get_option(ldap, opt, &val)) {
/* options with string value */
case LDAP_OPT_HOST_NAME:
case LDAP_OPT_ERROR_STRING:
+#ifndef HAVE_NSLDAP
case LDAP_OPT_MATCHED_DN:
+#endif
{
char *val;
convert_to_string_ex(newval);