diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-01-28 10:36:40 -0800 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-01-28 10:36:40 -0800 |
commit | 246527f4c01d32289e0082083d364563af59635a (patch) | |
tree | a317f382dd6cb8177f176532bc88455605ea8c5c /ldap/servers/slapd | |
parent | 3fdcbddd6c4939954e3393f78ded57cd253fa764 (diff) | |
download | ds-246527f4c01d32289e0082083d364563af59635a.tar.gz ds-246527f4c01d32289e0082083d364563af59635a.tar.xz ds-246527f4c01d32289e0082083d364563af59635a.zip |
247413 - Incorrect error on multiple identical value add
https://bugzilla.redhat.com/show_bug.cgi?id=247413
[Problem Description] Adding multiple identical values returns
"Operations error (LDAP_OPERATIONS_ERROR == 0x1)" instead of
"Type or value exists (LDAP_TYPE_OR_VALUE_EXISTS == 0x14)"
E.g.,
dn: ou=test,dc=example,dc=com
changetype: modify
replace: description
description: test
description: test
modifying entry "ou=test,dc=example,dc=com"
ldap_modify: Operations error (1)
[Fix Description] API valueset_replace used to override any
error from the lower layer with LDAP_OPERATIONS_ERROR. If
the error is LDAP_TYPE_OR_VALUE_EXISTS, the error is now
returned as is.
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r-- | ldap/servers/slapd/valueset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c index 3df302f3..7334a7a0 100644 --- a/ldap/servers/slapd/valueset.c +++ b/ldap/servers/slapd/valueset.c @@ -1358,7 +1358,9 @@ valueset_replace(Slapi_Attr *a, Slapi_ValueSet *vs, Slapi_Value **valstoreplace) Avlnode *vtree = NULL; rc = valuetree_add_valuearray( a->a_type, a->a_plugin, valstoreplace, &vtree, NULL ); valuetree_free(&vtree); - if ( LDAP_SUCCESS != rc ) + if ( LDAP_SUCCESS != rc && + /* bz 247413: don't override LDAP_TYPE_OR_VALUE_EXISTS */ + LDAP_TYPE_OR_VALUE_EXISTS != rc ) { /* There were already duplicate values in the value set */ rc = LDAP_OPERATIONS_ERROR; |