free( mdn.bv_val );
}
- return( ldap_back_op_result( li, lc, conn, op, msgid, j ) );
+ return( ldap_back_op_result( li, lc, conn, op, msgid, j, 1 ) );
}
#ifdef ENABLE_REWRITE
struct slap_op *op);
int ldap_back_dobind(struct ldapinfo *li, struct ldapconn *lc, Connection *conn, Operation *op);
int ldap_back_map_result(int err);
-int ldap_back_op_result(struct ldapinfo *li, struct ldapconn *lc, Connection *conn, Operation *op,
- ber_int_t msgid, int rc);
+int ldap_back_op_result(struct ldapinfo *li, struct ldapconn *lc,
+ Connection *conn, Operation *op, ber_int_t msgid, int rc, int sendok);
int back_ldap_LTX_init_module(int argc, char *argv[]);
void ldap_back_dn_massage(struct ldapinfo *li, struct berval *dn,
/* method is always LDAP_AUTH_SIMPLE if we got here */
rc = ldap_sasl_bind(lc->ld, mdn.bv_val, LDAP_SASL_SIMPLE,
cred, op->o_ctrls, NULL, &msgid);
- rc = ldap_back_op_result( li, lc, conn, op, msgid, rc );
+ rc = ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 );
if (rc == LDAP_SUCCESS) {
lc->bound = 1;
if ( mdn.bv_val != dn->bv_val ) {
if ( !lc->bound ) {
rc = ldap_sasl_bind(lc->ld, lc->bound_dn.bv_val,
LDAP_SASL_SIMPLE, &lc->cred, NULL, NULL, &msgid);
- rc = ldap_back_op_result( li, lc, conn, op, msgid, rc );
+ rc = ldap_back_op_result( li, lc, conn, op, msgid, rc, 0 );
if (rc == LDAP_SUCCESS) {
lc->bound = 1;
}
int
ldap_back_op_result(struct ldapinfo *li, struct ldapconn *lc,
- Connection *conn, Operation *op, ber_int_t msgid, int err)
+ Connection *conn, Operation *op, ber_int_t msgid, int err, int sendok)
{
char *msg = NULL;
char *match = NULL;
+ char *mmatch = NULL;
LDAPMessage *res;
int rc;
/* internal ops must not reply to client */
if ( conn && !op->o_do_not_cache ) {
- char *mmatch = NULL;
#ifdef ENABLE_REWRITE
if (match) {
mmatch = mdn.bv_val;
}
#endif
- send_ldap_result( conn, op, err, mmatch, msg, NULL, NULL );
- if (mmatch != match) free(mmatch);
}
}
+ if (sendok || err != LDAP_SUCCESS) {
+ send_ldap_result( conn, op, err, mmatch, msg, NULL, NULL );
+ }
+ if (mmatch != match) free(mmatch);
if ( match ) free( match );
if ( msg ) free( msg );
return( (err==LDAP_SUCCESS) ? 0 : -1 );
free( mdn.bv_val );
}
- return( ldap_back_op_result( li, lc, conn, op, msgid, rc ) );
+ return( ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 ) );
}
free( mdn.bv_val );
}
- return( ldap_back_op_result( li, lc, conn, op, msgid, rc ) );
+ return( ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 ) );
}
ch_free(modv[i]->mod_bvalues);
ch_free(mods);
ch_free(modv);
- return( ldap_back_op_result( li, lc, conn, op, msgid, rc ));
+ return( ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 ));
}
free( mnewSuperior.bv_val );
}
- return( ldap_back_op_result( li, lc, conn, op, msgid, rc ) );
+ return( ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 ) );
}
: NULL, slimit, &msgid);
if ( rc != LDAP_SUCCESS ) {
fail:;
- rc = ldap_back_op_result(li, lc, conn, op, msgid, rc);
+ rc = ldap_back_op_result(li, lc, conn, op, msgid, rc, 0);
goto finish;
}