mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
Add pblock_be_call() for calling against actual backend
This commit is contained in:
parent
2ffdbf7fef
commit
06f8a27771
@ -420,6 +420,24 @@ pblock_set_default( Slapi_PBlock *pb, int param, void *value )
|
|||||||
return PBLOCK_SUCCESS;
|
return PBLOCK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
pblock_be_call( Slapi_PBlock *pb, int (*bep)(Operation *) )
|
||||||
|
{
|
||||||
|
BackendDB *be_orig;
|
||||||
|
Operation *op;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
PBLOCK_ASSERT_OP( pb, 0 );
|
||||||
|
op = pb->pb_op;
|
||||||
|
|
||||||
|
be_orig = op->o_bd;
|
||||||
|
op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
|
||||||
|
rc = (*bep)( op );
|
||||||
|
op->o_bd = be_orig;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pblock_get( Slapi_PBlock *pb, int param, void **value )
|
pblock_get( Slapi_PBlock *pb, int param, void **value )
|
||||||
{
|
{
|
||||||
@ -485,12 +503,10 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
|
|||||||
*((char **)value) = pb->pb_op->o_req_ndn.bv_val;
|
*((char **)value) = pb->pb_op->o_req_ndn.bv_val;
|
||||||
break;
|
break;
|
||||||
case SLAPI_REQUESTOR_ISROOT:
|
case SLAPI_REQUESTOR_ISROOT:
|
||||||
PBLOCK_ASSERT_OP( pb, 0 );
|
*((int *)value) = pblock_be_call( pb, be_isroot );
|
||||||
*((int *)value) = be_isroot( pb->pb_op );
|
|
||||||
break;
|
break;
|
||||||
case SLAPI_IS_REPLICATED_OPERATION:
|
case SLAPI_IS_REPLICATED_OPERATION:
|
||||||
PBLOCK_ASSERT_OP( pb, 0 );
|
*((int *)value) = pblock_be_call( pb, be_slurp_update );
|
||||||
*((int *)value) = be_isupdate( pb->pb_op );
|
|
||||||
break;
|
break;
|
||||||
case SLAPI_CONN_AUTHTYPE:
|
case SLAPI_CONN_AUTHTYPE:
|
||||||
case SLAPI_CONN_AUTHMETHOD: /* XXX should return SASL mech */
|
case SLAPI_CONN_AUTHMETHOD: /* XXX should return SASL mech */
|
||||||
|
Loading…
Reference in New Issue
Block a user