]> git.sur5r.net Git - openldap/commitdiff
Added support for LDAP_MOD_SOFTADD.
authorJuan Gomez <gomez@openldap.org>
Wed, 26 May 1999 11:45:17 +0000 (11:45 +0000)
committerJuan Gomez <gomez@openldap.org>
Wed, 26 May 1999 11:45:17 +0000 (11:45 +0000)
servers/slapd/back-ldbm/modify.c

index 4000c1f8ae8e0b36d8a30938d1db74156a536adb..e9460b1a2002694e6c9d2c2afac75e34a6f965f0 100644 (file)
@@ -144,6 +144,20 @@ int ldbm_modify_internal(
                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 ) {