/* $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
fe_op_add( Operation *op, SlapReply *rs )
{
int manageDSAit;
- Modifications *modlist = op->ora_modlist;
- Modifications **modtail = &modlist;
+ Modifications **modtail = &op->ora_modlist;
int rc = 0;
- BackendDB *op_be;
+ BackendDB *op_be;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
goto done;
}
- rs->sr_err = slap_mods_obsolete_check( op, modlist,
+ rs->sr_err = slap_mods_obsolete_check( op, op->ora_modlist,
&rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
-#endif
+#endif /* ! SLAPD_MULTIMASTER */
{
int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
op->o_bd = op_be;
if ( !update ) {
- rs->sr_err = slap_mods_no_user_mod_check( op, modlist,
+ rs->sr_err = slap_mods_no_user_mod_check( op, op->ora_modlist,
&rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
if ( !repl_user ) {
/* go to the last mod */
- for ( modtail = &modlist;
+ for ( modtail = &op->ora_modlist;
*modtail != NULL;
modtail = &(*modtail)->sml_next )
{
/* check for duplicate values */
rs->sr_err = slap_mods_no_repl_user_mod_check( op,
- modlist, &rs->sr_text, textbuf, textlen );
+ op->ora_modlist, &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
goto done;
#ifdef SLAPD_MULTIMASTER
if ( !repl_user )
-#endif
+#endif /* SLAPD_MULTIMASTER */
{
cb.sc_next = op->o_callback;
op->o_callback = &cb;
snprintf( textbuf, textlen,
"attribute '%s' provided more than once",
mods->sml_desc->ad_cname.bv_val );
+ *text = textbuf;
return LDAP_TYPE_OR_VALUE_EXISTS;
#endif
}
snprintf( textbuf, textlen,
"%s: value #%d provided more than once",
mods->sml_desc->ad_cname.bv_val, j );
+ *text = textbuf;
return LDAP_TYPE_OR_VALUE_EXISTS;
} else if ( rc != LDAP_SUCCESS ) {
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;
}