/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
int manageDSAit;
Modifications **modtail = &op->ora_modlist;
int rc = 0;
- BackendDB *op_be;
+ BackendDB *op_be, *bd = op->o_bd;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
*/
op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
+ op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
if ( !rs->sr_ref ) rs->sr_ref = default_referral;
if ( rs->sr_ref ) {
rs->sr_err = LDAP_REFERRAL;
- op->o_bd = frontendDB;
send_ldap_result( op, rs );
- op->o_bd = NULL;
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
} else {
- op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
- op->o_bd = NULL;
}
goto done;
}
#endif /* SLAPD_MULTIMASTER */
}
} else {
- Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 );
- send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
+ Debug( LDAP_DEBUG_ARGS, "do_add: no backend support\n", 0, 0, 0 );
+ send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"operation not supported within namingContext" );
}
done:;
+ op->o_bd = bd;
return rc;
}
ptr = ber_bvchr( &csn, '#' );
if ( ptr ) {
timestamp.bv_len = ptr - csn.bv_val;
- if ( timestamp.bv_len >= sizeof(timebuf) )
+ if ( timestamp.bv_len >= sizeof(timebuf) ) /* ?!? */
timestamp.bv_len = sizeof(timebuf) - 1;
- strncpy( timebuf, csn.bv_val, timestamp.bv_len );
+ AC_MEMCPY( timebuf, csn.bv_val, timestamp.bv_len );
timebuf[timestamp.bv_len] = '\0';
} else {
time_t now = slap_get_time();
attr_merge_one( op->ora_e,
slap_schema.si_ad_modifyTimestamp, ×tamp, NULL );
}
-
}
return LDAP_SUCCESS;
}