You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(1) |
Mar
(45) |
Apr
(150) |
May
(145) |
Jun
(150) |
Jul
(79) |
Aug
(313) |
Sep
(160) |
Oct
(309) |
Nov
(115) |
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(160) |
Feb
(144) |
Mar
(127) |
Apr
(48) |
May
(102) |
Jun
(54) |
Jul
(245) |
Aug
(94) |
Sep
(152) |
Oct
(162) |
Nov
(166) |
Dec
(740) |
| 2007 |
Jan
(752) |
Feb
(437) |
Mar
(328) |
Apr
(373) |
May
(569) |
Jun
(399) |
Jul
(369) |
Aug
(627) |
Sep
(100) |
Oct
(306) |
Nov
(166) |
Dec
(282) |
| 2008 |
Jan
(68) |
Feb
(145) |
Mar
(180) |
Apr
(160) |
May
(277) |
Jun
(229) |
Jul
(1188) |
Aug
(51) |
Sep
(97) |
Oct
(99) |
Nov
(95) |
Dec
(170) |
| 2009 |
Jan
(39) |
Feb
(73) |
Mar
(120) |
Apr
(121) |
May
(104) |
Jun
(262) |
Jul
(57) |
Aug
(171) |
Sep
(131) |
Oct
(88) |
Nov
(64) |
Dec
(83) |
| 2010 |
Jan
(55) |
Feb
(67) |
Mar
(124) |
Apr
(64) |
May
(130) |
Jun
(75) |
Jul
(164) |
Aug
(64) |
Sep
(44) |
Oct
(17) |
Nov
(43) |
Dec
(31) |
| 2011 |
Jan
(21) |
Feb
(10) |
Mar
(43) |
Apr
(46) |
May
(52) |
Jun
(71) |
Jul
(7) |
Aug
(16) |
Sep
(51) |
Oct
(14) |
Nov
(33) |
Dec
(15) |
| 2012 |
Jan
(12) |
Feb
(61) |
Mar
(129) |
Apr
(76) |
May
(70) |
Jun
(52) |
Jul
(29) |
Aug
(41) |
Sep
(32) |
Oct
(23) |
Nov
(38) |
Dec
(26) |
| 2013 |
Jan
(35) |
Feb
(37) |
Mar
(51) |
Apr
(15) |
May
(52) |
Jun
(15) |
Jul
(23) |
Aug
(21) |
Sep
(46) |
Oct
(69) |
Nov
(57) |
Dec
(26) |
| 2014 |
Jan
(5) |
Feb
(13) |
Mar
(17) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: Narasimha S. <nsh...@us...> - 2012-02-29 22:46:09
|
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")) {
|
|
From: Narasimha S. <nsh...@us...> - 2012-02-29 22:45:39
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv19647
Modified Files:
indCIMXMLHandler.c
Log Message:
[ 3495060 ] verify filter and handler information during subscription
Index: indCIMXMLHandler.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/indCIMXMLHandler.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- indCIMXMLHandler.c 11 Feb 2012 18:30:54 -0000 1.43
+++ indCIMXMLHandler.c 29 Feb 2012 22:45:36 -0000 1.44
@@ -878,6 +878,10 @@
CMPIData handler=CMGetProperty(sub, "Handler", &st);
CMPIObjectPath *hop=handler.value.ref;
CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st);
+ if (hdlr == NULL) {
+ mlogf(M_ERROR,M_SHOW,"Deliver indication failed, hdlr is null. rc:%d\n",st.rc);
+ _SFCB_RETURN(st);
+ }
// Build the complete sequence context
// Get the stub from the handler
|
|
From: Chris B. <buc...@us...> - 2012-02-29 22:24:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 74cc8e1c1a06715cc771969683cbfb98276c0539 (commit)
via f4126559da38d12f69ca099101e81bbc22688d6d (commit)
via 6b4723acedd91cf702876db782a5eb2a23a0de94 (commit)
via 640d608fa0b0601df86124ba0078777993e31551 (commit)
via 61def9cbb352449968ee527106089dfd1a9b3788 (commit)
from c14fdc6674ac4982b1cf5a5219ab89ad0e8126f9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 74cc8e1c1a06715cc771969683cbfb98276c0539
Merge: f412655 c14fdc6
Author: buccella <buc...@li...>
Date: Wed Feb 29 17:24:40 2012 -0500
merging helerda commit
commit f4126559da38d12f69ca099101e81bbc22688d6d
Author: buccella <buc...@li...>
Date: Wed Feb 29 17:13:12 2012 -0500
[ 3495806 ] isChild() can cause a provider mismatch
commit 6b4723acedd91cf702876db782a5eb2a23a0de94
Author: buccella <buc...@li...>
Date: Wed Feb 29 16:32:10 2012 -0500
[ 3495804 ] Cleanup: httpProcId still defined, wrong define in cimXmlGen
commit 640d608fa0b0601df86124ba0078777993e31551
Author: buccella <buc...@li...>
Date: Wed Feb 29 15:32:15 2012 -0500
[ 3495789 ] Makefile improvements for test suite
commit 61def9cbb352449968ee527106089dfd1a9b3788
Author: buccella <buc...@li...>
Date: Wed Feb 29 15:18:03 2012 -0500
[ 3493493 ] Add sfcbsem
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 1bd0619..e047138 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2012-02-29 Chris Buccella <buc...@li...>
+
+ * providerMgr.c:
+ [ 3495806 ] isChild() can cause a provider mismatch
+ (patch by Viktor Mihajlovski)
+
+ * msgqueue.h, msgqueue.c, cimXmlGen.h:
+ [ 3495804 ] Cleanup: httpProcId still defined, wrong define in cimXmlGen
+
+ * Makefile.am, test/Makefile.am,
+ test/TestProviders/tests/IndRetryTest.sh,
+ test/TestProviders/tests/Makefile.am,
+ test/TestProviders/tests/xmltest.sh,
+ test/commands/Makefile.am, test/commands/sfcbdump.sh,
+ test/unittest/Makefile.am, test/xmltest/Makefile.am,
+ test/xmltest/xmltest.sh:
+ [ 3495789 ] Makefile improvements for test suite
+ (code by Viktor Mihajlovski)
+
2012-02-29 Dave Heller <hel...@us...>
* cimslpSLP.c:
@@ -10,6 +29,10 @@
2012-02-28 Chris Buccella <buc...@li...>
+ * sfcbsem.c, Makefile.am:
+ [ 3493493 ] Add sfcbsem
+ (code by Viktor Mihajlovski)
+
* interopServerProvider.c
[ 3416164 ] Don't write CIM_IndicationService to disk
diff --git a/Makefile.am b/Makefile.am
index d4c85dc..c50bf30 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -524,7 +524,7 @@ install-data-local:
fi;
$(INSTALL_DATA) $(srcdir)/10_interop.mof $(DESTDIR)$(sfcbstatedir)/stage/mofs/root/interop
if INDICATIONS
- $(INSTALL_DATA) $(srcdir)/20_indication.mof $(DESTDIR)$(sfcbstatedir)/stage/mofs/root/interop
+ $(INSTALL_DATA) 20_indication.mof $(DESTDIR)$(sfcbstatedir)/stage/mofs/root/interop
$(INSTALL_DATA) $(srcdir)/indication.mof $(DESTDIR)$(sfcbstatedir)/stage/mofs
endif
if ACCOUNT_PASSTHRU
@@ -613,5 +613,5 @@ pretty:
postinstall: install-cimschema create-sslkeys
test -f $(DESTDIR)$(sfcbstatedir)/registration/providerRegister || $(INSTALL_DATA) $(DESTDIR)$(sfcbstatedir)/stage/default.reg $(DESTDIR)$(sfcbstatedir)/registration/providerRegister
if TEST_ENABLED
- ./test/stageschema.sh -d test/schema -p $(prefix)
+ $(srcdir)/test/stageschema.sh -d $(srcdir)/test/schema -p $(prefix)
endif
diff --git a/NEWS b/NEWS
index 2507d07..724f91a 100644
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,8 @@ Everything in 1.3.13 and 1.3.14, plus:
New features:
- 3441679 Add a feature to validate CMPI types
-Bugs fixed:
-- 3495343 Bad pointer references in trace statements
-- 3495801 Correction to 3495343
+Bugs fixed:
+- 3495804 Cleanup: httpProcId still defined, wrong define in cimXmlGen
Changes in 1.4.2
================
@@ -89,6 +88,10 @@ Everything in 1.3.10, plus:
Changes in 1.3.14
=================
+New Features:
+
+- 3493493 Add sfcbsem
+
Bugs Fixed:
- 3414700 assocClass ignored for assoc upcalls
@@ -96,6 +99,10 @@ Bugs Fixed:
- 3416167 CIM_InstDeletion not in class repo by default
- 3422650 Associators calls to IndicationService depends on cmpi-base
- 3416164 Don't write CIM_IndicationService to disk
+- 3495789 Makefile improvements for test suite
+- 3495806 isChild() can cause a provider mismatch
+- 3495343 Bad pointer references in trace statements
+- 3495801 Correction to 3495343
Changes in 1.3.13
=================
diff --git a/cimXmlGen.h b/cimXmlGen.h
index dfc9edc..fb76691 100644
--- a/cimXmlGen.h
+++ b/cimXmlGen.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef array_h
-#define array_h
+#ifndef cimXmlGen_h
+#define cimXmlGen_h
#include "cimRequest.h"
#include "cimXmlParser.h"
diff --git a/msgqueue.c b/msgqueue.c
index 6573b83..0ab0ee0 100644
--- a/msgqueue.c
+++ b/msgqueue.c
@@ -46,7 +46,6 @@ int ptBase,
stBase,
htMax,
stMax;
-int httpProcId;
int currentProc = 0;
int noProvPause = 0;
char *provPauseStr = NULL;
diff --git a/msgqueue.h b/msgqueue.h
index e51df94..0949d30 100644
--- a/msgqueue.h
+++ b/msgqueue.h
@@ -201,7 +201,6 @@ extern int ptBase,
stBase,
htMax,
stMax;
-extern int httpProcId;
extern void stopLocalConnectServer();
extern void localConnectServer();
diff --git a/providerMgr.c b/providerMgr.c
index b9e4024..f75a212 100644
--- a/providerMgr.c
+++ b/providerMgr.c
@@ -1665,30 +1665,59 @@ localInvokeMethod(BinRequestContext * binCtx,
int
isChild(const char *ns, const char *parent, const char *child)
{
+ CMPIObjectPath *path;
+ CMPIStatus rc;
+ InvokeMethodReq sreq = BINREQ(OPS_InvokeMethod,5);
+ BinResponseHdr *resp=NULL;
+ BinRequestContext binCtx;
+
+ OperationHdr req = { OPS_InvokeMethod, 2 };
+ CMPIArgs *in;
+ int irc;
+
_SFCB_ENTER(TRACE_PROVIDERMGR, "isChild");
- CMPIObjectPath *path;
- BinRequestContext binCtx;
- OperationHdr req = { OPS_InvokeMethod, 1 };
- CMPIArgs *in = NewCMPIArgs(NULL);
- CMPIStatus rc;
- int irc;
+ path = TrackedCMPIObjectPath(ns, parent, &rc);
+ sreq.principal = setCharsMsgSegment("$$");
+ sreq.objectPath = setObjectPathMsgSegment(path);
- memset(&binCtx, 0, sizeof(BinRequestContext));
+ in = TrackedCMPIArgs(&rc);
CMAddArg(in, "child", child, CMPI_chars);
- path = NewCMPIObjectPath(ns, parent, &rc);
+ sreq.in = setArgsMsgSegment(in);
+ sreq.out = setArgsMsgSegment(NULL);
+ sreq.method = setCharsMsgSegment("isChild");
req.nameSpace = setCharsMsgSegment((char *) ns);
- req.className = setCharsMsgSegment("$ClassProvider$");
+ req.className = setCharsMsgSegment((char *) "$ClassProvider$");
- irc = _methProvider(&binCtx, &req);
+ memset(&binCtx,0,sizeof(BinRequestContext));
+ binCtx.oHdr = &req;
+ binCtx.bHdr = &sreq.hdr;
+ binCtx.bHdrSize = sizeof(sreq);
+ binCtx.chunkedMode=binCtx.xmlAs=binCtx.noResp=0;
+
+ lockUpCall(Broker);
+
+ irc = getProviderContext(&binCtx);
if (irc == MSG_X_PROVIDER) {
- localInvokeMethod(&binCtx, path, "ischild", in, NULL, &rc, 0);
- irc = (rc.rc == CMPI_RC_OK);
- } else
+ _SFCB_TRACE(1, ("--- Invoking Provider"));
+ resp = invokeProvider(&binCtx);
+ resp->rc--;
+ irc = (resp->rc == CMPI_RC_OK);
+ }
+ else {
+ mlogf(M_ERROR,M_SHOW,"-- no provider context isChild(%s:%s:%s)\n",
+ ns, parent, child);
irc = 0;
- CMRelease(path);
- CMRelease(in);
+ }
+
+ unlockUpCall(Broker);
+
+ if(resp) free(resp);
+ if(!localMode){
+ close(binCtx.provA.socket);
+ }
+ closeProviderContext(&binCtx);
_SFCB_RETURN(irc);
}
diff --git a/test/Makefile.am b/test/Makefile.am
index c0f56b1..c68a08d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,7 +23,8 @@
MAINTAINERCLEANFILES = Makefile.in
# Make this base dir available to testcases
-TESTS_ENVIRONMENT = SFCBTDIR=`pwd`
+#TESTS_ENVIRONMENT = SFCBTDIR=`pwd`
+TESTS_ENVIRONMENT = SFCBTDIR=$(srcdir)
if TEST_ENABLED
SUBDIRS = $(TEST_SUBDIRS)
diff --git a/test/TestProviders/tests/IndRetryTest.sh b/test/TestProviders/tests/IndRetryTest.sh
index d28edc1..bc21ca5 100755
--- a/test/TestProviders/tests/IndRetryTest.sh
+++ b/test/TestProviders/tests/IndRetryTest.sh
@@ -65,13 +65,13 @@ odir () {
}
cleanup () {
# Cleanup created objects and files
- sendxml IndTest5DeleteSubscription.xml /dev/null
- sendxml IndTest6DeleteHandler.xml /dev/null
- sendxml IndTest7DeleteFilter.xml /dev/null
+ sendxml $SRCDIR/IndTest5DeleteSubscription.xml /dev/null
+ sendxml $SRCDIR/IndTest6DeleteHandler.xml /dev/null
+ sendxml $SRCDIR/IndTest7DeleteFilter.xml /dev/null
odir clean
- if [ -f RIModIS.XML ]
+ if [ -f ./RIModIS.XML ]
then
- rm RIModIS.XML
+ rm ./RIModIS.XML
fi
}
@@ -85,10 +85,10 @@ sendInd () {
then
echo -n " initial ..."
# Invoke method to generate the indication
- sendxml IndTest4CallMethod.xml /dev/null
+ sendxml $SRCDIR/IndTest4CallMethod.xml /dev/null
sleep 5; # Wait due to deadlock prevention in localmode (indCIMXMLHandler.c)
else
- sendxml IndTest4CallMethod.xml /dev/null
+ sendxml $SRCDIR/IndTest4CallMethod.xml /dev/null
fi
# Check if it was sent
if [ -f $ODIR/SFCB_Listener.txt ]
@@ -100,9 +100,9 @@ sendInd () {
}
init () {
# Create Filter, Handler, Sub to setup indication
- sendxml IndTest1CreateFilter.xml /dev/null
- sendxml RICreateHandler.XML /dev/null
- sendxml IndTest3CreateSubscription.xml /dev/null
+ sendxml $SRCDIR/IndTest1CreateFilter.xml /dev/null
+ sendxml $SRCDIR/RICreateHandler.XML /dev/null
+ sendxml $SRCDIR/IndTest3CreateSubscription.xml /dev/null
}
###
@@ -116,7 +116,7 @@ cleanup
init
# Get the IndicationService that GenMI.pl will use
-sendxml RIEnumIS.XML ./RIEnumIS.result
+sendxml $SRCDIR/RIEnumIS.XML ./RIEnumIS.result
if [ $? -ne 0 ]
then
echo " Failed to get IndicationService"
@@ -128,13 +128,13 @@ fi
###
echo -n " Disabled indication retries: "
-./GenMI.pl 1 0 300 1
+$SRCDIR/GenMI.pl 1 0 300 1
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
# No odir, so initial should fail
odir clean
@@ -163,13 +163,13 @@ fi
###
echo -n " Enabled indication retries: "
-./GenMI.pl 1 5 300 1
+$SRCDIR/GenMI.pl 1 5 300 1
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1;
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
# No odir, so initial should fail
odir clean
@@ -200,13 +200,13 @@ cleanup
init
echo -n " Subscription disable: "
-./GenMI.pl 1 5 2 3
+$SRCDIR/GenMI.pl 1 5 2 3
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1;
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
# No odir, so initial should fail
odir clean
@@ -219,7 +219,7 @@ else
# Still no odir, so keeps failing, and should disable sub
echo -n " disable ..."
sleep 10
- sendxml RIGetSub.XML ./RIGetSubDisable.result
+ sendxml $SRCDIR/RIGetSub.XML ./RIGetSubDisable.result
grep -A1 '"SubscriptionState"' ./RIGetSubDisable.result | grep '<VALUE>4</VALUE>' >/dev/null 2>&1
if [ $? -eq 1 ]
then
@@ -239,13 +239,13 @@ cleanup
init
echo -n " Subscription Removal: "
-./GenMI.pl 1 5 2 2
+$SRCDIR/GenMI.pl 1 5 2 2
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1;
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
# No odir, so initial should fail
odir clean
@@ -258,7 +258,7 @@ else
# Still no odir, so keeps failing, and should remove sub
echo -n " remove ..."
sleep 10
- sendxml RIGetSub.XML ./RIGetSubRemove.result
+ sendxml $SRCDIR/RIGetSub.XML ./RIGetSubRemove.result
grep '<VALUE>' ./RIGetSubRemove.result >/dev/null 2>&1
if [ $? -eq 0 ]
then
@@ -276,13 +276,13 @@ fi
cleanup
init
echo -n " Indication flood: "
-./GenMI.pl 10 3 300 1
+$SRCDIR/GenMI.pl 10 3 300 1
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1;
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
i=0
j=0
@@ -341,12 +341,12 @@ fi
###
cleanup
# Set Indication_Service back to the defaults
-./GenMI.pl 20 3 2592000 2
+$SRCDIR/GenMI.pl 20 3 2592000 2
if [ $? -ne 0 ]
then
echo " GenMI.pl FAILED"
exit 1;
fi
-sendxml RIModIS.XML /dev/null
+sendxml ./RIModIS.XML /dev/null
rm RIEnumIS.result
exit $RC
diff --git a/test/TestProviders/tests/Makefile.am b/test/TestProviders/tests/Makefile.am
index 13fe7af..e89ab6d 100644
--- a/test/TestProviders/tests/Makefile.am
+++ b/test/TestProviders/tests/Makefile.am
@@ -31,4 +31,5 @@ else
endif
#Some wbemcat tests
-TESTS = xmltest.sh IndRetryTest.sh
+export SRCDIR=$(srcdir)
+TESTS = $(srcdir)/xmltest.sh $(srcdir)/IndRetryTest.sh
diff --git a/test/TestProviders/tests/xmltest.sh b/test/TestProviders/tests/xmltest.sh
index d8f32e4..b023e9d 100755
--- a/test/TestProviders/tests/xmltest.sh
+++ b/test/TestProviders/tests/xmltest.sh
@@ -35,12 +35,12 @@ if ! touch ./testfile > /dev/null; then
fi
rm -f ./testfile
-for xmlfile in `ls *xml`
+for xmlfile in `ls $SRCDIR/*xml`
do
_TEST=${xmlfile%.xml}
_TESTOK=$_TEST.OK
_TESTLINES=$_TEST.lines
- _TESTRESULT=$_TEST.result
+ _TESTRESULT=$(basename _TEST).result
_TESTPREREQ=$_TEST.prereq
_TESTNAME=$_TEST
diff --git a/test/commands/Makefile.am b/test/commands/Makefile.am
index ee2e688..6b8e972 100644
--- a/test/commands/Makefile.am
+++ b/test/commands/Makefile.am
@@ -23,4 +23,5 @@
MAINTAINERCLEANFILES = Makefile.in
#Some wbemcat tests
+export SRCDIR=$(srcdir)
TESTS = cmdusage.sh sfcbdump.sh
diff --git a/test/commands/sfcbdump.sh b/test/commands/sfcbdump.sh
index fa08991..59d7c38 100755
--- a/test/commands/sfcbdump.sh
+++ b/test/commands/sfcbdump.sh
@@ -1,6 +1,6 @@
#!/bin/sh
RC=0
-if ! sfcbdump classSchemas | grep Linux_CSProcessor > /dev/null
+if ! sfcbdump $SRCDIR/classSchemas | grep Linux_CSProcessor > /dev/null
then
RC=1
fi
diff --git a/test/unittest/Makefile.am b/test/unittest/Makefile.am
index f0ddf7a..d9a754f 100644
--- a/test/unittest/Makefile.am
+++ b/test/unittest/Makefile.am
@@ -22,6 +22,7 @@
MAINTAINERCLEANFILES = Makefile.in
+AM_CPPFLAGS=-I$(top_srcdir)
AM_LDFLAGS=-L"$(top_builddir)/.libs"
TESTS_ENVIRONMENT = SFCB_TRACE_FILE="/tmp/sfcbtracetest"
diff --git a/test/xmltest/Makefile.am b/test/xmltest/Makefile.am
index df6b313..b30cd14 100644
--- a/test/xmltest/Makefile.am
+++ b/test/xmltest/Makefile.am
@@ -31,4 +31,5 @@ else
endif
#Some wbemcat tests
+export SRCDIR=$(srcdir)
TESTS = xmltest.sh
diff --git a/test/xmltest/xmltest.sh b/test/xmltest/xmltest.sh
index 084c44f..105c378 100755
--- a/test/xmltest/xmltest.sh
+++ b/test/xmltest/xmltest.sh
@@ -35,12 +35,12 @@ if ! touch ./testfile > /dev/null; then
fi
rm -f ./testfile
-for xmlfile in `ls *xml`
+for xmlfile in `ls $SRCDIR/*xml`
do
_TEST=${xmlfile%.xml}
_TESTOK=$_TEST.OK
_TESTLINES=$_TEST.lines
- _TESTRESULT=$_TEST.result
+ _TESTRESULT=$(basename _TEST).result
_TESTPREREQ=$_TEST.prereq
_TESTNAME=$_TEST
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Dave H. <hel...@us...> - 2012-02-29 21:44:52
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via c14fdc6674ac4982b1cf5a5219ab89ad0e8126f9 (commit)
from c38977abeb45e3a2079bc9cdb4a5a0d29961bfd8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c14fdc6674ac4982b1cf5a5219ab89ad0e8126f9
Author: Dave Heller <hel...@us...>
Date: Wed Feb 29 16:31:46 2012 -0500
[ 3495801 ] Correction to 3495343
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index a3b8743..1bd0619 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-02-29 Dave Heller <hel...@us...>
+ * cimslpSLP.c:
+ [ 3495801 ] Correction to 3495343
+
+2012-02-29 Dave Heller <hel...@us...>
+
* cimslpSLP.c, indCIMXMLExport.c:
[ 3495343 ] Bad pointer references in trace statements
diff --git a/NEWS b/NEWS
index ebb631f..2507d07 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ New features:
Bugs fixed:
- 3495343 Bad pointer references in trace statements
+- 3495801 Correction to 3495343
Changes in 1.4.2
================
diff --git a/cimslpSLP.c b/cimslpSLP.c
index c7a1742..8544014 100644
--- a/cimslpSLP.c
+++ b/cimslpSLP.c
@@ -181,7 +181,7 @@ deregisterCIMService(const char *urlsyntax)
printf
("--- Error deregistering service with slp (%i) ... it will now timeout\n",
err);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
}
SLPClose(hslp);
}
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Dave H. <hel...@us...> - 2012-02-29 21:20:54
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv9924
Modified Files:
ChangeLog NEWS cimslpSLP.c
Log Message:
Fixed 3495801: Correction to 3495343
Index: cimslpSLP.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/cimslpSLP.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cimslpSLP.c 28 Feb 2012 21:36:16 -0000 1.12
+++ cimslpSLP.c 29 Feb 2012 21:20:51 -0000 1.13
@@ -181,7 +181,7 @@
printf
("--- Error deregistering service with slp (%i) ... it will now timeout\n",
err);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
}
SLPClose(hslp);
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.719
retrieving revision 1.720
diff -u -d -r1.719 -r1.720
--- ChangeLog 28 Feb 2012 22:03:36 -0000 1.719
+++ ChangeLog 29 Feb 2012 21:20:51 -0000 1.720
@@ -1,3 +1,8 @@
+2012-02-29 Dave Heller <hel...@us...>
+
+ * cimslpSLP.c:
+ [ 3495801 ] Correction to 3495343
+
2012-02-28 Chris Buccella <buc...@li...>
* interopServerProvider.c:
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.642
retrieving revision 1.643
diff -u -d -r1.642 -r1.643
--- NEWS 28 Feb 2012 22:03:36 -0000 1.642
+++ NEWS 29 Feb 2012 21:20:51 -0000 1.643
@@ -33,6 +33,7 @@
- 3457460 PAM_RHOST set wrong
- 3495343 Bad pointer references in trace statements
- 3416164 Don't write CIM_IndicationService to disk
+- 3495801 Correction to 3495343
Changes in 1.3.13
=================
|
|
From: Dave H. <hel...@us...> - 2012-02-29 20:56:45
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via c38977abeb45e3a2079bc9cdb4a5a0d29961bfd8 (commit)
from e8dc4e64ebba233deeffcc321e0e99a4ec3b0911 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c38977abeb45e3a2079bc9cdb4a5a0d29961bfd8
Author: Dave Heller <hel...@us...>
Date: Wed Feb 29 15:32:35 2012 -0500
[ 3495343 ] Bad pointer references in trace statements
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 18b754e..a3b8743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-29 Dave Heller <hel...@us...>
+
+ * cimslpSLP.c, indCIMXMLExport.c:
+ [ 3495343 ] Bad pointer references in trace statements
+
2012-02-28 Chris Buccella <buc...@li...>
* interopServerProvider.c
diff --git a/NEWS b/NEWS
index 76f6a1e..ebb631f 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Everything in 1.3.13 and 1.3.14, plus:
New features:
- 3441679 Add a feature to validate CMPI types
+Bugs fixed:
+- 3495343 Bad pointer references in trace statements
Changes in 1.4.2
================
diff --git a/cimslpSLP.c b/cimslpSLP.c
index f5b65eb..c7a1742 100644
--- a/cimslpSLP.c
+++ b/cimslpSLP.c
@@ -181,7 +181,7 @@ deregisterCIMService(const char *urlsyntax)
printf
("--- Error deregistering service with slp (%i) ... it will now timeout\n",
err);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
}
SLPClose(hslp);
}
@@ -216,7 +216,7 @@ registerCIMService(cimSLPService css, int slpLifeTime, char **urlsyntax,
*urlsyntax = (char *) malloc(strlen(css.url_syntax) + 14); // ("service:wbem:"
// = 13) + \0
sprintf(*urlsyntax, "service:wbem:%s", css.url_syntax);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
}
attrstring = malloc(sizeof(char) * SIZE);
diff --git a/indCIMXMLExport.c b/indCIMXMLExport.c
index fc67603..959c4e0 100644
--- a/indCIMXMLExport.c
+++ b/indCIMXMLExport.c
@@ -377,7 +377,7 @@ exportIndication(char *url, char *payload, char **resp, char **msg)
}
}
- _SFCB_TRACE(1, ("--- url: %s rc: %d %s", url, rc, msg));
+ _SFCB_TRACE(1, ("--- url: %s rc: %d %s", url, rc, *msg));
if (rc) {
mlogf(M_ERROR, M_SHOW,
"Problem processing indication to %s. sfcb rc: %d %s\n", url, rc,
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Dave B. <bla...@us...> - 2012-02-29 13:06:03
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http
In directory vz-cvs-3.sog:/tmp/cvs-serv22130/src/org/sblim/cimclient/internal/http
Modified Files:
Tag: Experimental
HttpConnectionHandler.java
Log Message:
3495662 - Invalid HTML from HttpConnectionHandler.writeError
Index: HttpConnectionHandler.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/HttpConnectionHandler.java,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -u -d -r1.4.2.5 -r1.4.2.6
--- HttpConnectionHandler.java 18 Feb 2011 19:28:46 -0000 1.4.2.5
+++ HttpConnectionHandler.java 29 Feb 2012 13:05:59 -0000 1.4.2.6
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2005, 2011
+ * (C) Copyright IBM Corp. 2005, 2012
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -23,6 +23,7 @@
* 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
* 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
* 3185818 2011-02-18 blaschke-oss indicationOccured URL incorrect
+ * 3495662 2012-02-29 blaschke-oss Invalid HTML from HttpConnectionHandler.writeError
*/
package org.sblim.cimclient.internal.http;
@@ -173,7 +174,7 @@
}
private void writeError(ASCIIPrintStream dos, String title, String body) {
- dos.print("<HTTP> <HEAD> <TITLE>" + title + "</TITLE></HEAD><BODY>" + body
+ dos.print("<HTML> <HEAD> <TITLE>" + title + "</TITLE></HEAD><BODY>" + body
+ "</BODY></HTML>");
}
|
|
From: Dave B. <bla...@us...> - 2012-02-29 12:45:25
|
Update of /cvsroot/sblim/jsr48-client
In directory vz-cvs-3.sog:/tmp/cvs-serv18431
Modified Files:
Tag: Experimental
build.xml
Log Message:
3477298 - Error compiling JSR48
Index: build.xml
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/build.xml,v
retrieving revision 1.22.2.28
retrieving revision 1.22.2.29
diff -u -d -r1.22.2.28 -r1.22.2.29
--- build.xml 3 Jan 2012 16:33:56 -0000 1.22.2.28
+++ build.xml 29 Feb 2012 12:45:22 -0000 1.22.2.29
@@ -91,7 +91,7 @@
<delete dir="${Directory.build.core}" failonerror="false"/>
<mkdir dir="${Directory.build.base}"/>
<mkdir dir="${Directory.build.core}"/>
- <javac srcdir="${Directory.source.core}" destdir="${Directory.build.core}" debug="on" encoding="utf-8" source="1.5" target="1.5">
+ <javac srcdir="${Directory.source.core}" destdir="${Directory.build.core}" debug="on" encoding="utf-8" source="1.5" target="1.5" includeantruntime="false">
<classpath>
<pathelement path="${java.class.path}/"/>
</classpath>
@@ -122,7 +122,7 @@
<delete dir="${Directory.build.unittest}" failonerror="false"/>
<mkdir dir="${Directory.build.base}"/>
<mkdir dir="${Directory.build.unittest}"/>
- <javac srcdir="${Directory.source.unittest}" destdir="${Directory.build.unittest}" debug="on" encoding="utf-8" source="1.5" target="1.5">
+ <javac srcdir="${Directory.source.unittest}" destdir="${Directory.build.unittest}" debug="on" encoding="utf-8" source="1.5" target="1.5" includeantruntime="false">
<classpath>
<pathelement path="${Directory.build.unittest}/"/>
<pathelement path="${Directory.build.core}/"/>
@@ -161,7 +161,7 @@
<delete dir="${Directory.build.samples}" failonerror="false"/>
<mkdir dir="${Directory.build.base}"/>
<mkdir dir="${Directory.build.samples}"/>
- <javac srcdir="${Directory.source.samples}" destdir="${Directory.build.samples}" debug="on" encoding="utf-8" source="1.5" target="1.5">
+ <javac srcdir="${Directory.source.samples}" destdir="${Directory.build.samples}" debug="on" encoding="utf-8" source="1.5" target="1.5" includeantruntime="false">
<classpath>
<pathelement path="${Directory.build.samples}/"/>
<pathelement path="${Directory.build.core}/"/>
|
|
From: Dave B. <bla...@us...> - 2012-02-29 04:24:44
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/logging
In directory vz-cvs-3.sog:/tmp/cvs-serv23812/src/org/sblim/cimclient/internal/logging
Modified Files:
Tag: Experimental
LogAndTraceBroker.java
Log Message:
3489638 - PERF: Bottleneck in LogAndTraceBroker.java - getCaller()
Index: LogAndTraceBroker.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/logging/LogAndTraceBroker.java,v
retrieving revision 1.10.2.14
retrieving revision 1.10.2.15
diff -u -d -r1.10.2.14 -r1.10.2.15
--- LogAndTraceBroker.java 3 Feb 2012 22:02:24 -0000 1.10.2.14
+++ LogAndTraceBroker.java 29 Feb 2012 04:24:41 -0000 1.10.2.15
@@ -27,6 +27,7 @@
* 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
* 3469018 2012-01-03 blaschke-oss Properties not passed to CIMIndicationHandler
* 3484014 2012-02-03 blaschke-oss Add LogAndTraceBroker.isLoggable for message/trace
+ * 3489638 2012-02-28 blaschke-oss PERF: Bottleneck in LogAndTraceBroker.java - getCaller()
*/
package org.sblim.cimclient.internal.logging;
@@ -556,12 +557,13 @@
final String message = MessageLoader.getMessage(pKey);
final String localMessage = MessageLoader.getLocalizedMessage(pKey);
final Level level = MessageLoader.getLevel(pKey);
- final List<TraceListener> traceListeners = getTraceListeners();
- StackTraceElement caller = null;
- for (int i = 0; i < traceListeners.size(); ++i) {
- caller = caller == null ? getCaller() : caller;
- traceListeners.get(i).trace(level, caller,
- pKey + " " + MessageFormat.format(message, pParameters));
+ if (isLoggableTrace(level)) {
+ final List<TraceListener> traceListeners = getTraceListeners();
+ StackTraceElement caller = getCaller();
+ for (int i = 0; i < traceListeners.size(); ++i) {
+ traceListeners.get(i).trace(level, caller,
+ pKey + " " + MessageFormat.format(message, pParameters));
+ }
}
final List<LogListener> logListeners = getLogListeners();
for (int i = 0; i < logListeners.size(); ++i) {
@@ -583,11 +585,12 @@
*/
public void trace(Level pLevel, String pMessage) {
try {
- final List<TraceListener> traceListeners = getTraceListeners();
- StackTraceElement caller = null;
- for (int i = 0; i < traceListeners.size(); ++i) {
- caller = caller == null ? getCaller() : caller;
- traceListeners.get(i).trace(pLevel, caller, pMessage);
+ if (isLoggableTrace(pLevel)) {
+ final List<TraceListener> traceListeners = getTraceListeners();
+ StackTraceElement caller = getCaller();
+ for (int i = 0; i < traceListeners.size(); ++i) {
+ traceListeners.get(i).trace(pLevel, caller, pMessage);
+ }
}
} catch (Exception e) {
// don't crash for logging
@@ -607,11 +610,12 @@
*/
public void trace(Level pLevel, String pMessage, Throwable pThrown) {
try {
- final List<TraceListener> traceListeners = getTraceListeners();
- StackTraceElement caller = null;
- for (int i = 0; i < traceListeners.size(); ++i) {
- caller = caller == null ? getCaller() : caller;
- traceListeners.get(i).trace(pLevel, caller, pMessage, pThrown);
+ if (isLoggableTrace(pLevel)) {
+ final List<TraceListener> traceListeners = getTraceListeners();
+ StackTraceElement caller = getCaller();
+ for (int i = 0; i < traceListeners.size(); ++i) {
+ traceListeners.get(i).trace(pLevel, caller, pMessage, pThrown);
+ }
}
} catch (Exception e) {
// don't crash for logging
|
|
From: Chris B. <buc...@us...> - 2012-02-29 00:32:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via e8dc4e64ebba233deeffcc321e0e99a4ec3b0911 (commit)
from 52d214d7870bd0bed4633be51636629df396e0af (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e8dc4e64ebba233deeffcc321e0e99a4ec3b0911
Author: buccella <buc...@li...>
Date: Tue Feb 28 19:32:42 2012 -0500
[ 3493493 ] Add sfcbsem
-----------------------------------------------------------------------
Summary of changes:
diff --git a/.gitignore b/.gitignore
index 84d80d6..17c1b24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -95,3 +95,4 @@ mofc/
\#*\#
20_indication.mof
20_indication.mof.pre
+sfcbsem
diff --git a/Makefile.am b/Makefile.am
index 7b6d2b1..d4c85dc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -166,7 +166,7 @@ bin_PROGRAMS = \
sfcbmofpp sfcbdump sfcbinst2mof $(SLP_PROGRAMFILES)
noinst_PROGRAMS = \
- sfcbdumpP32onI32 classSchema2c
+ sfcbdumpP32onI32 classSchema2c sfcbsem
libsfcBrokerCore_la_SOURCES = \
args.c \
@@ -410,6 +410,8 @@ classSchema2c_SOURCES=classSchema2c.c
classSchema2c_LDADD=-lsfcBrokerCore
classSchema2c_DEPENDENCIES=libsfcBrokerCore.la
+sfcbsem_SOURCES=sfcbsem.c
+
noinst_HEADERS=array.h $(SLP_INC) httpComm.h control.h providerMgr.h \
constClass.h msgqueue.h providerRegister.h \
cimXmlParser.h native.h support.h cimXmlGen.h \
diff --git a/sfcbsem.c b/sfcbsem.c
new file mode 100644
index 0000000..a8d132e
--- /dev/null
+++ b/sfcbsem.c
@@ -0,0 +1,239 @@
+
+/*
+ * $Id: sfcbsem.c,v 1.1 2012/02/24 22:49:40 buccella Exp $
+ *
+ * (C) Copyright IBM Corp. 2006
+ *
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+ *
+ * You can obtain a current copy of the Eclipse Public License from
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * Author: Viktor Mihajlovski
+ *
+ * Description:
+ *
+ * sfcBroker semaphore state lister
+ *
+*/
+
+/* includes */
+#include <stdio.h>
+#include <getopt.h>
+#include <errno.h>
+
+#include "msgqueue.h"
+
+/* defines */
+#define BINARY_NAME argv[0]
+#define SFCB_SEM 'S'
+#define HTTPW_SEM 'W'
+#define HTTPP_SEM 'H'
+
+/* local types */
+typedef struct _localsem {
+ int ls_id; /* semaphore number */
+ int ls_val; /* semaphore value */
+} localsem;
+
+/* local data */
+static int opt_process = 0;
+static int opt_cimxml = 0;
+static int opt_all = 1;
+
+/* local functions */
+static int checkargs(int argc, char * argv[]);
+static int check_sem(char c);
+static int get_semnum(int id);
+static int fill_sem(int id, localsem *ls, int num, int index);
+static int check_and_print_sem(char c, char * s);
+static int check_and_print_sfcbsem(char c, char * s);
+
+int main(int argc, char * argv[])
+{
+ int rc = checkargs(argc,argv);
+
+ if (opt_process) {
+ rc = check_and_print_sfcbsem(SFCB_SEM,"SFCB Process");
+ }
+
+ if (opt_cimxml) {
+ rc = check_and_print_sem(HTTPW_SEM,"HTTP Worker");
+ if (rc > 0) {
+ rc = check_and_print_sem(HTTPP_SEM,"HTTP Process");
+ }
+ }
+
+ return rc;
+}
+
+static int checkargs(int argc, char * argv[])
+{
+ int c;
+ int option_details=0;
+ static struct option const long_options[] =
+ {
+ { "cimxml", no_argument, 0,'c' },
+ { "process", no_argument, 0,'p' },
+ { "help", no_argument, 0,'h' },
+ { 0, 0, 0, 0 }
+ };
+
+ while ((c = getopt_long(argc, argv, "cph", long_options, 0)) != -1) {
+ switch(c) {
+ case 'c':
+ opt_cimxml = 1;
+ opt_all = 0;
+ break;
+ case 'p':
+ opt_process = 1;
+ opt_all = 0;
+ break;
+ case 'h':
+ option_details = 1;
+ opt_all = 0;
+ break;
+ default:
+ return 1;
+ break;
+ }
+ }
+
+ if (opt_all) {
+ /* if nothing specified print all */
+ opt_process = opt_cimxml = 1;
+ }
+
+ if (argc - optind != 0 || option_details) {
+ fprintf(stderr,"Usage: %s [-cph]\n",BINARY_NAME);
+ if (option_details) {
+ fprintf(stderr,"\n\tAllowed options:\n");
+ fprintf(stderr,"\t-c, --cimxml Display CIMXML/HTTP Semaphores\n");
+ fprintf(stderr,"\t-p, --process Display Process Semaphores\n");
+ fprintf(stderr,"\t-h, --help Show usage info\n");
+ }
+ return 2;
+ } else {
+ return 0;
+ }
+}
+
+static int check_sem(char c)
+{
+ int key=ftok(SFCB_BINARY,c);
+
+ return semget(key,0, 0600);
+}
+
+static int get_semnum(int id)
+{
+ int rc;
+ struct semid_ds ds;
+ rc = semctl(id,0,IPC_STAT,&ds);
+ if (rc < 0) {
+ return rc;
+ } else {
+ return ds.sem_nsems;
+ }
+}
+
+static int fill_sem(int id, localsem * ls, int num, int index)
+{
+ int rc;
+ int i;
+ short *semv = calloc(num,sizeof(short));
+
+ if (semv) {
+ rc = semctl(id,0,GETALL,semv);
+ if (rc < 0) {
+ return rc;
+ } else {
+ for (i=0; i<num; i++) {
+ ls[i].ls_id = i + index;
+ ls[i].ls_val = semv[i + index];
+ }
+ free(semv);
+ return i;
+ }
+ }
+ return -1;
+}
+
+static int check_and_print_sem(char c, char * s)
+{
+ int rc;
+ int id;
+ int num;
+ int i;
+ localsem * localsems;
+
+ if ((id = check_sem(c)) <= 0) {
+ fprintf(stderr,"Could not open %s Semaphore, reason: %s\n",
+ s, strerror(errno));
+ rc = -1;
+ } else if ((num = get_semnum(id)) <= 0) {
+ fprintf(stderr,"Could not stat %s Semaphore, reason: %s\n",
+ s, strerror(errno));
+ rc = -1;
+ } else {
+ localsems = calloc(num,sizeof(localsem));
+ if (num != fill_sem(id,localsems,num,0)) {
+ fprintf(stderr,"Could not get all %d %s Semaphores reason: %s\n",
+ num, s, strerror(errno));
+ rc = -1;
+ } else {
+ printf("SFCB Semaphore Set for %s\n",s);
+ printf("Id\tValue\n");
+ for (i=0; i<num;i++) {
+ printf("%d\t%d\n",localsems[i].ls_id,localsems[i].ls_val);
+ }
+ rc = i;
+ }
+ free(localsems);
+ }
+ return rc;
+}
+
+static int check_and_print_sfcbsem(char c, char * s)
+{
+ int rc;
+ int id;
+ int num;
+ int i;
+ localsem * localsems;
+
+ if ((id = check_sem(c)) <= 0) {
+ fprintf(stderr,"Could not open %s Semaphore, reason: %s\n",
+ s, strerror(errno));
+ rc = -1;
+ } else if ((num = get_semnum(id)) <= 0) {
+ fprintf(stderr,"Could not stat %s Semaphore, reason: %s\n",
+ s, strerror(errno));
+ rc = -1;
+ } else if (num - PROV_PROC_BASE_ID < PROV_PROC_NUM_SEMS) {
+ fprintf(stderr, "Not enough process semaphores found: %d\n",num);
+ rc = -1;
+ } else {
+ localsems = calloc(num,sizeof(localsem));
+ if (num != fill_sem(id,localsems,num,0)) {
+ fprintf(stderr,"Could not get all %d %s Semaphores reason: %s\n",
+ num, s, strerror(errno));
+ rc = -1;
+ } else {
+ printf("SFCB Process Semaphore Set\n");
+ printf("Id\tGuard\tInuse\tAlive\n");
+ num = (num - PROV_PROC_BASE_ID) / PROV_PROC_NUM_SEMS;
+ for (i=0; i<num;i++) {
+ printf("%d\t%d\t%d\t%d\n",i,
+ localsems[PROV_GUARD(i)].ls_val,
+ localsems[PROV_INUSE(i)].ls_val,
+ localsems[PROV_ALIVE(i)].ls_val);
+ }
+ rc = i;
+ }
+ free(localsems);
+ }
+ return rc;
+}
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-02-29 00:24:09
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 52d214d7870bd0bed4633be51636629df396e0af (commit)
from 1fe218093ac8dbdc009a8cddfc35c3042642d87b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 52d214d7870bd0bed4633be51636629df396e0af
Author: buccella <buc...@li...>
Date: Tue Feb 28 19:24:40 2012 -0500
[ 3416164 ] Don't write CIM_IndicationService to disk
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index bf96565..18b754e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-28 Chris Buccella <buc...@li...>
+
+ * interopServerProvider.c
+ [ 3416164 ] Don't write CIM_IndicationService to disk
+
2012-02-24 Michael Chase-Salerno <br...@li...>
* interopProvider.c, indCIMXMLHandler.c, sfcb.cfg.pre.in
diff --git a/NEWS b/NEWS
index 71ca29a..76f6a1e 100644
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,7 @@ Bugs Fixed:
- 3416055 SIGSEGV sometimes does not print provider name
- 3416167 CIM_InstDeletion not in class repo by default
- 3422650 Associators calls to IndicationService depends on cmpi-base
+- 3416164 Don't write CIM_IndicationService to disk
Changes in 1.3.13
=================
diff --git a/interopServerProvider.c b/interopServerProvider.c
index 998f45d..ad2a039 100644
--- a/interopServerProvider.c
+++ b/interopServerProvider.c
@@ -45,6 +45,7 @@
#include "native.h"
#include "control.h"
#include "config.h"
+#include "objectpath.h"
#define NEW(x) ((x *) malloc(sizeof(x)))
@@ -436,6 +437,64 @@ ObjectManagerProviderEnumInstances(CMPIInstanceMI * mi,
_SFCB_RETURN(st);
}
+static CMPIObjectPath* makeIndServiceOP() {
+
+ CMPIStatus st = { CMPI_RC_OK, 0 };
+ char str[512];
+ CMPIObjectPath* op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",&st);
+ CMAddKey(op,"CreationClassName","CIM_IndicationService",CMPI_chars);
+ CMAddKey(op,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ str[0]=str[511]=0;
+ gethostname(str,511);
+ CMAddKey(op,"SystemName",str,CMPI_chars);
+ CMAddKey(op,"Name",getSfcbUuid(),CMPI_chars);
+
+ return op;
+}
+
+static CMPIStatus makeIndService(CMPIInstance *ci)
+{
+ CMPIStatus st = { CMPI_RC_OK, 0 };
+
+ CMPIBoolean filterCreation=1;
+ CMPIUint16 retryAttempts,subRemoval;
+ CMPIUint32 tmp,retryInterval,subRemovalInterval;
+
+
+ // Get the retry parameters from the config file
+ getControlUNum("DeliveryRetryInterval", &retryInterval);
+ getControlUNum("DeliveryRetryAttempts", &tmp);
+ if (tmp > UINT16_MAX) {
+ // Exceeded max range, set to default
+ mlogf(M_ERROR, M_SHOW, "--- Value for DeliveryRetryAttempts exceeds range, using default.\n");
+ retryAttempts=3;
+ } else {
+ retryAttempts=(CMPIUint16) tmp;
+ }
+ getControlUNum("SubscriptionRemovalTimeInterval", &subRemovalInterval);
+ getControlUNum("SubscriptionRemovalAction", &tmp);
+ if (tmp > UINT16_MAX) {
+ // Exceeded max range, set to default
+ mlogf(M_ERROR, M_SHOW, "--- Value for SubscriptionRemovalAction exceeds range, using default.\n");
+ subRemoval=2;
+ } else {
+ subRemoval= (CMPIUint16) tmp;
+ }
+
+ CMSetProperty(ci,"CreationClassName","CIM_IndicationService",CMPI_chars);
+ CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ CMSetProperty(ci,"Name",getSfcbUuid(),CMPI_chars);
+ CMSetProperty(ci,"FilterCreationEnabled",&filterCreation,CMPI_boolean);
+ CMSetProperty(ci,"ElementName","sfcb",CMPI_chars);
+ CMSetProperty(ci,"Description",PACKAGE_STRING,CMPI_chars);
+ CMSetProperty(ci,"DeliveryRetryAttempts",&retryAttempts,CMPI_uint16);
+ CMSetProperty(ci,"DeliveryRetryInterval",&retryInterval,CMPI_uint32);
+ CMSetProperty(ci,"SubscriptionRemovalAction",&subRemoval,CMPI_uint16);
+ CMSetProperty(ci,"SubscriptionRemovalTimeInterval",&subRemovalInterval,CMPI_uint32);
+
+ return st;
+}
+
static CMPIStatus
IndServiceProviderGetInstance(CMPIInstanceMI * mi,
const CMPIContext *ctx,
@@ -444,27 +503,42 @@ IndServiceProviderGetInstance(CMPIInstanceMI * mi,
const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
- CMPIObjectPath *op;
- CMPIInstance *indService = NULL;
+ CMPIInstance* ci = NULL;
_SFCB_ENTER(TRACE_PROVIDERS, "IndServiceProviderGetInstance");
- CMPIContext *ctxLocal;
- ctxLocal = native_clone_CMPIContext(ctx);
- CMPIValue val;
- val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0);
- ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
+ CMPIObjectPath* op = makeIndServiceOP();
+ /* compare object paths to see if we're being asked for the one we have
+ if ref is NULL, then skip it, because we're haning an ei call */
+ if ((ref !=NULL) && objectpathCompare(op, ref)) {
+ st.rc=CMPI_RC_ERR_NOT_FOUND;
+ _SFCB_RETURN(st);
+ }
- op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService",
- NULL);
- indService = CBGetInstance(_broker, ctxLocal, ref, properties, &st);
+#ifdef SETTABLERETRY
+
+ /* check if it exists first */
+ CMPIContext *ctxLocal;
+ ctxLocal = native_clone_CMPIContext(ctx);
+ CMPIValue val;
+ val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
+ ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
+
+ ci = CBGetInstance(_broker, ctxLocal, ref, properties, &st);
+
+#else
+
+ ci = CMNewInstance(_broker, op, &st);
+
+ makeIndService(ci);
- CMReturnInstance(rslt, indService);
+#endif
+
+ CMReturnInstance(rslt,ci);
CMReturnDone(rslt);
- if (ctxLocal)
- CMRelease(ctxLocal);
_SFCB_RETURN(st);
+
}
static CMPIStatus
@@ -475,15 +549,17 @@ IndServiceProviderEnumInstances(CMPIInstanceMI * mi,
const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
- CMPIObjectPath *op;
- CMPIEnumeration *indServices = NULL;
_SFCB_ENTER(TRACE_PROVIDERS, "IndServiceProviderEnumInstances");
- CMPIContext *ctxLocal;
+#ifdef SETTABLERETRY
+
+ CMPIObjectPath *op;
+ CMPIEnumeration *indServices = NULL;
+ CMPIContext *ctxLocal;
ctxLocal = native_clone_CMPIContext(ctx);
- CMPIValue val;
- val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0);
+ CMPIValue val;
+ val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService",
@@ -497,6 +573,11 @@ IndServiceProviderEnumInstances(CMPIInstanceMI * mi,
if (ctxLocal)
CMRelease(ctxLocal);
+
+#else
+ st = IndServiceProviderGetInstance(mi, ctx, rslt, NULL, properties);
+#endif
+
_SFCB_RETURN(st);
}
@@ -871,71 +952,35 @@ ServerProviderExecQuery(CMPIInstanceMI * mi,
void
ServerProviderInitInstances(const CMPIContext *ctx)
{
- CMPIStatus st = { CMPI_RC_OK, 0 };
- char str[512];
- CMPIObjectPath *op = NULL;
- CMPIValue val;
- CMPIInstance *ci = NULL;
- CMPIContext *ctxLocal;
- CMPIBoolean filterCreation = 1;
- CMPIUint16 retryAttempts,subRemoval;
- CMPIUint32 tmp,retryInterval,subRemovalInterval;
-
- // Get the retry parameters from the config file
- getControlUNum("DeliveryRetryInterval", &retryInterval);
- getControlUNum("DeliveryRetryAttempts", &tmp);
- if (tmp > UINT16_MAX) {
- // Exceeded max range, set to default
- mlogf(M_ERROR, M_SHOW, "--- Value for DeliveryRetryAttempts exceeds range, using default.\n");
- retryAttempts=3;
- } else {
- retryAttempts=(CMPIUint16) tmp;
- }
- getControlUNum("SubscriptionRemovalTimeInterval", &subRemovalInterval);
- getControlUNum("SubscriptionRemovalAction", &tmp);
- if (tmp > UINT16_MAX) {
- // Exceeded max range, set to default
- mlogf(M_ERROR, M_SHOW, "--- Value for SubscriptionRemovalAction exceeds range, using default.\n");
- subRemoval=2;
- } else {
- subRemoval= (CMPIUint16) tmp;
- }
+ /* only applicable if we're relying on InternalProvider */
+#ifdef SETTABLERETRY
+
+ CMPIStatus st;
+ CMPIInstance *ci;
+ CMPIObjectPath *op;
+
+ CMPIValue val;
+ CMPIContext *ctxLocal;
ctxLocal = native_clone_CMPIContext(ctx);
val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0);
ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
- op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService",
- &st);
- CMAddKey(op, "CreationClassName", "CIM_IndicationService", CMPI_chars);
- CMAddKey(op, "SystemCreationClassName", "CIM_ComputerSystem",
- CMPI_chars);
- str[0] = str[511] = 0;
- gethostname(str, 511);
- CMAddKey(op, "SystemName", str, CMPI_chars);
- CMAddKey(op, "Name", getSfcbUuid(), CMPI_chars);
- // Delete the instance so we can replace with proper values
+ op = makeIndServiceOP();
+
+ /* a brutal way to update values; because of this, changes don't persist */
CBDeleteInstance(_broker,ctxLocal,op);
ci = CMNewInstance(_broker, op, &st);
- CMSetProperty(ci, "CreationClassName", "CIM_IndicationService",
- CMPI_chars);
- CMSetProperty(ci, "SystemCreationClassName", "CIM_ComputerSystem",
- CMPI_chars);
- CMSetProperty(ci, "SystemName", str, CMPI_chars);
- CMSetProperty(ci, "Name", getSfcbUuid(), CMPI_chars);
- CMSetProperty(ci, "FilterCreationEnabled", &filterCreation,
- CMPI_boolean);
- CMSetProperty(ci, "ElementName", "sfcb", CMPI_chars);
- CMSetProperty(ci, "Description", PACKAGE_STRING, CMPI_chars);
- CMSetProperty(ci, "DeliveryRetryAttempts", &retryAttempts, CMPI_uint16);
- CMSetProperty(ci, "DeliveryRetryInterval", &retryInterval, CMPI_uint32);
- CMSetProperty(ci, "SubscriptionRemovalAction", &subRemoval, CMPI_uint16);
- CMSetProperty(ci, "SubscriptionRemovalTimeInterval", &subRemovalInterval,
- CMPI_uint32);
+ makeIndService(ci);
+
+ op = CMGetObjectPath(ci, &st);
+
CBCreateInstance(_broker, ctxLocal, op, ci, &st);
CMRelease(ctxLocal);
+#endif
+
return;
}
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-02-28 22:03:39
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv13669
Modified Files:
interopServerProvider.c ChangeLog NEWS
Log Message:
[ 3416164 ] Don't write CIM_IndicationService to disk
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.641
retrieving revision 1.642
diff -u -d -r1.641 -r1.642
--- NEWS 28 Feb 2012 21:36:16 -0000 1.641
+++ NEWS 28 Feb 2012 22:03:36 -0000 1.642
@@ -32,6 +32,7 @@
- 3492362 Problem with whitespace trimming if local connect only
- 3457460 PAM_RHOST set wrong
- 3495343 Bad pointer references in trace statements
+- 3416164 Don't write CIM_IndicationService to disk
Changes in 1.3.13
=================
Index: interopServerProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopServerProvider.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- interopServerProvider.c 21 Jun 2011 22:12:12 -0000 1.34
+++ interopServerProvider.c 28 Feb 2012 22:03:36 -0000 1.35
@@ -36,6 +36,7 @@
#include "native.h"
#include "control.h"
#include "config.h"
+#include "objectpath.h"
#define NEW(x) ((x *) malloc(sizeof(x)))
@@ -396,32 +397,108 @@
_SFCB_RETURN(st);
}
+static CMPIObjectPath* makeIndServiceOP() {
+
+ CMPIStatus st = { CMPI_RC_OK, 0 };
+ char str[512];
+ CMPIObjectPath* op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",&st);
+ CMAddKey(op,"CreationClassName","CIM_IndicationService",CMPI_chars);
+ CMAddKey(op,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ str[0]=str[511]=0;
+ gethostname(str,511);
+ CMAddKey(op,"SystemName",str,CMPI_chars);
+ CMAddKey(op,"Name",getSfcbUuid(),CMPI_chars);
+
+ return op;
+}
+
+static CMPIStatus makeIndService(CMPIInstance *ci)
+{
+ CMPIStatus st = { CMPI_RC_OK, 0 };
+
+ CMPIBoolean filterCreation=1;
+ CMPIUint16 retryAttempts,subRemoval;
+ CMPIUint32 tmp,retryInterval,subRemovalInterval;
+
+
+ // Get the retry parameters from the config file
+ getControlUNum("DeliveryRetryInterval", &retryInterval);
+ getControlUNum("DeliveryRetryAttempts", &tmp);
+ if (tmp > UINT16_MAX) {
+ // Exceeded max range, set to default
+ mlogf(M_ERROR, M_SHOW, "--- Value for DeliveryRetryAttempts exceeds range, using default.\n");
+ retryAttempts=3;
+ } else {
+ retryAttempts=(CMPIUint16) tmp;
+ }
+ getControlUNum("SubscriptionRemovalTimeInterval", &subRemovalInterval);
+ getControlUNum("SubscriptionRemovalAction", &tmp);
+ if (tmp > UINT16_MAX) {
+ // Exceeded max range, set to default
+ mlogf(M_ERROR, M_SHOW, "--- Value for SubscriptionRemovalAction exceeds range, using default.\n");
+ subRemoval=2;
+ } else {
+ subRemoval= (CMPIUint16) tmp;
+ }
+
+ CMSetProperty(ci,"CreationClassName","CIM_IndicationService",CMPI_chars);
+ CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ CMSetProperty(ci,"Name",getSfcbUuid(),CMPI_chars);
+ CMSetProperty(ci,"FilterCreationEnabled",&filterCreation,CMPI_boolean);
+ CMSetProperty(ci,"ElementName","sfcb",CMPI_chars);
+ CMSetProperty(ci,"Description",PACKAGE_STRING,CMPI_chars);
+ CMSetProperty(ci,"DeliveryRetryAttempts",&retryAttempts,CMPI_uint16);
+ CMSetProperty(ci,"DeliveryRetryInterval",&retryInterval,CMPI_uint32);
+ CMSetProperty(ci,"SubscriptionRemovalAction",&subRemoval,CMPI_uint16);
+ CMSetProperty(ci,"SubscriptionRemovalTimeInterval",&subRemovalInterval,CMPI_uint32);
+
+ return st;
+}
+
static CMPIStatus IndServiceProviderGetInstance(CMPIInstanceMI * mi,
const CMPIContext * ctx,
const CMPIResult * rslt,
const CMPIObjectPath * ref,
const char **properties)
{
- CMPIStatus st = { CMPI_RC_OK, NULL };
- CMPIObjectPath *op;
- CMPIInstance *indService = NULL;
-
+
+ CMPIStatus st = { CMPI_RC_OK, 0 };
+ CMPIInstance* ci = NULL;
+
_SFCB_ENTER(TRACE_PROVIDERS, "IndServiceProviderGetInstance");
- CMPIContext *ctxLocal;
- ctxLocal = native_clone_CMPIContext(ctx);
- CMPIValue val;
- val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
- ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
+ CMPIObjectPath* op = makeIndServiceOP();
- op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL);
- indService = CBGetInstance(_broker, ctxLocal, ref, properties, &st);
+ /* compare object paths to see if we're being asked for the one we have
+ if ref is NULL, then skip it, because we're haning an ei call */
+ if ((ref !=NULL) && objectpathCompare(op, ref)) {
+ st.rc=CMPI_RC_ERR_NOT_FOUND;
+ _SFCB_RETURN(st);
+ }
- CMReturnInstance(rslt,indService);
- CMReturnDone(rslt);
-
- if(ctxLocal) CMRelease(ctxLocal);
- _SFCB_RETURN(st);
+#ifdef SETTABLERETRY
+
+ /* check if it exists first */
+ CMPIContext *ctxLocal;
+ ctxLocal = native_clone_CMPIContext(ctx);
+ CMPIValue val;
+ val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
+ ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
+
+ ci = CBGetInstance(_broker, ctxLocal, ref, properties, &st);
+
+#else
+
+ ci = CMNewInstance(_broker, op, &st);
+
+ makeIndService(ci);
+
+#endif
+
+ CMReturnInstance(rslt,ci);
+ CMReturnDone(rslt);
+
+ _SFCB_RETURN(st);
}
static CMPIStatus IndServiceProviderEnumInstances(CMPIInstanceMI * mi,
@@ -431,16 +508,18 @@
const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
- CMPIObjectPath *op;
- CMPIEnumeration *indServices = NULL;
-
+
_SFCB_ENTER(TRACE_PROVIDERS, "IndServiceProviderEnumInstances");
- CMPIContext *ctxLocal;
- ctxLocal = native_clone_CMPIContext(ctx);
- CMPIValue val;
- val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
- ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
+#ifdef SETTABLERETRY
+
+ CMPIObjectPath *op;
+ CMPIEnumeration *indServices = NULL;
+ CMPIContext *ctxLocal;
+ ctxLocal = native_clone_CMPIContext(ctx);
+ CMPIValue val;
+ val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
+ ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL);
indServices = CBEnumInstances(_broker, ctxLocal, op, properties, &st);
@@ -449,8 +528,13 @@
CMReturnInstance(rslt,CMGetNext(indServices, NULL).value.inst);
}
CMReturnDone(rslt);
-
+
if(ctxLocal) CMRelease(ctxLocal);
+
+#else
+ st = IndServiceProviderGetInstance(mi, ctx, rslt, NULL, properties);
+#endif
+
_SFCB_RETURN(st);
}
@@ -770,65 +854,37 @@
return notSuppSt;
}
-void ServerProviderInitInstances(const CMPIContext * ctx) {
- CMPIStatus st = { CMPI_RC_OK, 0 };
- char str[512];
- CMPIObjectPath * op = NULL;
+void ServerProviderInitInstances(const CMPIContext* ctx) {
+
+ /* only applicable if we're relying on InternalProvider */
+#ifdef SETTABLERETRY
+
+ CMPIStatus st;
+ CMPIInstance *ci;
+ CMPIObjectPath *op;
CMPIValue val;
- CMPIInstance * ci = NULL;
- CMPIContext * ctxLocal;
- CMPIBoolean filterCreation=1;
- CMPIUint16 retryAttempts,subRemoval;
- CMPIUint32 tmp,retryInterval,subRemovalInterval;
-
- // Get the retry parameters from the config file
- getControlUNum("DeliveryRetryInterval", &retryInterval);
- getControlUNum("DeliveryRetryAttempts", &tmp);
- if (tmp > UINT16_MAX) {
- // Exceeded max range, set to default
- mlogf(M_ERROR, M_SHOW, "--- Value for DeliveryRetryAttempts exceeds range, using default.\n");
- retryAttempts=3;
- } else {
- retryAttempts=(CMPIUint16) tmp;
- }
- getControlUNum("SubscriptionRemovalTimeInterval", &subRemovalInterval);
- getControlUNum("SubscriptionRemovalAction", &tmp);
- if (tmp > UINT16_MAX) {
- // Exceeded max range, set to default
- mlogf(M_ERROR, M_SHOW, "--- Value for SubscriptionRemovalAction exceeds range, using default.\n");
- subRemoval=2;
- } else {
- subRemoval= (CMPIUint16) tmp;
- }
+ CMPIContext *ctxLocal;
ctxLocal = native_clone_CMPIContext(ctx);
val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL,0);
ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);
- op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",&st);
- CMAddKey(op,"CreationClassName","CIM_IndicationService",CMPI_chars);
- CMAddKey(op,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
- str[0]=str[511]=0;
- gethostname(str,511);
- CMAddKey(op,"SystemName",str,CMPI_chars);
- CMAddKey(op,"Name",getSfcbUuid(),CMPI_chars);
- // Delete the instance so we can replace with proper values
+ op = makeIndServiceOP();
+
+ /* a brutal way to update values; because of this, changes don't persist */
CBDeleteInstance(_broker,ctxLocal,op);
+
ci = CMNewInstance(_broker, op, &st);
- CMSetProperty(ci,"CreationClassName","CIM_IndicationService",CMPI_chars);
- CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
- CMSetProperty(ci,"SystemName",str,CMPI_chars);
- CMSetProperty(ci,"Name",getSfcbUuid(),CMPI_chars);
- CMSetProperty(ci,"FilterCreationEnabled",&filterCreation,CMPI_boolean);
- CMSetProperty(ci,"ElementName","sfcb",CMPI_chars);
- CMSetProperty(ci,"Description",PACKAGE_STRING,CMPI_chars);
- CMSetProperty(ci,"DeliveryRetryAttempts",&retryAttempts,CMPI_uint16);
- CMSetProperty(ci,"DeliveryRetryInterval",&retryInterval,CMPI_uint32);
- CMSetProperty(ci,"SubscriptionRemovalAction",&subRemoval,CMPI_uint16);
- CMSetProperty(ci,"SubscriptionRemovalTimeInterval",&subRemovalInterval,CMPI_uint32);
+ makeIndService(ci);
+
+ op = CMGetObjectPath(ci, &st);
+
CBCreateInstance(_broker, ctxLocal, op, ci, &st);
CMRelease(ctxLocal);
+
+#endif
+
return;
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.718
retrieving revision 1.719
diff -u -d -r1.718 -r1.719
--- ChangeLog 28 Feb 2012 21:36:16 -0000 1.718
+++ ChangeLog 28 Feb 2012 22:03:36 -0000 1.719
@@ -1,3 +1,8 @@
+2012-02-28 Chris Buccella <buc...@li...>
+
+ * interopServerProvider.c:
+ [ 3416164 ] Don't write CIM_IndicationService to disk
+
2012-02-28 Dave Heller <hel...@us...>
* cimslpSLP.c, indCIMXMLExport.c:
|
|
From: Dave H. <hel...@us...> - 2012-02-28 21:36:19
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv9645
Modified Files:
ChangeLog NEWS cimslpSLP.c indCIMXMLExport.c
Log Message:
Fixed 3495343: Bad pointer references in trace statements
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.640
retrieving revision 1.641
diff -u -d -r1.640 -r1.641
--- NEWS 24 Feb 2012 22:49:40 -0000 1.640
+++ NEWS 28 Feb 2012 21:36:16 -0000 1.641
@@ -31,6 +31,7 @@
- 3487675 Log messages can be concatenated
- 3492362 Problem with whitespace trimming if local connect only
- 3457460 PAM_RHOST set wrong
+- 3495343 Bad pointer references in trace statements
Changes in 1.3.13
=================
Index: indCIMXMLExport.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/indCIMXMLExport.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- indCIMXMLExport.c 21 Jan 2010 21:50:37 -0000 1.14
+++ indCIMXMLExport.c 28 Feb 2012 21:36:16 -0000 1.15
@@ -353,7 +353,7 @@
}
}
- _SFCB_TRACE(1,("--- url: %s rc: %d %s",url,rc,msg));
+ _SFCB_TRACE(1,("--- url: %s rc: %d %s",url,rc,*msg));
if (rc) {
mlogf(M_ERROR,M_SHOW,"Problem processing indication to %s. sfcb rc: %d %s\n", url,rc,*msg);
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.717
retrieving revision 1.718
diff -u -d -r1.717 -r1.718
--- ChangeLog 24 Feb 2012 22:49:40 -0000 1.717
+++ ChangeLog 28 Feb 2012 21:36:16 -0000 1.718
@@ -1,3 +1,8 @@
+2012-02-28 Dave Heller <hel...@us...>
+
+ * cimslpSLP.c, indCIMXMLExport.c:
+ [ 3495343 ] Bad pointer references in trace statements
+
2012-02-24 Chris Buccella <buc...@li...>
* Makefile.am, sfcbsem.c
Index: cimslpSLP.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/cimslpSLP.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cimslpSLP.c 29 Jun 2010 22:38:06 -0000 1.11
+++ cimslpSLP.c 28 Feb 2012 21:36:16 -0000 1.12
@@ -181,7 +181,7 @@
printf
("--- Error deregistering service with slp (%i) ... it will now timeout\n",
err);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
}
SLPClose(hslp);
}
@@ -216,7 +216,7 @@
*urlsyntax = (char *) malloc(strlen(css.url_syntax) + 14); // ("service:wbem:"
// = 13) + \0
sprintf(*urlsyntax, "service:wbem:%s", css.url_syntax);
- _SFCB_TRACE(4, ("--- urlsyntax: %s\n", urlsyntax));
+ _SFCB_TRACE(4, ("--- urlsyntax: %s\n", *urlsyntax));
}
attrstring = malloc(sizeof(char) * SIZE);
|
|
From: Michael Chase-S. <mc...@us...> - 2012-02-24 23:48:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 1fe218093ac8dbdc009a8cddfc35c3042642d87b (commit)
via be8e5777460c7e6356d039c6477e588079de3d99 (commit)
from 2aacc4b26f420a661cb7c606efdfb86c59280a95 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1fe218093ac8dbdc009a8cddfc35c3042642d87b
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:47:59 2012 -0500
[ 3488688 ] Don't spawn logger for clients
commit be8e5777460c7e6356d039c6477e588079de3d99
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:45:57 2012 -0500
3488688 Don't spawn logger for clients
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 29f8092..bf96565 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
* mlog.c:
[ 3487675 ] Log message troubles with \n
+ * mlog.c, mlog.h, cimcClientSfcbLocal.c, sfcBroker.c, sfcbinst2mof.c:
+ [ 3488688 ] Don't spawn logger for clients
+
2012-01-26 Michael Chase-Salerno <br...@li...>
* interopProvider.c, indCIMXMLHandler.c, indRetryTest.sh
diff --git a/cimcClientSfcbLocal.c b/cimcClientSfcbLocal.c
index f92e579..b2081bc 100644
--- a/cimcClientSfcbLocal.c
+++ b/cimcClientSfcbLocal.c
@@ -2091,7 +2091,7 @@ _Create_SfcbLocal_Env(char *id)
env->hdl = NULL;
env->ft = &localFT;
// enable logging when called from sfcc
- startLogging(LOG_ERR);
+ startLogging(LOG_ERR,0);
// enable trace logging
_SFCB_TRACE_INIT();
diff --git a/mlog.c b/mlog.c
index 3f12032..291af0d 100644
--- a/mlog.c
+++ b/mlog.c
@@ -31,6 +31,9 @@ const char *_mlog_id =
#include "trace.h" /* for setSignal() */
#include <sys/wait.h>
+// Macro to open the syslog
+#define OPENLOG(level) openlog("sfcb", LOG_PID, LOG_DAEMON); setlogmask(LOG_UPTO(level));
+
FILE *log_w_stream;
int logfds[2] = { 0, 0 };
@@ -45,8 +48,7 @@ runLogger(int listenFd, int level)
int priosysl;
char buf[LOG_MSG_MAX];
- openlog("sfcb", LOG_PID, LOG_DAEMON);
- setlogmask(LOG_UPTO(level));
+ OPENLOG(level);
stream = fdopen(listenFd, "r");
@@ -79,8 +81,15 @@ runLogger(int listenFd, int level)
* sets up the logging pipe and forks off the logger process
*/
void
-startLogging(int level)
+startLogging(int level, int thread)
{
+ // if we're a client, just open the log and
+ // don't start a logger.
+ if (! thread ) {
+ OPENLOG(level);
+ return;
+ }
+
pipe(logfds);
int lpid;
lpid = fork();
diff --git a/mlog.h b/mlog.h
index e8441c5..15bce24 100644
--- a/mlog.h
+++ b/mlog.h
@@ -29,7 +29,7 @@
#define LOG_MSG_MAX 4096
-void startLogging(int level);
+void startLogging(int level, int thread);
void closeLogging();
void mlogf(int priority, int errout, const char *fmt, ...);
diff --git a/sfcBroker.c b/sfcBroker.c
index ea7ee59..b755fe5 100644
--- a/sfcBroker.c
+++ b/sfcBroker.c
@@ -641,7 +641,7 @@ main(int argc, char *argv[])
usage(1);
}
- startLogging(syslogLevel);
+ startLogging(syslogLevel,1);
mlogf(M_INFO, M_SHOW, "--- %s V" sfcHttpDaemonVersion " started - %d\n",
name, currentProc);
diff --git a/sfcbinst2mof.c b/sfcbinst2mof.c
index 4beae48..40ca488 100644
--- a/sfcbinst2mof.c
+++ b/sfcbinst2mof.c
@@ -1,6 +1,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <syslog.h>
#include "cmpi/cmpidt.h"
#include "cmpi/cmpimacs.h"
@@ -9,6 +10,7 @@
#include "objectImpl.h"
#include "control.h"
#include "array.h"
+#include "mlog.h"
#define VERSION "0.8.0"
@@ -425,6 +427,8 @@ main(int argc, char *argv[])
help(argv[0]);
return 0;
}
+
+ startLogging(LOG_INFO,0);
// now let's get to work
char *ns = namespace;
char *clsname = classname;
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Michael Chase-S. <mc...@us...> - 2012-02-24 23:27:52
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 2aacc4b26f420a661cb7c606efdfb86c59280a95 (commit)
via 2ae282e5325d7c928a101daaffa9571a499254a9 (commit)
from 91be3529cd5467d83df93caba18d9b3694175908 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2aacc4b26f420a661cb7c606efdfb86c59280a95
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:27:31 2012 -0500
3487675-Log-message-troubles-with-n
commit 2ae282e5325d7c928a101daaffa9571a499254a9
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:25:02 2012 -0500
3487675 Log message troubles with \n
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 1d2ffa8..29f8092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* interopProvider.c, indCIMXMLHandler.c, sfcb.cfg.pre.in
[ 3484025 ] Disable indication sequencing
+ * mlog.c:
+ [ 3487675 ] Log message troubles with \n
+
2012-01-26 Michael Chase-Salerno <br...@li...>
* interopProvider.c, indCIMXMLHandler.c, indRetryTest.sh
diff --git a/mlog.c b/mlog.c
index fc8515d..3f12032 100644
--- a/mlog.c
+++ b/mlog.c
@@ -139,7 +139,15 @@ mlogf(int priority, int errout, const char *fmt, ...)
char buf[LOG_MSG_MAX];
va_start(ap, fmt);
- vsnprintf(buf, LOG_MSG_MAX, fmt, ap);
+ // Leave a space for the /n on the end.
+ vsnprintf(buf, LOG_MSG_MAX-1, fmt, ap);
+ // Now check to make sure we have a /n at the end
+ int buflen=strlen(buf);
+ if ( buf[buflen-1] != '\n' ) {
+ strcat(buf,"\n");
+ }
+
+
/*
* we sometimes call mlogf when sfcbd isn't started (i.e. via
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Michael Chase-S. <mc...@us...> - 2012-02-24 23:12:14
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 91be3529cd5467d83df93caba18d9b3694175908 (commit)
via fcb41dfc9a13fdcc7840747fbde20d507e46d603 (commit)
from aa547cbd23a10c9adffbed6782cd34da76b245d6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 91be3529cd5467d83df93caba18d9b3694175908
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:11:57 2012 -0500
3484025 Disable indication sequencing
commit fcb41dfc9a13fdcc7840747fbde20d507e46d603
Author: Michael Chase-Salerno <br...@li...>
Date: Fri Feb 24 18:09:08 2012 -0500
3484025 Disable indication sequencing
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index cfc8130..1d2ffa8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-24 Michael Chase-Salerno <br...@li...>
+
+ * interopProvider.c, indCIMXMLHandler.c, sfcb.cfg.pre.in
+ [ 3484025 ] Disable indication sequencing
+
2012-01-26 Michael Chase-Salerno <br...@li...>
* interopProvider.c, indCIMXMLHandler.c, indRetryTest.sh
diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c
index ba7bbdc..3a827fe 100644
--- a/indCIMXMLHandler.c
+++ b/indCIMXMLHandler.c
@@ -62,6 +62,8 @@ interOpNameSpace(const CMPIObjectPath * cop, CMPIStatus *st)
return 1;
}
+int RIEnabled=-1;
+
/*
* ------------------------------------------------------------------ *
* Instance MI Cleanup
@@ -420,6 +422,8 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi,
strftime(gtime, 15, "%Y%m%d%H%M%S", &cttm);
}
+ // Even though reliable indications may be disabled, we need to do this
+ // in case it ever gets enabled.
// Get the IndicationService name
CMPIObjectPath * isop = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL);
CMPIEnumeration * isenm = _broker->bft->enumerateInstances(_broker, ctx, isop, NULL, NULL);
@@ -953,55 +957,60 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi,
if (strcasecmp(methodName, "_deliver") == 0) {
- // Set the indication sequence values
+ // On the first indication, check if reliable indications are enabled.
+ if (RIEnabled == -1) {
+ CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL);
+ CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
+ CMPIData isinst=CMGetNext(isenm,NULL);
+ CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
+ RIEnabled=mc.value.uint16;
+ }
+
CMPIInstance *indo=CMGetArg(in,"indication",NULL).value.inst;
CMPIInstance *ind=CMClone(indo,NULL);
- CMPIObjectPath * iop=CMGetObjectPath(ind,NULL);
- CMPIInstance *sub=CMGetArg(in,"subscription",NULL).value.inst;
- CMPIObjectPath * subop=CMGetObjectPath(sub,NULL);
- CMPIData handler=CMGetProperty(sub, "Handler", &st);
- CMPIObjectPath *hop=handler.value.ref;
- CMPIContext *ctxLocal = prepareUpcall((CMPIContext *) ctx);
- CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st);
- CMAddKey(iop,"SFCB_IndicationID",&indID,CMPI_uint32);
- CMSetProperty(ind,"SFCB_IndicationID",&indID,CMPI_uint32);
-
- // Build the complete sequence context
- // Get the stub from the handler
- CMPIString *context = CMGetProperty(hdlr, "SequenceContext", &st).value.string;
- // and add the sfcb start time
- char *cstr=malloc( (strlen(context->ft->getCharPtr(context,NULL)) + strlen(sfcBrokerStart) + 1) * sizeof(char));
- sprintf(cstr,"%s%s",context->ft->getCharPtr(context,NULL),sfcBrokerStart);
- context = sfcb_native_new_CMPIString(cstr, NULL, 0);
- // and put it in the indication
- CMSetProperty(ind, "SequenceContext", &context, CMPI_string);
- free(cstr);
- CMRelease(context);
-
- // Get the proper sequence number
- CMPIValue lastseq = CMGetProperty(hdlr, "LastSequenceNumber", &st).value;
- lastseq.sint64++;
- // Handle wrapping of the signed int
- if (lastseq.sint64 < 0) lastseq.sint64=0;
- // Update the last used number in the handler
- CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64);
- CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL);
- // And the indication
- CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64);
+ CMPIContext *ctxLocal=NULL;
+ CMPIObjectPath *iop=NULL,*subop=NULL;
+ CMPIInstance *sub=NULL;
+
+ if (RIEnabled) {
+ ctxLocal = prepareUpcall((CMPIContext *) ctx);
+ // Set the indication sequence values
+ iop=CMGetObjectPath(ind,NULL);
+ CMAddKey(iop,"SFCB_IndicationID",&indID,CMPI_uint32);
+ CMSetProperty(ind,"SFCB_IndicationID",&indID,CMPI_uint32);
+ sub=CMGetArg(in,"subscription",NULL).value.inst;
+ CMPIData handler=CMGetProperty(sub, "Handler", &st);
+ CMPIObjectPath *hop=handler.value.ref;
+ CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st);
+
+ // Build the complete sequence context
+ // Get the stub from the handler
+ CMPIString *context = CMGetProperty(hdlr, "SequenceContext", &st).value.string;
+ // and add the sfcb start time
+ char *cstr=malloc( (strlen(context->ft->getCharPtr(context,NULL)) + strlen(sfcBrokerStart) + 1) * sizeof(char));
+ sprintf(cstr,"%s%s",context->ft->getCharPtr(context,NULL),sfcBrokerStart);
+ context = sfcb_native_new_CMPIString(cstr, NULL, 0);
+ // and put it in the indication
+ CMSetProperty(ind, "SequenceContext", &context, CMPI_string);
+ free(cstr);
+ CMRelease(context);
+
+ // Get the proper sequence number
+ CMPIValue lastseq = CMGetProperty(hdlr, "LastSequenceNumber", &st).value;
+ lastseq.sint64++;
+ // Handle wrapping of the signed int
+ if (lastseq.sint64 < 0) lastseq.sint64=0;
+ // Update the last used number in the handler
+ CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64);
+ CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL);
+ // And the indication
+ CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64);
+ }
// Now send the indication
st = deliverInd(ref, in, ind);
if (st.rc != 0) {
- // Get the retry params from IndService
- CMPIObjectPath *op =
- CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService",
- NULL);
- CMPIEnumeration *isenm =
- _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
- CMPIData isinst = CMGetNext(isenm, NULL);
- CMPIData mc =
- CMGetProperty(isinst.value.inst, "DeliveryRetryAttempts", NULL);
- if (mc.value.uint16 > 0) {
+ if (RIEnabled){
_SFCB_TRACE(1,("--- Indication delivery failed, adding to retry queue"));
// Indication delivery failed, send to retry queue
// build an element
@@ -1009,6 +1018,7 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi,
element = (RTElement *) malloc(sizeof(*element));
element->ref=ref->ft->clone(ref,NULL);
// Get the OP of the subscription and indication
+ subop=CMGetObjectPath(sub,NULL);
element->sub=subop->ft->clone(subop,NULL);
element->ind=iop->ft->clone(iop,NULL);
// Store other attrs
@@ -1033,9 +1043,9 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi,
CMPIContext *pctx = native_clone_CMPIContext(ctx);
pthread_create(&t, &tattr, &retryExport, (void *) pctx);
}
+ CMRelease(ctxLocal);
}
}
- CMRelease(ctxLocal);
CMRelease(ind);
}
else {
diff --git a/interopProvider.c b/interopProvider.c
index 6e62a1a..cf6b94c 100644
--- a/interopProvider.c
+++ b/interopProvider.c
@@ -58,6 +58,7 @@ extern void memLinkObjectPath(CMPIObjectPath * op);
static const CMPIBroker *_broker;
static int firstTime = 1;
+int RIEnabled=0;
typedef struct filter {
CMPIInstance *fci;
@@ -731,6 +732,12 @@ initInterOp(const CMPIBroker * broker, const CMPIContext *ctx)
CMRelease(enm);
}
+ CMPIObjectPath *isop=CMNewObjectPath(broker,"root/interop","CIM_IndicationService",NULL);
+ CMPIEnumeration *isenm = broker->bft->enumerateInstances(broker, ctx, isop, NULL, NULL);
+ CMPIData isinst=CMGetNext(isenm,NULL);
+ CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
+ int RIEnabled=mc.value.uint16;
+
_SFCB_TRACE(1, ("--- checking for cim_listenerdestination"));
op = CMNewObjectPath(broker, "root/interop", "cim_listenerdestination",
&st);
@@ -740,11 +747,13 @@ initInterOp(const CMPIBroker * broker, const CMPIContext *ctx)
while (enm->ft->hasNext(enm, &st)
&& (ci = (enm->ft->getNext(enm, &st)).value.inst)) {
cop = CMGetObjectPath(ci, &st);
- // Reset the sequence numbers on sfcb restart
- CMPIInstance *ldi = _broker->bft->getInstance(_broker, ctxLocal, cop, NULL, NULL);
- CMPIValue zarro = {.sint64 = -1 };
- CMSetProperty(ldi, "LastSequenceNumber", &zarro, CMPI_sint64);
- CBModifyInstance(_broker, ctxLocal, cop, ldi, NULL);
+ if (RIEnabled) {
+ // Reset the sequence numbers on sfcb restart
+ CMPIInstance *ldi = _broker->bft->getInstance(_broker, ctxLocal, cop, NULL, NULL);
+ CMPIValue zarro = {.sint64 = -1 };
+ CMSetProperty(ldi, "LastSequenceNumber", &zarro, CMPI_sint64);
+ CBModifyInstance(_broker, ctxLocal, cop, ldi, NULL);
+ }
addHandler(ci, cop);
}
CMRelease(enm);
diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in
index 20c69f7..ac4ad1f 100644
--- a/sfcb.cfg.pre.in
+++ b/sfcb.cfg.pre.in
@@ -257,6 +257,8 @@ sslCiphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
## Number of retry attempts before giving up
## Default is 3 attempts (not including initial attempt)
## A value of 0 disables reliable indications
+## including indication sequence numbers and subscription
+## removal.
#DeliveryRetryAttempts: 3
## The length of time an destination can fail before the subscription
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-02-24 22:49:43
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv31868
Modified Files:
Makefile.am ChangeLog NEWS
Added Files:
sfcbsem.c
Log Message:
[ 3493493 ] Adds sfcbsem
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.639
retrieving revision 1.640
diff -u -d -r1.639 -r1.640
--- NEWS 24 Feb 2012 01:35:48 -0000 1.639
+++ NEWS 24 Feb 2012 22:49:40 -0000 1.640
@@ -11,7 +11,7 @@
- 3484025 Disable indication sequencing
- 3462309 Do not allow multiple instances of sfcb
- 3488688 Don't spawn logger for clients
-
+- 3493493 Add sfcbsem
Bugs fixed:
Index: Makefile.am
===================================================================
RCS file: /cvsroot/sblim/sfcb/Makefile.am,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- Makefile.am 3 Feb 2012 16:45:57 -0000 1.115
+++ Makefile.am 24 Feb 2012 22:49:40 -0000 1.116
@@ -183,7 +183,7 @@
sfcbmofpp sfcbdump sfcbinst2mof
noinst_PROGRAMS = \
- sfcbdumpP32onI32 classSchema2c
+ sfcbdumpP32onI32 classSchema2c sfcbsem
libsfcUtil_la_SOURCES = \
sfcUtil/hashtable.c \
@@ -441,6 +441,8 @@
classSchema2c_LDADD=-lsfcBrokerCore
classSchema2c_DEPENDENCIES=libsfcBrokerCore.la
+sfcbsem_SOURCES=sfcbsem.c
+
noinst_HEADERS=array.h $(SLP_INC) httpComm.h control.h providerMgr.h \
constClass.h msgqueue.h providerRegister.h \
cimXmlParser.h native.h support.h cimXmlGen.h \
--- NEW FILE: sfcbsem.c ---
/*
* $Id: sfcbsem.c,v 1.1 2012/02/24 22:49:40 buccella Exp $
*
* (C) Copyright IBM Corp. 2006
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Eclipse Public License from
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* Author: Viktor Mihajlovski
*
* Description:
*
* sfcBroker semaphore state lister
*
*/
/* includes */
#include <stdio.h>
#include <getopt.h>
#include <errno.h>
#include "msgqueue.h"
/* defines */
#define BINARY_NAME argv[0]
#define SFCB_SEM 'S'
#define HTTPW_SEM 'W'
#define HTTPP_SEM 'H'
/* local types */
typedef struct _localsem {
int ls_id; /* semaphore number */
int ls_val; /* semaphore value */
} localsem;
/* local data */
static int opt_process = 0;
static int opt_cimxml = 0;
static int opt_all = 1;
/* local functions */
static int checkargs(int argc, char * argv[]);
static int check_sem(char c);
static int get_semnum(int id);
static int fill_sem(int id, localsem *ls, int num, int index);
static int check_and_print_sem(char c, char * s);
static int check_and_print_sfcbsem(char c, char * s);
int main(int argc, char * argv[])
{
int rc = checkargs(argc,argv);
if (opt_process) {
rc = check_and_print_sfcbsem(SFCB_SEM,"SFCB Process");
}
if (opt_cimxml) {
rc = check_and_print_sem(HTTPW_SEM,"HTTP Worker");
if (rc > 0) {
rc = check_and_print_sem(HTTPP_SEM,"HTTP Process");
}
}
return rc;
}
static int checkargs(int argc, char * argv[])
{
int c;
int option_details=0;
static struct option const long_options[] =
{
{ "cimxml", no_argument, 0,'c' },
{ "process", no_argument, 0,'p' },
{ "help", no_argument, 0,'h' },
{ 0, 0, 0, 0 }
};
while ((c = getopt_long(argc, argv, "cph", long_options, 0)) != -1) {
switch(c) {
case 'c':
opt_cimxml = 1;
opt_all = 0;
break;
case 'p':
opt_process = 1;
opt_all = 0;
break;
case 'h':
option_details = 1;
opt_all = 0;
break;
default:
return 1;
break;
}
}
if (opt_all) {
/* if nothing specified print all */
opt_process = opt_cimxml = 1;
}
if (argc - optind != 0 || option_details) {
fprintf(stderr,"Usage: %s [-cph]\n",BINARY_NAME);
if (option_details) {
fprintf(stderr,"\n\tAllowed options:\n");
fprintf(stderr,"\t-c, --cimxml Display CIMXML/HTTP Semaphores\n");
fprintf(stderr,"\t-p, --process Display Process Semaphores\n");
fprintf(stderr,"\t-h, --help Show usage info\n");
}
return 2;
} else {
return 0;
}
}
static int check_sem(char c)
{
int key=ftok(SFCB_BINARY,c);
return semget(key,0, 0600);
}
static int get_semnum(int id)
{
int rc;
struct semid_ds ds;
rc = semctl(id,0,IPC_STAT,&ds);
if (rc < 0) {
return rc;
} else {
return ds.sem_nsems;
}
}
static int fill_sem(int id, localsem * ls, int num, int index)
{
int rc;
int i;
short *semv = calloc(num,sizeof(short));
if (semv) {
rc = semctl(id,0,GETALL,semv);
if (rc < 0) {
return rc;
} else {
for (i=0; i<num; i++) {
ls[i].ls_id = i + index;
ls[i].ls_val = semv[i + index];
}
free(semv);
return i;
}
}
return -1;
}
static int check_and_print_sem(char c, char * s)
{
int rc;
int id;
int num;
int i;
localsem * localsems;
if ((id = check_sem(c)) <= 0) {
fprintf(stderr,"Could not open %s Semaphore, reason: %s\n",
s, strerror(errno));
rc = -1;
} else if ((num = get_semnum(id)) <= 0) {
fprintf(stderr,"Could not stat %s Semaphore, reason: %s\n",
s, strerror(errno));
rc = -1;
} else {
localsems = calloc(num,sizeof(localsem));
if (num != fill_sem(id,localsems,num,0)) {
fprintf(stderr,"Could not get all %d %s Semaphores reason: %s\n",
num, s, strerror(errno));
rc = -1;
} else {
printf("SFCB Semaphore Set for %s\n",s);
printf("Id\tValue\n");
for (i=0; i<num;i++) {
printf("%d\t%d\n",localsems[i].ls_id,localsems[i].ls_val);
}
rc = i;
}
free(localsems);
}
return rc;
}
static int check_and_print_sfcbsem(char c, char * s)
{
int rc;
int id;
int num;
int i;
localsem * localsems;
if ((id = check_sem(c)) <= 0) {
fprintf(stderr,"Could not open %s Semaphore, reason: %s\n",
s, strerror(errno));
rc = -1;
} else if ((num = get_semnum(id)) <= 0) {
fprintf(stderr,"Could not stat %s Semaphore, reason: %s\n",
s, strerror(errno));
rc = -1;
} else if (num - PROV_PROC_BASE_ID < PROV_PROC_NUM_SEMS) {
fprintf(stderr, "Not enough process semaphores found: %d\n",num);
rc = -1;
} else {
localsems = calloc(num,sizeof(localsem));
if (num != fill_sem(id,localsems,num,0)) {
fprintf(stderr,"Could not get all %d %s Semaphores reason: %s\n",
num, s, strerror(errno));
rc = -1;
} else {
printf("SFCB Process Semaphore Set\n");
printf("Id\tGuard\tInuse\tAlive\n");
num = (num - PROV_PROC_BASE_ID) / PROV_PROC_NUM_SEMS;
for (i=0; i<num;i++) {
printf("%d\t%d\t%d\t%d\n",i,
localsems[PROV_GUARD(i)].ls_val,
localsems[PROV_INUSE(i)].ls_val,
localsems[PROV_ALIVE(i)].ls_val);
}
rc = i;
}
free(localsems);
}
return rc;
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.716
retrieving revision 1.717
diff -u -d -r1.716 -r1.717
--- ChangeLog 24 Feb 2012 01:35:48 -0000 1.716
+++ ChangeLog 24 Feb 2012 22:49:40 -0000 1.717
@@ -1,3 +1,9 @@
+2012-02-24 Chris Buccella <buc...@li...>
+
+ * Makefile.am, sfcbsem.c
+ [ 3493493 ] Add sfcbsem
+ (code by Viktor Mihajlovski)
+
2012-02-23 Michael Chase-Salerno <br...@li...>
* httpAdapter.c:
|
|
From: Michael Chase-S. <mc...@us...> - 2012-02-24 01:35:51
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv31863
Modified Files:
ChangeLog NEWS httpAdapter.c
Log Message:
3457460 PAM_RHOST set wrong
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.638
retrieving revision 1.639
diff -u -d -r1.638 -r1.639
--- NEWS 23 Feb 2012 21:25:25 -0000 1.638
+++ NEWS 24 Feb 2012 01:35:48 -0000 1.639
@@ -30,6 +30,7 @@
- 3487419 TestIndication Provider Does Enable Correctly
- 3487675 Log messages can be concatenated
- 3492362 Problem with whitespace trimming if local connect only
+- 3457460 PAM_RHOST set wrong
Changes in 1.3.13
=================
Index: httpAdapter.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- httpAdapter.c 23 Feb 2012 21:25:25 -0000 1.97
+++ httpAdapter.c 24 Feb 2012 01:35:48 -0000 1.98
@@ -966,7 +966,7 @@
/* for PAM, client's IP address is used for host-based authentication */
struct sockaddr_storage from;
socklen_t from_len = sizeof(from);
- getsockname(conn_fd.socket, (struct sockaddr *)&from, &from_len);
+ getpeername(conn_fd.socket, (struct sockaddr *)&from, &from_len);
#ifdef USE_INET6
char ipstr[INET6_ADDRSTRLEN] = {0};
#else
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.715
retrieving revision 1.716
diff -u -d -r1.715 -r1.716
--- ChangeLog 23 Feb 2012 21:25:24 -0000 1.715
+++ ChangeLog 24 Feb 2012 01:35:48 -0000 1.716
@@ -1,5 +1,10 @@
2012-02-23 Michael Chase-Salerno <br...@li...>
+ * httpAdapter.c:
+ [ 3457460 ] PAM_RHOST set wrong
+
+2012-02-23 Michael Chase-Salerno <br...@li...>
+
* httpAdapter.c, sfcBroker.c:
[ 3492362 ] Problem with whitespace trimming if local connect only
|
|
From: Michael Chase-S. <mc...@us...> - 2012-02-23 21:25:27
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv2012
Modified Files:
ChangeLog NEWS httpAdapter.c sfcBroker.c
Log Message:
3492362 Problem with whitespace trimming if local connect only
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.637
retrieving revision 1.638
diff -u -d -r1.637 -r1.638
--- NEWS 17 Feb 2012 22:54:59 -0000 1.637
+++ NEWS 23 Feb 2012 21:25:25 -0000 1.638
@@ -29,6 +29,7 @@
- 3485830 SFCB Makes Redundant ActivateFilter Calls
- 3487419 TestIndication Provider Does Enable Correctly
- 3487675 Log messages can be concatenated
+- 3492362 Problem with whitespace trimming if local connect only
Changes in 1.3.13
=================
Index: sfcBroker.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- sfcBroker.c 17 Feb 2012 22:54:59 -0000 1.60
+++ sfcBroker.c 23 Feb 2012 21:25:25 -0000 1.61
@@ -98,6 +98,8 @@
static int restartArgc;
static int adaptersStopped=0,providersStopped=0,restartBroker=0;
+int trimws=1;
+
extern char * configfile;
typedef struct startedAdapter {
@@ -774,6 +776,11 @@
"--- Max provider process number adjusted to %d\n", pSockets);
}
+ // Check for whitespace trimming option
+ if (getControlBool("trimWhitespace", &trimws)) {
+ trimws = 0;
+ }
+
if ((enableHttp || enableHttps) && dSockets > 0) {
startHttp = 1;
}
Index: httpAdapter.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- httpAdapter.c 23 Nov 2011 03:24:00 -0000 1.96
+++ httpAdapter.c 23 Feb 2012 21:25:25 -0000 1.97
@@ -90,7 +90,6 @@
static long numRequest;
static long selectTimeout = 5; /* default 5 sec. timeout for select() before read() */
struct timeval httpSelectTimeout = {0, 0};
-int trimws;
#if defined USE_SSL
static SSL_CTX *ctx;
@@ -1621,9 +1620,6 @@
noChunking = 0;
noChunking = noChunking == 0;
- if (getControlBool("trimWhitespace", &trimws))
- trimws = 0;
-
/*
* grab commandline options
*/
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.714
retrieving revision 1.715
diff -u -d -r1.714 -r1.715
--- ChangeLog 17 Feb 2012 22:54:59 -0000 1.714
+++ ChangeLog 23 Feb 2012 21:25:24 -0000 1.715
@@ -1,3 +1,8 @@
+2012-02-23 Michael Chase-Salerno <br...@li...>
+
+ * httpAdapter.c, sfcBroker.c:
+ [ 3492362 ] Problem with whitespace trimming if local connect only
+
2012-02-17 Michael Chase-Salerno <br...@li...>
* mlog.c, mlog.h, cimcClientSfcbLocal.c,
|
|
From: Dave B. <bla...@us...> - 2012-02-23 21:08:26
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/util
In directory vz-cvs-3.sog:/tmp/cvs-serv31889/src/org/sblim/cimclient/internal/util
Modified Files:
Tag: Experimental
WBEMConfiguration.java WBEMConfigurationDefaults.java
Log Message:
3492224 - Need two different timeouts for Socket connections
Index: WBEMConfigurationDefaults.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/util/WBEMConfigurationDefaults.java,v
retrieving revision 1.11.2.18
retrieving revision 1.11.2.19
diff -u -d -r1.11.2.18 -r1.11.2.19
--- WBEMConfigurationDefaults.java 23 Feb 2012 20:17:55 -0000 1.11.2.18
+++ WBEMConfigurationDefaults.java 23 Feb 2012 21:08:24 -0000 1.11.2.19
@@ -33,6 +33,7 @@
* 3206904 2011-05-03 blaschke-oss Indication listener deadlock causes JVM to run out sockets
* 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
* 3492214 2012-02-23 blaschke-oss Add a SenderIPAddress property indications
+ * 3492224 2012-02-23 blaschke-oss Need two different timeouts for Socket connections
*/
package org.sblim.cimclient.internal.util;
@@ -204,6 +205,11 @@
public static final String SOCKET_CONNECT_WITH_TIMEOUT = "true";
/**
+ * SOCKET_CONNECT_TIMEOUT
+ */
+ public static final String SOCKET_CONNECT_TIMEOUT = "0";
+
+ /**
* KEY_CREDENTIALS_DEFAULT_ENABLED
*/
public static final String KEY_CREDENTIALS_DEFAULT_ENABLED = "false";
Index: WBEMConfiguration.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/util/WBEMConfiguration.java,v
retrieving revision 1.17.2.28
retrieving revision 1.17.2.29
diff -u -d -r1.17.2.28 -r1.17.2.29
--- WBEMConfiguration.java 23 Feb 2012 20:17:55 -0000 1.17.2.28
+++ WBEMConfiguration.java 23 Feb 2012 21:08:23 -0000 1.17.2.29
@@ -38,6 +38,7 @@
* 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
* 3485074 2012-02-06 blaschke-oss An Indication trace request
* 3492214 2012-02-23 blaschke-oss Add a SenderIPAddress property indications
+ * 3492224 2012-02-23 blaschke-oss Need two different timeouts for Socket connections
*/
package org.sblim.cimclient.internal.util;
@@ -785,6 +786,16 @@
}
/**
+ * Returns the socket connect timeout
+ *
+ * @return The socket connect timeout
+ */
+ public int getSocketConnectTimeout() {
+ return Integer.parseInt(getProperty(WBEMConfigurationProperties.SOCKET_CONNECT_TIMEOUT,
+ WBEMConfigurationDefaults.SOCKET_CONNECT_TIMEOUT));
+ }
+
+ /**
* isDefaultAuthorizationEnabled
*
* @return true if default authorization is enabled
|
|
From: Dave B. <bla...@us...> - 2012-02-23 20:17:58
|
Update of /cvsroot/sblim/jsr48-client
In directory vz-cvs-3.sog:/tmp/cvs-serv1377
Modified Files:
Tag: Experimental
sblim-cim-client2.properties
Log Message:
3492214 - Add a SenderIPAddress property indications
Index: sblim-cim-client2.properties
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/sblim-cim-client2.properties,v
retrieving revision 1.1.2.28
retrieving revision 1.1.2.29
diff -u -d -r1.1.2.28 -r1.1.2.29
--- sblim-cim-client2.properties 23 Feb 2012 18:20:57 -0000 1.1.2.28
+++ sblim-cim-client2.properties 23 Feb 2012 20:17:56 -0000 1.1.2.29
@@ -668,4 +668,18 @@
# Recognition: On next creation of WBEMListener
# Format: [class:]property[,property]*
#
-#sblim.wbem.listenerIndicationTraceFilter=
\ No newline at end of file
+#sblim.wbem.listenerIndicationTraceFilter=
+
+# If set to true, a property will be added to all indications that identifies
+# the sender's IP address. If set to false, the property will not be added.
+#
+# The property is a CIMProperty with:
+# name = "SBLIMJCC_SenderIPAddress"
+# type = CIMDataType.STRING_T
+# value = String returned by InetAddress.getHostAddress() (i.e. 1.2.3.4)
+#
+# Type: Boolean
+# Recognition: On next creation of a WBEMListener
+# Default: false
+#
+#sblim.wbem.listenerAddSenderIPAddress=false
\ No newline at end of file
|
|
From: Dave B. <bla...@us...> - 2012-02-23 18:21:00
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient
In directory vz-cvs-3.sog:/tmp/cvs-serv1722/src/org/sblim/cimclient
Modified Files:
Tag: Experimental
WBEMConfigurationProperties.java
Log Message:
3492246 - Rename new indication trace property
Index: WBEMConfigurationProperties.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/WBEMConfigurationProperties.java,v
retrieving revision 1.17.2.27
retrieving revision 1.17.2.28
diff -u -d -r1.17.2.27 -r1.17.2.28
--- WBEMConfigurationProperties.java 7 Feb 2012 03:15:28 -0000 1.17.2.27
+++ WBEMConfigurationProperties.java 23 Feb 2012 18:20:58 -0000 1.17.2.28
@@ -35,6 +35,7 @@
* 3288721 2011-05-20 blaschke-oss Need the function of indication reordering
* 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
* 3485074 2012-02-06 blaschke-oss An Indication trace request
+ * 3492246 2012-02-23 blaschke-oss Rename new indication trace property
*/
package org.sblim.cimclient;
@@ -843,5 +844,5 @@
* Format: [class:]property[,property]*
* </pre>
*/
- public static final String LISTENER_INDICATION_TRACE_FILTER = "sblim.wbem.listener.IndicationTraceFilter";
+ public static final String LISTENER_INDICATION_TRACE_FILTER = "sblim.wbem.listenerIndicationTraceFilter";
}
|
|
From: Dave B. <bla...@us...> - 2012-02-22 12:28:50
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications
In directory vz-cvs-3.sog:/tmp/cvs-serv14303/src/org/sblim/cimclient/internal/wbem/indications
Modified Files:
CIMIndicationHandler.java ReliableIndicationHandler.java
Added Files:
RIHandlerTest.txt
Log Message:
3484022 - Turn reliable indication mode on and off based on SC/SN
Index: CIMIndicationHandler.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications/CIMIndicationHandler.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- CIMIndicationHandler.java 20 Feb 2012 18:59:36 -0000 1.27
+++ CIMIndicationHandler.java 22 Feb 2012 12:28:48 -0000 1.28
@@ -38,6 +38,7 @@
* 3390724 2011-08-12 blaschke-oss Problem with Reliable Indication support in the Listener
* 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
* 3485074 2012-02-06 blaschke-oss An Indication trace request
+ * 3484022 2012-02-08 blaschke-oss Turn reliable indication mode on and off based on SC/SN
*/
package org.sblim.cimclient.internal.wbem.indications;
@@ -108,17 +109,14 @@
private boolean iRIInitialized = false;
- private boolean iRISupported = false;
-
private ReliableIndicationHandler iRIHandler;
public IndicationServer() {
// initialize() does the work
}
- public void initialize(boolean pRISupported, ReliableIndicationHandler pRIHandler) {
+ public void initialize(ReliableIndicationHandler pRIHandler) {
this.iRIInitialized = true;
- this.iRISupported = pRISupported;
this.iRIHandler = pRIHandler;
}
@@ -126,10 +124,6 @@
return this.iRIInitialized;
}
- public boolean isRISupported() {
- return this.iRISupported;
- }
-
public ReliableIndicationHandler getRIHandler() {
return this.iRIHandler;
}
@@ -516,43 +510,8 @@
server = getIndicationServerFromTable(pInetAddress, pId);
}
- // Nothing to do if reliable indications initialized but not supported,
- // go ahead and deliver
- if (server.isInitialized() && !server.isRISupported()) return true;
-
- // Get reliable indication properties from indication
- CIMProperty<?> seqCtxProp = pIndication.getProperty("SequenceContext");
- CIMProperty<?> seqNumProp = pIndication.getProperty("SequenceNumber");
-
- // Initialize (if not yet done so) to check if indication is reliable
+ // Initialize if not yet done so
if (!server.isInitialized()) {
- // Initial indication does not contain reliable indication
- // properties, disable support and go ahead and deliver
- if (seqCtxProp == null || seqNumProp == null) {
- server.initialize(false, null);
-
- this.iLogger
- .trace(
- Level.FINE,
- "Reliable indication support disabled, initial indication does not contain SequenceContext and SequenceNumber properties");
-
- return true;
- }
-
- // Initial indication does not contain reliable indication
- // properties with non-null values, disable support and go ahead
- // and deliver
- if (seqCtxProp.getValue() == null || seqNumProp.getValue() == null) {
- server.initialize(false, null);
-
- this.iLogger
- .trace(
- Level.FINE,
- "Reliable indication support disabled, initial indication does not contain SequenceContext and SequenceNumber properties with non-null values");
-
- return true;
- }
-
// Validate DeliveryRetryAttempts property
long attempts = this.iSessionProperties.getListenerDeliveryRetryAttempts();
if (attempts <= 0 || attempts > 1000) {
@@ -575,42 +534,18 @@
// Create new ReliableIndicationHandler for this
// CIMIndicationHandler
- server.initialize(true, new ReliableIndicationHandler(this.iDispatcher, attempts
- * interval * 10 * 1000));
-
- this.iLogger.trace(Level.FINE,
- "Reliable indication support enabled, DeliveryRetryAttempts=" + attempts
- + ", DeliveryRetryInterval=" + interval);
-
- // Let ReliableIndicationHandler deliver it
- server.getRIHandler().handleIndication(pIndication, seqCtxProp, seqNumProp, pId,
- pInetAddress);
- return false;
- }
-
- // Reliable indication support is enabled but indication does not
- // contain both properties, go ahead and deliver
- if (seqCtxProp == null || seqNumProp == null) {
- this.iLogger.trace(Level.FINE,
- "Reliable indication support enabled but sequence property missing:\n"
- + pIndication.toString());
-
- return true;
- }
-
- // Reliable indication support is enabled but indication does not
- // contain both properties with non-null values, go ahead and deliver
- if (seqCtxProp.getValue() == null || seqNumProp.getValue() == null) {
- this.iLogger.trace(Level.FINE,
- "Reliable indication support enabled but sequence property has null value:\n"
- + pIndication.toString());
+ server.initialize(new ReliableIndicationHandler(this.iDispatcher, attempts * interval
+ * 10 * 1000));
- return true;
+ this.iLogger
+ .trace(Level.FINE, "Reliable indication support enabled for IP "
+ + pInetAddress.getHostAddress() + " and URL " + pId
+ + ", DeliveryRetryAttempts=" + attempts + ", DeliveryRetryInterval="
+ + interval);
}
// Let ReliableIndicationHandler deliver it
- server.getRIHandler().handleIndication(pIndication, seqCtxProp, seqNumProp, pId,
- pInetAddress);
+ server.getRIHandler().handleIndication(pIndication, pId, pInetAddress);
return false;
}
--- NEW FILE: RIHandlerTest.txt ---
This text file contains Java code that can be inserted into CIMIndicationHandler.java in the
dispatchIndications method between the following two lines:
CIMInstance indicationInst = (CIMInstance) cimEvent;
and:
String path = pReader.getMethod().getFile();
This Java code will alter incoming indications to produce out-of-order, duplicate and missing
indications as well as context switches and switches from SC/SN on to off and SC/SN off to on.
Either Jsr48PegasusIndicationSample or Jsr48SfcbIndicationSample can be used to exercise this
Java code, simply alter the samples to:
1) generate 35 indications instead of 1
2) move Thread.sleep(5000) out of loop to end and increase to 30000
3) set sblim.wbem.listenerDeliveryRetryAttempts=1 and sblim.wbem.listenerDeliveryRetryInterval=1
Java code snippet #1 tests just about everything, starting with SC/SN on:
CIMProperty<?> seqNumProp = indicationInst.getProperty("SequenceNumber");
Long seqNum = (Long) seqNumProp.getValue();
long seqNumVal = seqNum.longValue();
// 2,3,4 out of order until 5 arrives
// 7 missing
// 9 duplicate
// 11-14 new context, #'s 11-14
// 15-18 null context
// 19-24 new context, #'s 0-5
// 25-27 null context
// 28+ new context, out of order until 6 arrives
String newCtx1 = new String("MyShinyNewContext");
String newCtx2 = new String("MyBrandSpankingShinyNewContext");
String newCtx3 = new String("MyLastAndFinalBrandSpankingShinyNewContext");
if (seqNumVal == 2) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long("3")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 3) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long("4")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 4) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long("5")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 5) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long("2")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 7) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long("9")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal >= 11 && seqNumVal <= 14) {
CIMProperty<?> n[] = { new CIMProperty<String>("SequenceContext",
CIMDataType.STRING_T, newCtx1) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal >= 15 && seqNumVal <= 18) {
CIMProperty<?> n[] = { new CIMProperty<String>("SequenceContext",
CIMDataType.STRING_T, null) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal >= 19 && seqNumVal <= 24) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx2),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long(seqNumVal - 19)) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal >= 25 && seqNumVal <= 27) {
CIMProperty<?> n[] = { new CIMProperty<String>("SequenceContext",
CIMDataType.STRING_T, null) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 28) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("1")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 29) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("0")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 30) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("3")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 31) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("2")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 32) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("5")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 33) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("4")) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal == 34) {
CIMProperty<?> n[] = {
new CIMProperty<String>("SequenceContext", CIMDataType.STRING_T,
newCtx3),
new CIMProperty<Long>("SequenceNumber", CIMDataType.SINT64_T,
new Long("6")) };
indicationInst = indicationInst.deriveInstance(n);
}
Java code snippet #2 tests starting with SC/SN off:
CIMProperty<?> seqNumProp = indicationInst.getProperty("SequenceNumber");
Long seqNum = (Long) seqNumProp.getValue();
long seqNumVal = seqNum.longValue();
// 0-18 null context
// 19-34 new context, #'s 0-16
if (seqNumVal >= 0 && seqNumVal <= 18) {
CIMProperty<?> n[] = { new CIMProperty<String>("SequenceContext",
CIMDataType.STRING_T, null) };
indicationInst = indicationInst.deriveInstance(n);
} else if (seqNumVal >= 19 && seqNumVal <= 34) {
CIMProperty<?> n[] = { new CIMProperty<Long>("SequenceNumber",
CIMDataType.SINT64_T, new Long(seqNumVal - 19)) };
indicationInst = indicationInst.deriveInstance(n);
}
Index: ReliableIndicationHandler.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications/ReliableIndicationHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ReliableIndicationHandler.java 10 Aug 2011 12:03:30 -0000 1.3
+++ ReliableIndicationHandler.java 22 Feb 2012 12:28:48 -0000 1.4
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2011
+ * (C) Copyright IBM Corp. 2011, 2012
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -16,6 +16,7 @@
*-------------------------------------------------------------------------------
* 3288721 2011-05-20 blaschke-oss Need the function of indication reordering
* 3376657 2011-07-24 blaschke-oss Get reliable indication properties once
+ * 3484022 2012-02-08 blaschke-oss Turn reliable indication mode on and off based on SC/SN
*/
package org.sblim.cimclient.internal.wbem.indications;
@@ -187,6 +188,8 @@
private long iExpectedSequenceNumber = 0;
+ private boolean iIsFirstIndication = true;
+
/**
* Constructs a <code>ReliableIndicationHandler</code> instance that uses
* the specified event dispatcher and sequence identifier lifetime to handle
@@ -331,7 +334,7 @@
}
/**
- * Adds a reliable indication to the .
+ * Adds a reliable indication to the sequence identifier cache.
*
* @param pSequenceContext
* Sequence context of reliable indication to be cached.
@@ -482,30 +485,52 @@
* Main worker routine for <code>ReliableIndicationHandler</code>. The
* indication is either sent directly to the <code>CIMEventDispatcher</code>
* or placed in the indication delivery queue to be dispatched later. All
- * indications are placed in the sequence identifier cache.
+ * reliable indications are placed in the sequence identifier cache.
*
* @param pIndication
- * Reliable indication.
- * @param pSeqCtxProp
- * SequenceContext property.
- * @param pSeqNumProp
- * SequenceNumber property.
+ * Indication.
* @param pId
- * Path portion of reliable indication URL.
+ * Indication destination URL.
* @param pInetAddress
- * Host portion of reliable indication URL.
+ * Indication server IP.
*/
- public synchronized void handleIndication(CIMInstance pIndication, CIMProperty<?> pSeqCtxProp,
- CIMProperty<?> pSeqNumProp, String pId, InetAddress pInetAddress) {
+ public synchronized void handleIndication(CIMInstance pIndication, String pId,
+ InetAddress pInetAddress) {
// Get current time
long arrivalTime = System.currentTimeMillis();
+ // Get reliable indication properties from indication
+ CIMProperty<?> seqCtxProp = pIndication.getProperty("SequenceContext");
+ CIMProperty<?> seqNumProp = pIndication.getProperty("SequenceNumber");
+
+ // At this point indication is reliable or not reliable
+
+ // Indication is not reliable, handle appropriately and deliver
+ if (seqCtxProp == null || seqNumProp == null || seqCtxProp.getValue() == null
+ || seqNumProp.getValue() == null) {
+ // Handle switch from reliable to not reliable
+ if (this.iLastSequenceContext != null) {
+ // Deliver all enqueued indications from previous context
+ flushQueue();
+
+ this.iLastSequenceContext = null;
+ this.iLastSequenceNumber = null;
+ }
+
+ // Deliver indication
+ this.iDispatcher.dispatchEvent(new CIMEvent(pIndication, pId, pInetAddress));
+ this.iIsFirstIndication = false;
+ return;
+ }
+
+ // At this point indication is reliable
+
// Initial indication arrived, save knowledge about sequence identifier
// and deliver
- if (this.iLastSequenceNumber == null) {
+ if (this.iIsFirstIndication) {
// Remember sequence context/number and arrival time
- this.iLastSequenceContext = (String) pSeqCtxProp.getValue();
- this.iLastSequenceNumber = (Long) pSeqNumProp.getValue();
+ this.iLastSequenceContext = (String) seqCtxProp.getValue();
+ this.iLastSequenceNumber = (Long) seqNumProp.getValue();
this.iExpectedSequenceNumber = this.iLastSequenceNumber.longValue() + 1;
// this.iLastArrivalTime = arrivalTime;
@@ -515,11 +540,15 @@
// Deliver indication
this.iDispatcher.dispatchEvent(new CIMEvent(pIndication, pId, pInetAddress));
+ this.iIsFirstIndication = false;
return;
}
- String seqCtx = (String) pSeqCtxProp.getValue();
- Long seqNum = (Long) pSeqNumProp.getValue();
+ // At this point indication is reliable and previous indication was
+ // reliable
+
+ String seqCtx = (String) seqCtxProp.getValue();
+ Long seqNum = (Long) seqNumProp.getValue();
long seqNumVal = seqNum.longValue();
// Indication arrived after sequence identifier lifetime of previous
@@ -550,7 +579,7 @@
// }
// Indication arrived with different sequence context than expected
- if (seqCtx.compareTo(this.iLastSequenceContext) != 0) {
+ if (this.iLastSequenceContext == null || seqCtx.compareTo(this.iLastSequenceContext) != 0) {
// Cached sequence context indicates this indication arrived
// out-of-order from previous context, log and ignore
if (isInCache(seqCtx)) {
|
|
From: Dave B. <bla...@us...> - 2012-02-21 23:36:23
|
Update of /cvsroot/sblim/jsr48-client/src/javax/wbem/client
In directory vz-cvs-3.sog:/tmp/cvs-serv15811/src/javax/wbem/client
Modified Files:
Tag: Experimental
WBEMClientFactory.java
Log Message:
3490355 - TCK: Cannot instantiate WBEMClientFactory
Index: WBEMClientFactory.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/javax/wbem/client/WBEMClientFactory.java,v
retrieving revision 1.2.2.7
retrieving revision 1.2.2.8
diff -u -d -r1.2.2.7 -r1.2.2.8
--- WBEMClientFactory.java 26 Feb 2010 02:00:57 -0000 1.2.2.7
+++ WBEMClientFactory.java 21 Feb 2012 23:36:19 -0000 1.2.2.8
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2006, 2010
+ * (C) Copyright IBM Corp. 2006, 2012
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -20,6 +20,7 @@
* 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
* 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
* 2959264 2010-02-25 blaschke-oss Sync up javax.client.* javadoc with JSR48 1.0.0
+ * 3490355 2012-02-21 blaschke-oss TCK: Cannot instantiate WBEMClientFactory
*/
package javax.wbem.client;
@@ -53,19 +54,12 @@
public class WBEMClientFactory extends Object {
- private static String[] cProtocols;
-
- static {
- cProtocols = new String[1];
- cProtocols[0] = WBEMClientConstants.PROTOCOL_CIMXML;
- }
+ private static final String[] cProtocols = { WBEMClientConstants.PROTOCOL_CIMXML };
/**
*
*/
- public WBEMClientFactory() {
- throw new UnsupportedOperationException("WBEMClientFactory cannot be instantiated.");
- }
+ public WBEMClientFactory() { /**/}
/**
* Get a <code>WBEMClient</code> for a protocol.
|
|
From: Dave B. <bla...@us...> - 2012-02-21 16:30:00
|
Update of /cvsroot/sblim/jsr48-client/src/javax/wbem
In directory vz-cvs-3.sog:/tmp/cvs-serv14009/src/javax/wbem
Modified Files:
Tag: Experimental
WBEMException.java
Log Message:
3490032 - TCK: WBEMException must validate error ID
Index: WBEMException.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/javax/wbem/WBEMException.java,v
retrieving revision 1.3.2.9
retrieving revision 1.3.2.10
diff -u -d -r1.3.2.9 -r1.3.2.10
--- WBEMException.java 25 Feb 2010 23:06:18 -0000 1.3.2.9
+++ WBEMException.java 21 Feb 2012 16:29:57 -0000 1.3.2.10
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2006, 2010
+ * (C) Copyright IBM Corp. 2006, 2012
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -21,6 +21,7 @@
* 2958941 2010-02-25 blaschke-oss Sync up javax.wbem.* javadoc with JSR48 1.0.0
* 2958990 2010-02-25 blaschke-oss Remove WBEMException.CIM_ERR_TYPE_MISMATCH
* 2959039 2010-02-25 blaschke-oss Fix WBEMException.toString() logic
+ * 3490032 2012-02-21 blaschke-oss TCK: WBEMException must validate error ID
*/
package javax.wbem;
@@ -211,12 +212,12 @@
/* 10 */"CIM_ERR_INVALID_SUPERCLASS",
/* 11 */"CIM_ERR_ALREADY_EXISTS",
/* 12 */"CIM_ERR_NO_SUCH_PROPERTY",
- /* 13 */"13",
+ /* 13 */null,
/* 14 */"CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED",
/* 15 */"CIM_ERR_INVALID_QUERY",
/* 16 */"CIM_ERR_METHOD_NOT_AVAILABLE",
/* 17 */"CIM_ERR_METHOD_NOT_FOUND",
- /* 18 */"18",
+ /* 18 */null,
/* 19 */"CIM_ERR_INVALID_RESPONSE_DESTINATION",
/* 20 */"CIM_ERR_NAMESPACE_NOT_EMPTY",
/* 21 */"CIM_ERR_INVALID_ENUMERATION_CONTEXT",
@@ -285,6 +286,7 @@
*/
public WBEMException(int pID, String pMessage, CIMInstance[] pErrors, Throwable pCause) {
super(pMessage, pCause);
+ if (!isValidID(pID)) throw new IllegalArgumentException("Invalid error ID!");
this.iErrorID = pID;
this.iCimErrors = pErrors;
}
@@ -346,7 +348,19 @@
* @return A <code>String</code> representation of the exception ID.
*/
private String getCIMMessage() {
- return (this.iErrorID >= 0 && this.iErrorID < MESSAGES.length) ? MESSAGES[this.iErrorID]
- : String.valueOf(this.iErrorID);
+ return isValidID(this.iErrorID) ? MESSAGES[this.iErrorID] : String.valueOf(this.iErrorID);
+ }
+
+ /**
+ * Returns validity of error ID.
+ *
+ * @param pID
+ * The error ID.
+ *
+ * @return <code>true</code> if error ID is valid, <code>false</code>
+ * otherwise.
+ */
+ private boolean isValidID(int pID) {
+ return pID >= 0 && pID < MESSAGES.length && MESSAGES[pID] != null;
}
}
|