#define ATTR_STRING 4
struct ol_keyvalue {
- char* key;
+ const char * key;
int value;
};
-static struct ol_keyvalue deref_kv[] = {
+static const struct ol_keyvalue deref_kv[] = {
{"never", LDAP_DEREF_NEVER},
{"searching", LDAP_DEREF_SEARCHING},
{"finding", LDAP_DEREF_FINDING},
{NULL, 0}
};
-static struct ol_attribute {
+static const struct ol_attribute {
int type;
- char* name;
- void* data;
+ const char * name;
+ const void * data;
size_t offset;
} attrs[] = {
{ATTR_KV, "DEREF", deref_kv, /* or &deref_kv[0] */
break;
case ATTR_KV: {
- struct ol_keyvalue *kv;
+ const struct ol_keyvalue *kv;
- for(kv = (struct ol_keyvalue *) attrs[i].data;
+ for(kv = attrs[i].data;
kv->key != NULL;
kv++) {
}
}
}
+
+ fclose(fp);
}
static void openldap_ldap_init_w_userconf(const char *file)
break;
case ATTR_KV: {
- struct ol_keyvalue *kv;
+ const struct ol_keyvalue *kv;
- for(kv = (struct ol_keyvalue *) attrs[i].data;
+ for(kv = attrs[i].data;
kv->key != NULL;
kv++) {
return;
}
- ldap_pvt_init_utils();
+ ldap_int_utils_init();
gopts.ldo_version = LDAP_VERSION2;
gopts.ldo_deref = LDAP_DEREF_NEVER;
LDAP_BOOL_ZERO(&gopts);
-#if defined( LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS ) || \
- LDAP_VERSION_MAX > LDAP_VERSION2
LDAP_BOOL_SET(&gopts, LDAP_BOOL_REFERRALS);
-#endif
openldap_ldap_initialized = 1;