-/* Copyright (c) 2003 by International Business Machines, Inc.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
+ * Copyright 1999-2003 The OpenLDAP Foundation.
+ * Portions Copyright 2003 IBM Corporation.
+ * All rights reserved.
*
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 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 Apurva Kumar for inclusion
+ * in OpenLDAP Software.
*/
#include "portable.h"
#include "../../../libraries/libldap/ldap-int.h"
#include <sys/time.h>
-#ifdef LDAP_CACHING
-
static struct berval bv_queryid_any = BER_BVC( "(queryid=*)" );
static Attribute*
BerVarray value_array;
Attribute *uuid_attr, *attr;
Entry *e;
+ char textbuf[SLAP_TEXT_BUFLEN];
+ size_t textlen = sizeof(textbuf);
SlapReply sreply = {REP_RESULT};
sreply.sr_nentries = 0;
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ));
- dnPrettyNormal(0, &rs->sr_entry->e_name, &e->e_name, &e->e_nname, op->o_tmpmemctx);
+
+ dnPrettyNormal(0, &rs->sr_entry->e_name, &op_tmp.o_req_dn, &op_tmp.o_req_ndn, op->o_tmpmemctx);
+ ber_dupbv( &e->e_name, &op_tmp.o_req_dn );
+ ber_dupbv( &e->e_nname, &op_tmp.o_req_ndn );
+ sl_free( op_tmp.o_req_ndn.bv_val, op->o_tmpmemctx );
+ sl_free( op_tmp.o_req_dn.bv_val, op->o_tmpmemctx );
+ op_tmp.o_req_dn = e->e_name;
+ op_tmp.o_req_ndn = e->e_nname;
e->e_private = NULL;
e->e_attrs = NULL;
op_tmp.o_do_not_cache = 1;
op_tmp.ora_e = e;
- op_tmp.o_req_dn = e->e_name;
- op_tmp.o_req_ndn = e->e_nname;
rc = op->o_bd->be_add( &op_tmp, &sreply );
if ( rc != LDAP_SUCCESS ) {
if ( rc == LDAP_ALREADY_EXISTS ) {
- slap_entry2mods( e, &modlist, &text );
+ slap_entry2mods( e, &modlist, &text, textbuf, textlen );
op_tmp.o_tag = LDAP_REQ_MODIFY;
op_tmp.orm_modlist = modlist;
op_tmp.o_req_dn = e->e_name;
result->rc = info.added;
} else if ( rc == LDAP_REFERRAL ||
rc == LDAP_NO_SUCH_OBJECT ) {
- slap_entry2mods( e, &modlist, &text );
- syncrepl_add_glue( NULL, NULL, &op_tmp, e, modlist, 0, NULL, NULL );
+ syncrepl_add_glue( &op_tmp, e );
result->rc = info.added;
} else {
result->rc = 0;
{
for ( i = 0; i < nvals; i++ ) {
rc = attr->a_desc->ad_type->sat_equality->smr_normalize(
- 0,
+ 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], NULL );
return LDAP_SUCCESS;
}
-
-#endif /* LDAP_CACHING */