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:
Luke Howard 2005-08-08 09:33:02 +00:00
parent 17ffdc07b6
commit ef81368404
2 changed files with 28 additions and 1 deletions

View File

@ -490,7 +490,7 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
break;
case SLAPI_BACKEND:
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;
case SLAPI_BE_TYPE:
PBLOCK_ASSERT_OP( pb, 0 );

View File

@ -3452,6 +3452,33 @@ slapi_op_get_type(Slapi_Operation * op)
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
void
slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag)