Browse Source

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.
Rich Megginson 15 năm trước cách đây
mục cha
commit
3c4185bb9f
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      ldap/servers/plugins/usn/usn.c

+ 2 - 2
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");