for (i=0, a=e->e_attrs; a; i++, a=a->a_next) {
attrs[i] = (LDAPMod *)ch_malloc(sizeof(LDAPMod));
attrs[i]->mod_op = LDAP_MOD_BVALUES;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ attrs[i]->mod_type = a->a_desc->ad_cname->bv_val;
+#else
attrs[i]->mod_type = a->a_type;
+#endif
attrs[i]->mod_vals.modv_bvals = a->a_vals;
}
Operation *op,
const char *dn,
const char *ndn,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ AttributeAssertion *ava
+#else
Ava *ava
+#endif
)
{
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
return( -1 );
}
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ ldap_compare_s( lc->ld, dn, ava->aa_desc->ad_cname->bv_val, ava->aa_value->bv_val );
+#else
ldap_compare_s( lc->ld, dn, ava->ava_type, ava->ava_value.bv_val );
+#endif
return( ldap_back_op_result( lc, op ) );
}
Filter *filter, const char *filterstr,
char **attrs, int attrsonly ));
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+extern int ldap_back_compare LDAP_P(( BackendDB *bd,
+ Connection *conn, Operation *op,
+ const char *dn, const char *ndn,
+ AttributeAssertion *ava ));
+#else
extern int ldap_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- const char *dn, const char *ndn, Ava *ava ));
+ const char *dn, const char *ndn,
+ Ava *ava ));
+#endif
extern int ldap_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
extern int ldap_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+extern int ldap_back_group LDAP_P(( BackendDB *bd,
+ Entry *target,
+ const char* gr_ndn,
+ const char* op_ndn,
+ ObjectClass* group_oc,
+ AttributeDescription* group_at));
+#else
+extern int ldap_back_group LDAP_P(( BackendDB *bd,
+ Entry *target,
+ const char* gr_ndn, const char* op_ndn,
+ const char* group_oc,
+ const char* group_at));
+#endif
+
LDAP_END_DECL
#endif /* _LDAP_EXTERNAL_H */
BerElement *ber = NULL;
Attribute *attr, **attrp;
struct berval *dummy = NULL;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ char *text;
+#endif
ent.e_dn = ldap_get_dn(lc->ld, e);
ent.e_ndn = ch_strdup( ent.e_dn);
a = ldap_next_attribute(lc->ld, e, ber)) {
attr = (Attribute *)ch_malloc( sizeof(Attribute) );
attr->a_next = 0;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* FIXME: we assume here that the local server knows about
+ * all the attributes that the remote server might send.
+ * How should this really be handled?
+ */
+ slap_str2ad(a, &attr->a_desc, &text);
+#else
attr->a_type = ch_strdup(a);
attr->a_syntax = attr_syntax(a);
+#endif
attr->a_vals = ldap_get_values_len(lc->ld, e, a);
if (!attr->a_vals)
attr->a_vals = &dummy;
for (;ent.e_attrs;) {
attr=ent.e_attrs;
ent.e_attrs = attr->a_next;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
free(attr->a_type);
+#endif
if (attr->a_vals != &dummy)
ber_bvecfree(attr->a_vals);
free(attr);