mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Don't return frontend as SLAPI_BACKEND, return actual backend instead
for compat with 2.2 plugins Add a couple of backend SLAPI APIs
This commit is contained in:
parent
17ffdc07b6
commit
ef81368404
@ -490,7 +490,7 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
|
|||||||
break;
|
break;
|
||||||
case SLAPI_BACKEND:
|
case SLAPI_BACKEND:
|
||||||
PBLOCK_ASSERT_OP( pb, 0 );
|
PBLOCK_ASSERT_OP( pb, 0 );
|
||||||
*((BackendDB **)value) = pb->pb_op->o_bd;
|
*((BackendDB **)value) = select_backend( &pb->pb_op->o_req_ndn, 0, 0 );
|
||||||
break;
|
break;
|
||||||
case SLAPI_BE_TYPE:
|
case SLAPI_BE_TYPE:
|
||||||
PBLOCK_ASSERT_OP( pb, 0 );
|
PBLOCK_ASSERT_OP( pb, 0 );
|
||||||
|
@ -3452,6 +3452,33 @@ slapi_op_get_type(Slapi_Operation * op)
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void slapi_be_set_readonly( Slapi_Backend *be, int readonly )
|
||||||
|
{
|
||||||
|
if ( be == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( readonly )
|
||||||
|
be->be_restrictops |= SLAP_RESTRICT_OP_WRITES;
|
||||||
|
else
|
||||||
|
be->be_restrictops &= ~(SLAP_RESTRICT_OP_WRITES);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slapi_be_get_readonly( Slapi_Backend *be )
|
||||||
|
{
|
||||||
|
if ( be == NULL )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return ( (be->be_restrictops & SLAP_RESTRICT_OP_WRITES) == SLAP_RESTRICT_OP_WRITES );
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *slapi_x_be_get_updatedn( Slapi_Backend *be )
|
||||||
|
{
|
||||||
|
if ( be == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return be->be_update_ndn.bv_val;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void
|
void
|
||||||
slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag)
|
slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag)
|
||||||
|
Loading…
Reference in New Issue
Block a user