summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-02-25 19:07:25 -0700
committerRich Megginson <rmeggins@redhat.com>2010-02-26 11:20:01 -0700
commit38d13f961c0d8033aa3dd3e5a3a8f32bc1650691 (patch)
tree1219722457739f1b8b22e6b46fc8e9f3bfce83e5
parentea0cdc6ce1cf1c9a690acab443e6df11b3e0fe15 (diff)
downloadds-38d13f961c0d8033aa3dd3e5a3a8f32bc1650691.tar.gz
ds-38d13f961c0d8033aa3dd3e5a3a8f32bc1650691.tar.xz
ds-38d13f961c0d8033aa3dd3e5a3a8f32bc1650691.zip
389 DS segfaults on libsyntax-plugin.so - part 2
https://bugzilla.redhat.com/show_bug.cgi?id=516611 Resolves: bug 516611 Bug Description: 389 DS segfaults on libsyntax-plugin.so - part 2 Reviewed by: nkinder (Thanks!) Branch: HEAD Fix Description: If there is an empty mod/replace of a non-existent attribute following a real modify operation, the server will allow it, and the code in entry_delete_present_values_wsi() would create an empty Slapi_Attr. LDAP says that an empty mod/replace of a non-existent attribute should be ignored, as it is in the non-repl case. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
-rw-r--r--ldap/servers/slapd/entrywsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 5fcb30d7..14ff1634 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -646,7 +646,9 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
LDAPDebug( LDAP_DEBUG_ARGS, "could not find attribute %s\n", type, 0, 0 );
}
retVal= LDAP_NO_SUCH_ATTRIBUTE;
- if (LDAP_MOD_REPLACE == mod_op)
+ /* NOTE: LDAP says that a MOD REPLACE with no vals of a non-existent
+ attribute is a no-op - MOD REPLACE with some vals will add the attribute */
+ if ((LDAP_MOD_REPLACE == mod_op) && vals && vals[0])
{
/* Create a new attribute and set the adcsn */
Slapi_Attr *a = slapi_attr_new();