Wednesday, July 2, 2014

[389-commits] ldap/servers

ldap/servers/plugins/retrocl/retrocl_po.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 46a32692a8dd2b770e038b6418a8ba32c0099b8a
Author: Noriko Hosoi <nhosoi@redhat.com>
Date: Wed Jul 2 14:33:59 2014 -0700

Ticket #47839 - 389-ds production segfault: __memcpy_sse2_unaligned...

Bug description: modrdn2reple (retrocl_po.c) sets the given mods
to the changelog entry with "changes" attribute type if it includes
modifiersname, modifytimestamp, creatorsname, createtimestamp. When
the modrdn is internally initiated and passed mods do not include
the attributes (modifiersname, etc.), make_changes_string returns
empty lenstr. There were 2 issues:
1) there was nothing to add if lenstr was empty, but it was added.
2) there was a bug to set the length +1 even though the length was 0.

Fix description:
1) If there is nothing to add to the change attribute, skip calling
slapi_entry_add_values.
2) Remove adding "+1" for '\0' from the value length: val.bv_len.

https://fedorahosted.org/389/ticket/47839

Reviewed by rmeggins@redhat.com (Thank you, Rich!!)

diff --git a/ldap/servers/plugins/retrocl/retrocl_po.c b/ldap/servers/plugins/retrocl/retrocl_po.c
index 04687da..4b2cdda 100644
--- a/ldap/servers/plugins/retrocl/retrocl_po.c
+++ b/ldap/servers/plugins/retrocl/retrocl_po.c
@@ -544,9 +544,11 @@ modrdn2reple(
if (NULL != ldm) {
l = make_changes_string( ldm, lastmodattrs );
if ( NULL != l ) {
- val.bv_val = l->ls_buf;
- val.bv_len = l->ls_len + 1; /* string + terminating \0 */
- slapi_entry_add_values( e, attr_changes, vals );
+ if (l->ls_len) {
+ val.bv_val = l->ls_buf;
+ val.bv_len = l->ls_len;
+ slapi_entry_add_values( e, attr_changes, vals );
+ }
lenstr_free( &l );
}
}


--
389 commits mailing list
389-commits@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-commits

No comments:

Post a Comment