diff options
Diffstat (limited to 'src/back-sch.c')
-rw-r--r-- | src/back-sch.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/back-sch.c b/src/back-sch.c index 57c21e2..fec439a 100644 --- a/src/back-sch.c +++ b/src/back-sch.c @@ -266,7 +266,7 @@ backend_set_entry(Slapi_Entry *e, struct backend_set_data *data) Slapi_Entry *entry; Slapi_DN *e_dn, *sdn; Slapi_RDN *srdn; - Slapi_Value *value; + Slapi_Value *value[2]; plugin_id = data->common.state->plugin_desc->spd_id; e_dn = slapi_entry_get_sdn(e); @@ -300,7 +300,8 @@ backend_set_entry(Slapi_Entry *e, struct backend_set_data *data) time(NULL), 0); /* Iterate through the set of attributes. */ if (data->attribute_format != NULL) { - value = slapi_value_new(); + value[0] = slapi_value_new(); + value[1] = NULL; for (i = 0; data->attribute_format[i] != NULL; i++) { /* Expand the format specifier into a list. */ ava_lens = NULL; @@ -316,7 +317,7 @@ backend_set_entry(Slapi_Entry *e, struct backend_set_data *data) &ava_lens); if ((ava != NULL) && (ava_lens != NULL) && - (value != NULL)) { + (value[0] != NULL)) { for (j = 0; ava[j] != NULL; j++) { /* Assume attribute=value. */ val = memchr(ava[j], '=', @@ -327,21 +328,21 @@ backend_set_entry(Slapi_Entry *e, struct backend_set_data *data) if ((val != NULL) && (ava_lens[j] > val + 1 - ava[j])) { *val = '\0'; - slapi_value_set(value, + slapi_value_set(value[0], val + 1, ava_lens[j] - (val + 1 - ava[j])); - slapi_entry_add_value(entry, - ava[j], - value); + slapi_entry_merge_values_sv(entry, + ava[j], + value); *val = '='; } } } format_free_data_set(ava, ava_lens); } - slapi_value_free(&value); + slapi_value_free(&value[0]); } /* Try to make the entry look "right". */ if (!slapi_entry_rdn_values_present(entry)) { |