#include <ac/string.h>
#include <ac/socket.h>
+#include <ac/time.h>
#include "slap.h"
#include "back-ldbm.h"
* Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
*/
-int ldbm_internal_modify(
+int ldbm_modify_internal(
Backend *be,
Connection *conn,
Operation *op,
Entry *e
)
{
- int i, err;
+ int err;
LDAPMod *mod;
LDAPModList *ml;
case LDAP_MOD_REPLACE:
err = replace_values( e, mod, op->o_ndn );
break;
+
+ case LDAP_MOD_SOFTADD:
+ /* Avoid problems in index_add_mods()
+ * We need to add index if necessary.
+ */
+ mod->mod_op = LDAP_MOD_ADD;
+ if ( (err = add_values( e, mod, op->o_ndn ))
+ == LDAP_TYPE_OR_VALUE_EXISTS ) {
+
+ err = LDAP_SUCCESS;
+ mod->mod_op = LDAP_MOD_SOFTADD;
+
+ }
+ break;
}
if ( err != LDAP_SUCCESS ) {
return 0;
-}/* int ldbm_internal_modify() */
+}/* int ldbm_modify_internal() */
int
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
char *matched;
Entry *e;
- int err;
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
}
/* Modify the entry */
- if ( ldbm_internal_modify( be, conn, op, dn, modlist, e ) != 0 ) {
+ if ( ldbm_modify_internal( be, conn, op, dn, modlist, e ) != 0 ) {
goto error_return;
}
-
-
/* change the entry itself */
if ( id2entry_add( be, e ) != 0 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL, NULL );