#50597 Issue 50506 - Fix regression for relication stripattrs
Closed 3 years ago by spichugi. Opened 4 years ago by lkrispen.
lkrispen/389-ds-base t50506r  into  master

@@ -530,9 +530,10 @@ 

       *  Extract the attributes to strip for "empty" mods

       */

      ra->attrs_to_strip = NULL;

-     tmpstr = (char *)slapi_entry_attr_get_ref(e, type_nsds5ReplicaStripAttrs);

+     tmpstr = slapi_entry_attr_get_charptr(e, type_nsds5ReplicaStripAttrs);

      if (NULL != tmpstr) {

          ra->attrs_to_strip = slapi_str2charray_ext(tmpstr, " ", 0);

+         slapi_ch_free_string(&tmpstr);

      }

  

      if (!agmt_is_valid(ra)) {
@@ -2954,7 +2955,7 @@ 

  {

      char *tmpstr = NULL;

  

-     tmpstr = (char *)slapi_entry_attr_get_ref(e, type_nsds5ReplicaStripAttrs);

+     tmpstr = slapi_entry_attr_get_charptr(e, type_nsds5ReplicaStripAttrs);

  

      PR_Lock(ra->lock);

      if (ra->attrs_to_strip) {
@@ -2964,6 +2965,7 @@ 

          ra->attrs_to_strip = NULL;

      } else {

          ra->attrs_to_strip = slapi_str2charray_ext(tmpstr, " ", 0);

+         slapi_ch_free_string(&tmpstr);

      }

      PR_Unlock(ra->lock);

  

Bug: When parsing the provided attribute value, a reference was used
and modified, the original attribute was corrupted

Fix: Use a copy for parsing

Reviewed by: ?

LGTM. Ack
Have not found other place where slapi_entry_attr_get_ref is used for a list of values.

rebased onto 9e88e19

4 years ago

Pull-Request has been merged by lkrispen

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3653

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata