]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/add.c
Drop unnecessary memset()s
[openldap] / servers / slapd / back-meta / add.c
index 66afd66e11aa6e209199c9d9f8acff1c3b0d36f3..2d318bb1f04030d16459264cb230fe41419f92d5 100644 (file)
@@ -167,6 +167,7 @@ meta_back_add( Operation *op, SlapReply *rs )
        }
        attrs[ i ] = NULL;
 
+retry:;
        ctrls = op->o_ctrls;
        if ( ldap_back_proxy_authz_ctrl( &mc->mc_conns[ candidate ].msc_bound_ndn,
                mt->mt_version, &mt->mt_idassert, op, rs, &ctrls ) != LDAP_SUCCESS )
@@ -175,7 +176,6 @@ meta_back_add( Operation *op, SlapReply *rs )
                goto cleanup;
        }
 
-retry:;
        rs->sr_err = ldap_add_ext( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
                              attrs, ctrls, NULL, &msgid );
        rs->sr_err = meta_back_op_result( mc, op, rs, candidate, msgid,
@@ -183,6 +183,8 @@ retry:;
        if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
                do_retry = 0;
                if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) {
+                       /* if the identity changed, there might be need to re-authz */
+                       (void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
                        goto retry;
                }
        }