]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
Bug fix for new sockbuf code under NT. Added mutex protection against
[openldap] / servers / slapd / modify.c
index 394956569d9052bd660ebc92c8ebf367e9c099ae..af40315e35c028dbb374e33aaa97d8f58f71e0dd 100644 (file)
@@ -310,6 +310,9 @@ int slap_modlist2mods(
                mod = (Modifications *)
                        ch_calloc( 1, sizeof(Modifications) );
 
+               /* copy the op */
+               mod->sml_op = ml->ml_op;
+
                /* convert to attribute description */
                rc = slap_str2ad( ml->ml_type, &mod->sml_desc, text );
 
@@ -379,7 +382,7 @@ int slap_modlist2mods(
                         * a rough single value check... an additional check is needed
                         * to catch add of single value to existing single valued attribute
                         */
-                       if( ( ml->ml_op == LDAP_MOD_ADD || ml->ml_op == LDAP_MOD_REPLACE )
+                       if( ( mod->sml_op == LDAP_MOD_ADD || mod->sml_op == LDAP_MOD_REPLACE )
                                && nvals > 1 && is_at_single_value( ad->ad_type ))
                        {
                                slap_mods_free( mod );
@@ -453,7 +456,7 @@ int slap_mods_opattrs(
 
        mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
        mod->sml_op = mop;
-       mod->sml_desc = slap_schema.si_ad_modifiersName;
+       mod->sml_desc = ad_dup( slap_schema.si_ad_modifiersName );
        mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
        mod->sml_bvalues[0] = ber_bvdup( &name );
        mod->sml_bvalues[1] = NULL;
@@ -462,7 +465,7 @@ int slap_mods_opattrs(
 
        mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
        mod->sml_op = mop;
-       mod->sml_desc = slap_schema.si_ad_modifyTimestamp;
+       mod->sml_desc = ad_dup( slap_schema.si_ad_modifyTimestamp );
        mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
        mod->sml_bvalues[0] = ber_bvdup( &timestamp );
        mod->sml_bvalues[1] = NULL;