Commit f7888739 authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Quanah Gibson-Mount
Browse files

ITS#9444 Pass original message when chain-return-error is set

parent 7bc9c290
......@@ -119,6 +119,7 @@ typedef struct ldap_chain_cb_t {
ldap_chain_status_t lb_status;
ldap_chain_t *lb_lc;
slap_operation_t lb_op_type;
char *lb_text;
int lb_depth;
} ldap_chain_cb_t;
......@@ -381,6 +382,11 @@ retry:;
break;
default:
/* remember the text before it's freed in ldap_back_op_result */
if ( lb.lb_text ) {
ber_memfree_x( lb.lb_text, op->o_tmpmemctx );
}
lb->lb_text = ber_strdup_x( rs->sr_text, op->o_tmpmemctx );
return rs->sr_err;
}
......@@ -1153,6 +1159,7 @@ cannot_chain:;
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
if ( LDAP_CHAIN_RETURN_ERR( lc ) ) {
sr_err = rs->sr_err = rc;
rs->sr_text = lb.lb_text;
rs->sr_type = sr_type;
} else {
......@@ -1186,6 +1193,13 @@ dont_chain:;
op->o_callback = sc;
op->o_ndn = ndn;
if ( rs->sr_text == lb.lb_text ) {
rs->sr_text = NULL;
}
if ( lb.lb_text ) {
ber_memfree_x( lb.lb_text, op->o_tmpmemctx );
}
return rc;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment