]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/add.c
Drop unnecessary memset()s
[openldap] / servers / slapd / back-meta / add.c
index 6ff7a9c81e0e92b009d05c69b20dc1fc65c0851d..2d318bb1f04030d16459264cb230fe41419f92d5 100644 (file)
@@ -86,7 +86,7 @@ meta_back_add( Operation *op, SlapReply *rs )
        for ( i = 0, a = op->ora_e->e_attrs; a; a = a->a_next ) {
                int                     j, is_oc = 0;
 
-               if ( !isupdate && !get_manageDIT( op ) && a->a_desc->ad_type->sat_no_user_mod  )
+               if ( !isupdate && !get_relax( op ) && a->a_desc->ad_type->sat_no_user_mod  )
                {
                        continue;
                }
@@ -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,14 +176,15 @@ 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,
-               mt->mt_timeout[ LDAP_BACK_OP_ADD ], LDAP_BACK_SENDRESULT );
+               mt->mt_timeout[ SLAP_OP_ADD ], LDAP_BACK_SENDRESULT );
        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;
                }
        }