ldap/servers/slapd/back-ldbm/ldbm_config.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit ede5dec6304ef8beeb08bc2c7c9ba92484d29a7d Author: Rich Megginson rmeggins@redhat.com Date: Thu Sep 29 16:34:39 2011 -0600
Bug 741744 - part2 - MOD operations with chained delete/add get back error 53 on backend config
https://bugzilla.redhat.com/show_bug.cgi?id=741744 Resolves: bug 741744 Bug Description: part2 - MOD operations with chained delete/add get back error 53 on backend config Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: If a value was specified with a mod delete, fail the entire modify operation with LDAP_NO_SUCH_ATTRIBUTE if the specified value does not match the current value. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index 44c7ff9..44cda4c 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1637,6 +1637,19 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc return LDAP_OBJECT_CLASS_VIOLATION; } } + + /* if delete, and a specific value was provided to delete, the existing value must + match that value, or return LDAP_NO_SUCH_ATTRIBUTE */ + if (SLAPI_IS_MOD_DELETE(mod_op) && bval && bval->bv_len && bval->bv_val) { + char buf[BUFSIZ]; + ldbm_config_get(arg, config, buf); + if (PL_strncmp(buf, bval->bv_val, bval->bv_len)) { + PR_snprintf(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, + "value [%s] for attribute %s does not match existing value [%s].\n", + bval->bv_val, attr_name, buf); + return LDAP_NO_SUCH_ATTRIBUTE; + } + }
switch(config->config_type) { case CONFIG_TYPE_INT:
389-commits@lists.fedoraproject.org