Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv19705
Modified Files:
interopProvider.c
Log Message:
[ 3495060 ] verify filter and handler information during subscription
Index: interopProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopProvider.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- interopProvider.c 13 Feb 2012 22:48:59 -0000 1.51
+++ interopProvider.c 29 Feb 2012 22:46:06 -0000 1.52
@@ -720,6 +720,40 @@
return;
}
+/* feature #3495060 :76814 : Verify the filter and handler information */
+CMPIStatus
+verify_subscription(const CMPIContext * ctx,
+ const CMPIObjectPath *cop,
+ const CMPIInstance *ci)
+{
+ CMPIContext *ctxlocal = NULL;
+ CMPIStatus st = { CMPI_RC_OK, NULL };
+
+ CMPIData sub_filter = CMGetProperty(ci, "Filter", &st);
+ CMPIObjectPath *sub_filter_op = sub_filter.value.ref;
+ ctxlocal = prepareUpcall((CMPIContext *)ctx);
+ CMPIInstance *sub_filter_inst = CBGetInstance(_broker, ctxlocal,
+ sub_filter_op, NULL, &st);
+ if (sub_filter_inst == NULL) {
+ setStatus(&st,st.rc,"Invalid Subscription Filter");
+ CMRelease(ctxlocal);
+ return st;
+ }
+
+ CMPIData sub_handler = CMGetProperty(ci, "Handler", &st);
+ CMPIObjectPath *sub_handler_op = sub_handler.value.ref;
+ CMPIInstance *sub_handler_inst = CBGetInstance(_broker, ctxlocal,
+ sub_handler_op, NULL, &st);
+ if (sub_handler_inst == NULL) {
+ setStatus(&st,st.rc,"Invalid Subscription Handler");
+ CMRelease(ctxlocal);
+ return st;
+ }
+
+ CMRelease(ctxlocal);
+ return st;
+}
+
/* --------------------------------------------------------------------------*/
/* Instance Provider Interface */
/* --------------------------------------------------------------------------*/
@@ -856,6 +890,9 @@
if(isa(nss, cns, "cim_indicationsubscription")) {
_SFCB_TRACE(1,("--- create cim_indicationsubscription"));
+ st = verify_subscription(ctx, cop, ci); /* 3495060 */
+ if (st.rc != CMPI_RC_OK) _SFCB_RETURN(st);
+
st=processSubscription(_broker,ctx,ciLocal,copLocal);
}
else if (isa(nss, cns, "cim_indicationfilter")) {
|