* }
*/
- e = (Entry *) ch_calloc( 1, sizeof(Entry) );
- /* initialize reader/writer lock */
- entry_rdwr_init(e);
-
/* get the name */
if ( ber_scanf( ber, "{a", &dn ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
"decoding error" );
return;
}
+
+ e = (Entry *) ch_calloc( 1, sizeof(Entry) );
+ /* initialize reader/writer lock */
+ entry_rdwr_init(e);
+
e->e_dn = dn;
- dn = dn_normalize( ch_strdup( dn ) );
- Debug( LDAP_DEBUG_ARGS, " do_add: dn (%s)\n", dn, 0, 0 );
+ e->e_ndn = dn_normalize_case( ch_strdup( dn ) );
+ dn = NULL;
+
+ Debug( LDAP_DEBUG_ARGS, " do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
/* get the attrs */
e->e_attrs = NULL;
0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL,
NULL );
+ free( type );
entry_free( e );
return;
}
}
Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d ADD dn=\"%s\"\n",
- conn->c_connid, op->o_opid, dn, 0, 0 );
+ conn->c_connid, op->o_opid, e->e_ndn, 0, 0 );
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- if ( (be = select_backend( dn )) == NULL ) {
+ be = select_backend( e->e_ndn );
+ if ( be == NULL ) {
entry_free( e );
send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS, NULL,
default_referral );
*/
if ( be->be_add != NULL ) {
/* do the update here */
- if ( be->be_updatedn == NULL ||
- strcasecmp( be->be_updatedn, op->o_dn ) == 0 ) {
-
+ if ( be->be_update_ndn == NULL ||
+ strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
+ {
if ( (be->be_lastmod == ON || (be->be_lastmod == UNDEFINED &&
- global_lastmod == ON)) && be->be_updatedn == NULL ) {
+ global_lastmod == ON)) && be->be_update_ndn == NULL ) {
add_created_attrs( op, e );
}
}
attr_merge( e, "creatorsname", bvals );
- pthread_mutex_lock( ¤ttime_mutex );
+ ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
#ifndef LDAP_LOCALTIME
ltm = gmtime( ¤ttime );
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
ltm = localtime( ¤ttime );
strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
#endif
- pthread_mutex_unlock( ¤ttime_mutex );
+ ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
bv.bv_val = buf;
bv.bv_len = strlen( bv.bv_val );