]> git.sur5r.net Git - openldap/commitdiff
Don't return frontend as SLAPI_BACKEND, return actual backend instead
authorLuke Howard <lukeh@openldap.org>
Mon, 8 Aug 2005 09:33:02 +0000 (09:33 +0000)
committerLuke Howard <lukeh@openldap.org>
Mon, 8 Aug 2005 09:33:02 +0000 (09:33 +0000)
for compat with 2.2 plugins

Add a couple of backend SLAPI APIs

servers/slapd/slapi/slapi_pblock.c
servers/slapd/slapi/slapi_utils.c

index 7e5339741911a77708b864df243f71b3a6e8200d..e273295c1ba5f2245ce669c07e73bde0c37f7bf4 100644 (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 );
index 8a7384687dc9321443942d5e0c32c547280cafd1..f2ac0cf24b3db170e46e1939af21af88caf0610c 100644 (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)