mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
A better approach for detach_op
This commit is contained in:
parent
bbe93b5141
commit
4b736945be
@ -1514,10 +1514,16 @@ syncprov_detach_op( Operation *op, syncops *so )
|
||||
op->o_req_ndn.bv_len + 1 +
|
||||
op->o_ndn.bv_len + 1 +
|
||||
so->s_filterstr.bv_len + 1;
|
||||
op2 = (Operation *)ch_malloc( size );
|
||||
*op2 = *op;
|
||||
op2 = (Operation *)ch_calloc( 1, size );
|
||||
op2->o_hdr = (Opheader *)(op2+1);
|
||||
|
||||
/* Copy the fields we care about explicitly, leave the rest alone */
|
||||
*op2->o_hdr = *op->o_hdr;
|
||||
op2->o_tag = op->o_tag;
|
||||
op2->o_time = op->o_time;
|
||||
op2->o_bd = op->o_bd;
|
||||
op2->o_request = op->o_request;
|
||||
|
||||
if ( i ) {
|
||||
op2->ors_attrs = (AttributeName *)(op2->o_hdr + 1);
|
||||
ptr = (char *)(op2->ors_attrs+i+1);
|
||||
@ -1541,8 +1547,6 @@ syncprov_detach_op( Operation *op, syncops *so )
|
||||
strcpy( ptr, so->s_filterstr.bv_val );
|
||||
op2->ors_filterstr.bv_len = so->s_filterstr.bv_len;
|
||||
op2->ors_filter = str2filter( ptr );
|
||||
op2->o_controls = NULL;
|
||||
op2->o_callback = NULL;
|
||||
so->s_op = op2;
|
||||
|
||||
/* Copy any cached group ACLs individually */
|
||||
|
Loading…
Reference in New Issue
Block a user