summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-09-02 12:06:25 -0600
committerRich Megginson <rmeggins@redhat.com>2010-09-03 11:17:46 -0600
commit3c4185bb9fad50b44dc86b961d2e85535afe5e56 (patch)
tree200bbbba353babdfadfe3a007bdd640e3ae8b315
parent34c0dfe8e862d86591823004150e777b1e035b6e (diff)
downloadds-3c4185bb9fad50b44dc86b961d2e85535afe5e56.tar.gz
ds-3c4185bb9fad50b44dc86b961d2e85535afe5e56.tar.xz
ds-3c4185bb9fad50b44dc86b961d2e85535afe5e56.zip
use slapi_mods_init_passin/get_ldapmods_passout if modifying the smods
When using slapi_mods_init_byref/get_ldapmods_byref, the slapi_mods code expects the Slapi_Mods to be read-only. Since the usn code adds a mod to the list, it needs to use the slapi_mods_init_passin/get_ldapmods_passout APIs. This avoids an assertion when using --enable-debug.
-rw-r--r--ldap/servers/plugins/usn/usn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c
index 5dd5122b..914c7acc 100644
--- a/ldap/servers/plugins/usn/usn.c
+++ b/ldap/servers/plugins/usn/usn.c
@@ -374,12 +374,12 @@ _usn_mod_next_usn(LDAPMod ***mods, Slapi_Backend *be)
bvals[0] = &usn_berval;
bvals[1] = NULL;
- slapi_mods_init_byref(&smods, *mods);
+ slapi_mods_init_passin(&smods, *mods);
/* bvals is duplicated by ber_bvdup in slapi_mods_add_modbvps */
slapi_mods_add_modbvps(&smods, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES,
SLAPI_ATTR_ENTRYUSN, bvals);
- *mods = slapi_mods_get_ldapmods_byref(&smods);
+ *mods = slapi_mods_get_ldapmods_passout(&smods);
slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM,
"<-- _usn_mod_next_usn\n");