-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1999-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
*
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by the Howard Chu for inclusion
+ * in OpenLDAP Software and subsequently enhanced by Pierangelo
+ * Masarati.
+ */
+/* This is an altered version */
+/*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
*
* This work has been developed to fulfill the requirements
int isroot = 0;
dncookie dc;
-#ifdef LDAP_CACHING
cache_manager* cm = li->cm;
if (cm->caching) {
- return meta_back_cache_search(op->o_bd, op->o_conn, op,
- &op->o_req_dn, &op->o_req_ndn,
- op->oq_search.rs_scope,
- op->oq_search.rs_deref,
- op->oq_search.rs_slimit,
- op->oq_search.rs_tlimit,
- op->oq_search.rs_filter,
- &op->oq_search.rs_filterstr,
- op->oq_search.rs_attrs,
- op->oq_search.rs_attrsonly);
+ return meta_back_cache_search(op, rs);
}
-#endif /* LDAP_CACHING */
/*
* controls are set in ldap_back_dobind()
* from the one known to the meta, and a DN with unknown
* attributes is returned.
*
- * FIXME: should we log anything, or delegate to dnNormalize2?
+ * FIXME: should we log anything, or delegate to dnNormalize?
*/
- if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname, &op->o_tmpmemctx ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &ent.e_name, &ent.e_nname,
+ &op->o_tmpmemctx ) != LDAP_SUCCESS )
+ {
return LDAP_INVALID_DN_SYNTAX;
}
dc.ctx = "searchAttrDN";
while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
+ int last = 0;
+
ldap_back_map( &li->targets[ target ]->rwmap.rwm_at,
&a, &mapped, BACKLDAP_REMAP );
if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' ) {
} else if ( attr->a_desc == slap_schema.si_ad_objectClass
|| attr->a_desc == slap_schema.si_ad_structuralObjectClass ) {
- int last;
for ( last = 0; attr->a_vals[ last ].bv_val; ++last );
ldap_dnattr_result_rewrite( &dc, attr->a_vals );
}
+ if ( last && attr->a_desc->ad_type->sat_equality &&
+ attr->a_desc->ad_type->sat_equality->smr_normalize ) {
+ int i;
+
+ attr->a_nvals = ch_malloc((last + 1)*sizeof(struct berval));
+ for ( i = 0; i<last; i++ ) {
+ attr->a_desc->ad_type->sat_equality->smr_normalize(
+ SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
+ attr->a_desc->ad_type->sat_syntax,
+ attr->a_desc->ad_type->sat_equality,
+ &attr->a_vals[i], &attr->a_nvals[i],
+ op->o_tmpmemctx );
+ }
+ attr->a_nvals[i].bv_val = NULL;
+ attr->a_nvals[i].bv_len = 0;
+ } else {
+ attr->a_nvals = attr->a_vals;
+ }
+
*attrp = attr;
attrp = &attr->a_next;
}