]> git.sur5r.net Git - openldap/commitdiff
Fix a SLAPI bug where slapd could crash if a preop plugin changed the mods
authorLuke Howard <lukeh@openldap.org>
Fri, 27 Aug 2004 17:12:01 +0000 (17:12 +0000)
committerLuke Howard <lukeh@openldap.org>
Fri, 27 Aug 2004 17:12:01 +0000 (17:12 +0000)
list and a subsequent plugin aborted the operation -- regardless of the
preop result the frontend must refetch the array of LDAPMods

servers/slapd/modify.c

index 083ba72120cae96b117b176b09d2ae890f28bc32..bfb284210850aec5f00443e18d5b9f377b56a95b 100644 (file)
@@ -422,6 +422,18 @@ fe_op_modify( Operation *op, SlapReply *rs )
 
                rs->sr_err = slapi_int_call_plugins( op->o_bd,
                        SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
+
+               /*
+                * It's possible that the preoperation plugin changed the
+                * modification array, so we need to convert it back to
+                * a Modification list.
+                *
+                * Calling slapi_int_modifications2ldapmods() destroyed modlist so
+                * we don't need to free it.
+                */
+               slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
+               modlist = slapi_int_ldapmods2modifications( modv );
+
                if ( rs->sr_err < 0 ) {
                        /*
                         * A preoperation plugin failure will abort the
@@ -445,17 +457,6 @@ fe_op_modify( Operation *op, SlapReply *rs )
                        modv = NULL;
                        goto cleanup;
                }
-
-               /*
-                * It's possible that the preoperation plugin changed the
-                * modification array, so we need to convert it back to
-                * a Modification list.
-                *
-                * Calling slapi_int_modifications2ldapmods() destroyed modlist so
-                * we don't need to free it.
-                */
-               slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
-               modlist = slapi_int_ldapmods2modifications( modv );
        }
 
        /*