diff options
author | Nathan Kinder <nkinder@redhat.com> | 2008-11-13 23:08:19 +0000 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2008-11-13 23:08:19 +0000 |
commit | 65e8b7e984129d767f6d766734e5bc1b9cac4ae0 (patch) | |
tree | ec16f39b0cfe4ec14f101f16540a36c20cbe6346 /ldap/servers/plugins/chainingdb | |
parent | 4ac6f61a5098060c6ec40435b8258e8eb9f3da03 (diff) | |
download | ds-65e8b7e984129d767f6d766734e5bc1b9cac4ae0.tar.gz ds-65e8b7e984129d767f6d766734e5bc1b9cac4ae0.tar.xz ds-65e8b7e984129d767f6d766734e5bc1b9cac4ae0.zip |
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.
Diffstat (limited to 'ldap/servers/plugins/chainingdb')
-rw-r--r-- | ldap/servers/plugins/chainingdb/cb_config.c | 20 | ||||
-rw-r--r-- | ldap/servers/plugins/chainingdb/cb_instance.c | 24 |
2 files changed, 22 insertions, 22 deletions
diff --git a/ldap/servers/plugins/chainingdb/cb_config.c b/ldap/servers/plugins/chainingdb/cb_config.c index f95723ff..1dab8462 100644 --- a/ldap/servers/plugins/chainingdb/cb_config.c +++ b/ldap/servers/plugins/chainingdb/cb_config.c @@ -429,17 +429,17 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr return SLAPI_DSE_CALLBACK_ERROR; } - if ( mods[i]->mod_op & LDAP_MOD_REPLACE) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { if (!done) { cb_unregister_all_supported_control(cb); done=1; } cb_register_supported_control(cb,config_attr_value,0); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) { + if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { cb_register_supported_control(cb,config_attr_value,0); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { cb_unregister_supported_control(cb,config_attr_value,0); } } @@ -450,7 +450,7 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr /* assume single-valued */ if (mods[i]->mod_op & LDAP_MOD_DELETE) cb_set_debug(0); - else if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) + else if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) cb_set_debug(1); } else if ( !strcasecmp ( attr_name, CB_CONFIG_GLOBAL_CHAINING_COMPONENTS )) { @@ -461,7 +461,7 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; - if ( mods[i]->mod_op & LDAP_MOD_REPLACE) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { if (!done) { charray_free(cb->config.chaining_components); cb->config.chaining_components=NULL; @@ -471,11 +471,11 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr charray_add(&cb->config.chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) { + if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { charray_add(&cb->config.chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { charray_remove(cb->config.chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value)), 0 /* freeit */); @@ -496,7 +496,7 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; - if ( mods[i]->mod_op & LDAP_MOD_REPLACE) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { if (!done) { charray_free(cb->config.chainable_components); cb->config.chainable_components=NULL; @@ -506,12 +506,12 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr slapi_dn_normalize(slapi_ch_strdup(config_attr_value) )); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) { + if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { charray_add(&cb->config.chainable_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value) )); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { charray_remove(cb->config.chainable_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value) ), diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 0e79b7e3..e430dca3 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -323,8 +323,8 @@ int cb_instance_modify_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* entr if ( !strcasecmp ( attr_name, CB_CONFIG_BINDUSER )) { /* Make sure value is not forbidden */ - if ((mods[i]->mod_op & LDAP_MOD_REPLACE) || - ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op) || + SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { rc = cb_instance_config_set((void *) inst, attr_name, cb_the_instance_config, mods[i]->mod_bvalues[0], returntext, @@ -333,8 +333,8 @@ int cb_instance_modify_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* entr } } - if ((mods[i]->mod_op & LDAP_MOD_DELETE) || - ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) || + SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { rc= LDAP_UNWILLING_TO_PERFORM; PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed", (mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding"); @@ -383,7 +383,7 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor PR_RWLock_Wlock(inst->rwl_config_lock); for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; - if ( mods[i]->mod_op & LDAP_MOD_REPLACE) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { if (!done) { charray_free(inst->illegal_attributes); inst->illegal_attributes=NULL; @@ -392,11 +392,11 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor charray_add(&inst->illegal_attributes, slapi_ch_strdup(config_attr_value)); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) { + if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { charray_add(&inst->illegal_attributes, slapi_ch_strdup(config_attr_value)); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { charray_remove(inst->illegal_attributes, slapi_ch_strdup(config_attr_value), 0 /* freeit */); @@ -417,7 +417,7 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor PR_RWLock_Wlock(inst->rwl_config_lock); for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; - if ( mods[i]->mod_op & LDAP_MOD_REPLACE) { + if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { if (!done) { charray_free(inst->chaining_components); inst->chaining_components=NULL; @@ -427,11 +427,11 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor charray_add(&inst->chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) { + if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { charray_add(&inst->chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); } else - if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { charray_remove(inst->chaining_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value)), 0 /* freeit */); @@ -447,8 +447,8 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor - if ((mods[i]->mod_op & LDAP_MOD_DELETE) || - ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) { + if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) || + SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { /* Special processing for binddn & password */ /* because they are optional */ |