From: Luke Howard Date: Fri, 19 Dec 2003 10:10:59 +0000 (+0000) Subject: Fix slapi_modify_internal() to deal with just the modification type of X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~130 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=120adb6b1b5b4e3454e55a3ef0cc51908197bcd2;p=openldap Fix slapi_modify_internal() to deal with just the modification type of a mod operation --- diff --git a/servers/slapd/slapi/plugin.c b/servers/slapd/slapi/plugin.c index e2c8766964..70ebf60ef3 100644 --- a/servers/slapd/slapi/plugin.c +++ b/servers/slapd/slapi/plugin.c @@ -449,7 +449,7 @@ newExtendedOp( } rc = slapi_pblock_get( pPB,SLAPI_PLUGIN_EXT_OP_OIDLIST, &pTmpOIDs ); - if ( rc != LDAP_SUCCESS ) { + if ( rc != 0 ) { rc = LDAP_OTHER; goto error_return; } diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 8cfc95d74c..6444baa32c 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -714,7 +714,7 @@ slapi_add_internal( if ( rc == LDAP_SUCCESS ) { for ( i = 0, pMod = mods[0]; pMod != NULL; pMod = mods[++i] ) { - if ( (pMod->mod_op & ~LDAP_MOD_BVALUES) != LDAP_MOD_ADD ) { + if ( (pMod->mod_op & LDAP_MOD_OP ) != LDAP_MOD_ADD ) { rc = LDAP_OTHER; break; } @@ -969,7 +969,7 @@ slapi_modify_internal( mod = (Modifications *)ch_malloc( sizeof(Modifications) ); - mod->sml_op = pMod->mod_op; + mod->sml_op = pMod->mod_op & LDAP_MOD_OP; mod->sml_next = NULL; mod->sml_desc = NULL; mod->sml_type = tmp.sml_type; @@ -986,7 +986,7 @@ slapi_modify_internal( mod = (Modifications *) ch_malloc( sizeof(Modifications) ); - mod->sml_op = pMod->mod_op; + mod->sml_op = pMod->mod_op & LDAP_MOD_OP; mod->sml_next = NULL; mod->sml_desc = NULL; mod->sml_type = tmp.sml_type; @@ -996,7 +996,7 @@ slapi_modify_internal( *modtail = mod; modtail = &mod->sml_next; - switch( pMod->mod_op ) { + switch( pMod->mod_op & LDAP_MOD_OP ) { case LDAP_MOD_ADD: if ( mod->sml_bvalues == NULL ) { rs.sr_err = LDAP_PROTOCOL_ERROR;