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: Michael Chase-S. <mc...@us...> - 2013-01-24 01:05:36
|
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 01bf3a34a050f4c92855565f6f29bd7866b04158 (commit) via b1f395024ffbe4f7939852fa2a11b856efb2457f (commit) from 5cf6c002667121d5ecf9d5036c682582e4e16dee (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 01bf3a34a050f4c92855565f6f29bd7866b04158 Merge: b1f3950 5cf6c00 Author: Michael Chase-Salerno <br...@li...> Date: Wed Jan 23 20:05:01 2013 -0500 Merge branch 'master' of ssh://sblim.git.sourceforge.net/gitroot/sblim/sfcb commit b1f395024ffbe4f7939852fa2a11b856efb2457f Author: Michael Chase-Salerno <br...@li...> Date: Wed Jan 23 20:03:58 2013 -0500 3601943 ObjectImpl unit test ----------------------------------------------------------------------- Summary of changes: diff --git a/Makefile.am b/Makefile.am index beb696b..2c127e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -556,7 +556,7 @@ if GCOV # Ignore errors from lcov since it always seems to have a problem - lcov --capture --directory .libs --output-file ./coverage/lcovtest.info --ignore-errors gcov,source lcov --remove ./coverage/lcovtest.info "/usr*" --output-file ./coverage/cov_stripped.info - genhtml --output-directory ./coverage ./coverage/cov_stripped.info + genhtml --legend --output-directory ./coverage ./coverage/cov_stripped.info @echo "****** Coverage report generated in ./coverage/index.html" endif diff --git a/objectImpl.c b/objectImpl.c index 4946588..0da6d0d 100644 --- a/objectImpl.c +++ b/objectImpl.c @@ -2920,65 +2920,235 @@ ClArgsToString(ClArgs * arg) return sc.str; } -// #define MAIN_TEST -#ifdef MAIN_TEST - -extern CMPIArray *NewCMPIArray(CMPICount size, CMPIType type, - CMPIStatus *rc); -extern CMPIArgs *NewCMPIArgs(CMPIStatus *rc); -extern CMPIInstance *NewCMPIInstance(CMPIObjectPath * cop, CMPIStatus *rc); -extern CMPIObjectPath *NewCMPIObjectPath(const char *nameSpace, - const char *className, - CMPIStatus *rc); -extern unsigned long getArgsSerializedSize(CMPIArgs * args); -extern unsigned long getInstanceSerializedSize(CMPIInstance *ci); - +#ifdef UNITTEST +// Embedded unittest routine int -main() -{ - int val = 37, - s; - // SFCB_ASM("int $3"); - { - CMPIObjectPath *cop = NewCMPIObjectPath("root", "myClass", NULL); - CMPIInstance *inst = NewCMPIInstance(cop, NULL); - CMPIArgs *arg = NewCMPIArgs(NULL); - CMPIArray *ar = NewCMPIArray(1, CMPI_sint32, NULL); - CMSetArrayElementAt(ar, 0, &val, CMPI_sint32); - printf("CMPI_sint32A: %p\n", (void *) CMPI_sint32A); - CMPIData ad = CMGetArrayElementAt(ar, 0, NULL); - printf("ad.sin32: %d\n", ad.value.sint32); - CMAddArg(arg, "test", &ar, CMPI_sint32A); - CMPIData d = CMGetArg(arg, "test", NULL); - ad = CMGetArrayElementAt(d.value.array, 0, NULL); - printf("ad.sin32: %d\n", ad.value.sint32); - s = getArgsSerializedSize(arg); - - CMPIArgs *narg = CMClone(arg, NULL); - s = getArgsSerializedSize(arg); - } - - { - CMPIObjectPath *cop = NewCMPIObjectPath("root", "myClass", NULL); - CMPIInstance *inst = NewCMPIInstance(cop, NULL); - CMPIArray *ar = NewCMPIArray(1, CMPI_sint32, NULL); - CMSetArrayElementAt(ar, 0, &val, CMPI_sint32); - printf("CMPI_sint32A: %p\n", (void *) CMPI_sint32A); - CMPIData ad = CMGetArrayElementAt(ar, 0, NULL); - printf("ad.sin32: %d\n", ad.value.sint32); - CMSetProperty(inst, "test", &ar, CMPI_sint32A); - CMPIData d = CMGetProperty(inst, "test", NULL); - ad = CMGetArrayElementAt(d.value.array, 0, NULL); - printf("ad.sin32: %d\n", ad.value.sint32); - s = getInstanceSerializedSize(inst); - - CMPIInstance *ninst = CMClone(inst, NULL); - s = getInstanceSerializedSize(ninst); +oi_test() +{ + int i,fail = 0; + const char *str; + CMPIStatus rc; + + // Some CMPI based tests + CMPIObjectPath *cop = NewCMPIObjectPath("root", "myClass", &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to create object path, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + CMPIInstance *inst = NewCMPIInstance(cop, &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to create instance, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + i=isInstance(inst); + if (!i) { + printf("Failed isInstance check, rc=%d\n",i); + fail = 1; + } + i=isInstance(cop); + if (i) { + printf("Failed negative isInstance check, rc=%d\n",i); + fail = 1; } - return 0; + //Do some array checks + CMPIArray *ar = NewCMPIArray(1, CMPI_sint32, &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to create CMPI array, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + int val = 37; + CMSetArrayElementAt(ar, 0, &val, CMPI_sint32); + CMPIData ad = CMGetArrayElementAt(ar, 0, &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to get CMPI array element, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + if (ad.value.sint32 != val) { + printf("Fetched array element value not as expected, expected: %d got:%d\n",val,ad.value.sint32); + fail = 1; + } + CMSetProperty(inst, "test", &ar, CMPI_sint32A); + CMPIData d = CMGetProperty(inst, "test", &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to get CMPI property, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + ad = CMGetArrayElementAt(d.value.array, 0, &rc); + if (rc.rc != CMPI_RC_OK) { + printf("Failed to get CMPI array element, rc: %d msg:%s\n",rc.rc,(char *)rc.msg); + fail = 1; + } + if (ad.value.sint32 != val) { + printf("Instance array element value not as expected, expected: %d got:%d\n",val,ad.value.sint32); + fail = 1; + } + + //CLobject tests + + //CLObjectPath tests + ClObjectPath *clop=ClObjectPathNew("root","myClass"); + if (clop == NULL) { + printf("Failed to create CLObjectPath\n"); + fail = 1; + } + ClObjectPath *clop2=ClObjectPathRebuild(clop,NULL); + if (clop2 == NULL) { + printf("Failed to rebuild CLObjectPath\n"); + fail = 1; + } + str=ClObjectPathToString(clop); + // Not implemented, so not checked + + //Set it twice to test replace string + ClObjectPathSetHostName(clop,"testhost2"); + ClObjectPathSetHostName(clop,"testhost"); + str=ClObjectPathGetHostName(clop); + if (strcmp(str,"testhost") != 0) { + printf("Failed to get/set hostname from objectpath:%s\n",str); + fail = 1; + } + ClObjectPathSetNameSpace(clop, "root2"); + str=ClObjectPathGetNameSpace(clop); + if (strcmp(str,"root2") != 0) { + printf("Failed to get/set namespace from objectpath:%s\n",str); + fail = 1; + } + ClObjectPathSetClassName(clop, "myClass2"); + str=ClObjectPathGetClassName(clop); + if (strcmp(str,"myClass2") != 0) { + printf("Failed to get/set classname from objectpath:%s\n",str); + fail = 1; + } + + // CLinstance checks + ClInstance * cli=ClInstanceNewFromMof("root", "myClass"); + if (cli == NULL) { + printf("Failed to create CLinstance from MOF\n"); + fail = 1; + } + ClInstance *cli2=ClInstanceRebuild(cli,NULL); + if (cli2 == NULL) { + printf("Failed to rebuild CLinstance\n"); + fail = 1; + } + + unsigned long li=ClSizeInstance(cli); + if (li == 0) { + printf("Failed to size CLinstance.\n"); + fail = 1; + } + str=ClInstanceToString(cli); + if (strstr(str,"Instance") == NULL) { + printf("Failed to get string from instance:%s\n",str); + fail = 1; + } + str=ClInstanceGetNameSpace(cli); + if (strcmp(str,"root") != 0) { + printf("Failed to get namespace from instance:%s\n",str); + fail = 1; + } + str=ClInstanceGetClassName(cli); + if (strcmp(str,"myClass") != 0) { + printf("Failed to get namespace from instance:%s\n",str); + fail = 1; + } + + ClClass * clc=ClClassNew("myClass","myPClass"); + if (clc == NULL) { + printf("Failed to create ClClass.\n"); + fail = 1; + } + unsigned char cch=ClClassAddGrandParent(clc, "myGClass"); + // not sure of the failure case here + + i=ClClassAddProperty(clc,"tprop" ,d,"testref"); + if (i != 1) { + printf("Failed to add property to ClClass.\n"); + fail = 1; + } + ClClass *clc2=ClClassRebuildClass(clc,NULL); + if (clc2 == NULL) { + printf("Failed to rebuild ClClass.\n"); + fail = 1; + } + + i=ClClassGetPropertyCount(clc); + if (i != 1) { + printf("Failed to get property count for ClClass.\n"); + fail = 1; + } + + li=ClSizeClass(clc); + if (li == 0) { + printf("Failed to size ClClass.\n"); + fail = 1; + } + str=ClClassToString(clc); + if (strstr(str,"class") == NULL) { + printf("Failed to get string from ClClass:%s\n",str); + fail = 1; + } + + //Args tests + ClArgs * cla=ClArgsNew(); + if (cla == NULL) { + printf("Failed to create ClArgs object.\n"); + fail = 1; + } + li=ClSizeArgs(cla); + if (li == 0) { + printf("Failed to size ClArgs.\n"); + fail = 1; + } + ClArgs *cla2=ClArgsRebuild(cla,NULL); + if (cla2 == NULL) { + printf("Failed to rebuild ClArgs object.\n"); + fail = 1; + } + i=ClArgsAddArg(cla,"test",d); + if (i == 0) { + printf("Failed to add arg to ClArgs.\n"); + fail = 1; + } + i=ClArgsGetArgCount(cla); + if (i == 0) { + printf("Failed to get arg count.\n"); + fail = 1; + } + i=ClArgsGetArgAt(cla, 2, NULL, NULL); + if (i != 1) { + printf("Failed to catch bad arg count.\n"); + fail = 1; + } + +// Qualifiers + ClQualifierDeclaration * clq=ClQualifierDeclarationNew("root","myQual"); + if (clq == NULL) { + printf("Failed to create ClQualifier object.\n"); + fail = 1; + } + li=ClSizeQualifierDeclaration(clq); + if (li == 0) { + printf("Failed to size ClQualifier.\n"); + fail = 1; + } + ClQualifierDeclaration *clq2=ClQualifierRebuildQualifier(clq,NULL); + if (clq2 == NULL) { + printf("Failed to rebuild ClQualifier object.\n"); + fail = 1; + } + + ClClassFreeClass(clc); + ClInstanceFree(cli); + ClObjectPathFree(clop); + ClArgsFree(cla); + + // Return the final result + return fail; } #endif + /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ /* Modelines are added by 'make pretty' */ diff --git a/objectImpl.h b/objectImpl.h index 5038e02..a2e6edc 100644 --- a/objectImpl.h +++ b/objectImpl.h @@ -601,6 +601,10 @@ const char *ClObjectGetClObject(ClObjectHdr * hdr, ClString * id); #endif // SETCLPFX #endif +#ifdef UNITTEST +extern int oi_test(); +#endif + /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ /* Modelines are added by 'make pretty' */ diff --git a/test/unittest/EmbeddedTests.c b/test/unittest/EmbeddedTests.c index 4b4a744..333e309 100644 --- a/test/unittest/EmbeddedTests.c +++ b/test/unittest/EmbeddedTests.c @@ -21,6 +21,7 @@ // Include the header file for each embedded test routine. #include "trace.h" #include "queryOperation.h" +#include "objectImpl.h" int main(void) @@ -40,6 +41,11 @@ main(void) if (rc != 0) fail = 1; + printf(" Testing objectImpl.c ...\n"); + rc = oi_test(); + if (rc != 0) + fail = 1; + // Return the overall results. return fail; } diff --git a/test/unittest/Makefile.am b/test/unittest/Makefile.am index d9a754f..016db10 100644 --- a/test/unittest/Makefile.am +++ b/test/unittest/Makefile.am @@ -32,13 +32,13 @@ TESTS = xmlUnescape newCMPIInstance EmbeddedTests newDateTime check_PROGRAMS = xmlUnescape newCMPIInstance EmbeddedTests newDateTime xmlUnescape_SOURCES = xmlUnescape.c -xmlUnescape_LDADD = -lsfcCimXmlCodec -lsfcHttpAdapter +xmlUnescape_LDADD = -lsfcBrokerCore -lsfcCimXmlCodec -lsfcHttpAdapter newCMPIInstance_SOURCES = newCMPIInstance.c -newCMPIInstance_LDADD = -lsfcCimXmlCodec -lsfcHttpAdapter +newCMPIInstance_LDADD = -lsfcCimXmlCodec -lsfcHttpAdapter -lsfcBrokerCore EmbeddedTests_SOURCES = EmbeddedTests.c -EmbeddedTests_LDADD = -lsfcCimXmlCodec -lsfcHttpAdapter +EmbeddedTests_LDADD = -lsfcCimXmlCodec -lsfcHttpAdapter -lsfcBrokerCore newDateTime_SOURCES = newDateTime.c newDateTime_LDADD = -lsfcBrokerCore diff --git a/test/unittest/xmlUnescape.c b/test/unittest/xmlUnescape.c index 06a534f..e92801b 100644 --- a/test/unittest/xmlUnescape.c +++ b/test/unittest/xmlUnescape.c @@ -13,6 +13,7 @@ #include <cimRequest.h> extern RequestHdr scanCimXmlRequest(CimRequestContext *ctx, char *xmlData, int *rc); +int trimws; int main(void) hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-23 21:43:07
|
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 5cf6c002667121d5ecf9d5036c682582e4e16dee (commit) via ff90f07e9874e2d412a21f710ea3ab031a6a93a3 (commit) from e7f1871e88f39d84971a24ac3050581fdb793789 (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 5cf6c002667121d5ecf9d5036c682582e4e16dee Merge: ff90f07 e7f1871 Author: buccella <buc...@li...> Date: Wed Jan 23 16:42:33 2013 -0500 Merge branch 'master' of ssh://sblim.git.sourceforge.net/gitroot/sblim/sfcb commit ff90f07e9874e2d412a21f710ea3ab031a6a93a3 Author: buccella <buc...@li...> Date: Wed Jan 23 16:42:15 2013 -0500 mark "FAILED" messages as red on the console ----------------------------------------------------------------------- Summary of changes: diff --git a/test/TestProviders/tests/xmltest.sh b/test/TestProviders/tests/xmltest.sh index b023e9d..52d3601 100755 --- a/test/TestProviders/tests/xmltest.sh +++ b/test/TestProviders/tests/xmltest.sh @@ -23,6 +23,8 @@ _RC=0 TESTDIR=. +red='\e[0;31m' # red, to change FAILED output color +unred='\e[0m' # no color # Check for wbemcat utility if ! which wbemcat > /dev/null; then @@ -62,7 +64,9 @@ do fi if [ $? -ne 0 ]; then + echo -ne $red echo "FAILED to send CIM-XML request" + echo -ne $unred _RC=1 continue fi @@ -71,7 +75,9 @@ do # Either using a full copy of the expected output (testname.OK) if [ -f $_TESTOK ] ; then if ! diff --brief $_TESTOK $_TESTRESULT > /dev/null; then + echo -ne $red echo "FAILED output not as expected" + echo -ne $unred _RC=1; continue @@ -93,7 +99,9 @@ do text=$(echo $line | awk '{ line=substr($line, 2); print line; }' ) if grep --q "$text" $_TESTRESULT ; then if [ $passed -eq 0 ] ; then + echo -ne $red echo "FAILED disallowed line found" + echo -ne $unred passed=1 _RC=1; fi @@ -104,7 +112,9 @@ do # Check for required lines if ! grep --q "$line" $_TESTRESULT ; then if [ $passed -eq 0 ] ; then + echo -ne $red echo "FAILED required line not found" + echo -ne $unred passed=1 _RC=1; fi diff --git a/test/xmltest/xmltest.sh b/test/xmltest/xmltest.sh index 105c378..d4a0e15 100755 --- a/test/xmltest/xmltest.sh +++ b/test/xmltest/xmltest.sh @@ -23,6 +23,8 @@ _RC=0 TESTDIR=. +red='\e[0;31m' # red, to change FAILED output color +unred='\e[0m' # no color # Check for wbemcat utility if ! which wbemcat > /dev/null; then @@ -67,7 +69,9 @@ do fi if [ $? -ne 0 ]; then + echo -ne $red echo "FAILED to send CIM-XML request" + echo -ne $unred trc=1 continue fi @@ -76,7 +80,9 @@ do # Either using a full copy of the expected output (testname.OK) if [ -f $_TESTOK ] ; then if ! diff --brief $_TESTOK $_TESTRESULT > /dev/null; then + echo -ne $red echo -n "FAILED output not as expected" + echo -ne $unred trc=1; # We got the expected response XML else @@ -107,7 +113,9 @@ do # Check for required lines if ! grep --q "$line" $_TESTRESULT ; then if [ $passed -eq 0 ] ; then + echo -ne $red echo -n "FAILED required line not found" + echo -ne $unred passed=1 trc=1; fi hooks/post-receive -- SFCB - Small Footprint CIM Broker |
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7628/src/org/sblim/cimclient/internal/http Modified Files: Tag: Experimental HttpHeader.java MessageWriter.java MessageReader.java HttpClient.java Log Message: 3601894 Enhance HTTP and CIM-XML tracing Index: MessageReader.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/MessageReader.java,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -d -r1.4.2.3 -r1.4.2.4 --- MessageReader.java 9 Jul 2010 17:24:00 -0000 1.4.2.3 +++ MessageReader.java 23 Jan 2013 20:53:46 -0000 1.4.2.4 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2005, 2010 + * (C) Copyright IBM Corp. 2005, 2013 * * 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 @@ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) * 3027479 2010-07-09 blaschke-oss Dead store to local variable + * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing */ package org.sblim.cimclient.internal.http; @@ -93,7 +94,7 @@ } if (this.iChunked) { this.iContent = new ChunkedInputStream(new PersistentInputStream(pStream, - isPersistentConnectionSupported())); + isPersistentConnectionSupported()), "Indication Request"); } else { this.iContent = new BoundedInputStream(new PersistentInputStream(pStream, isPersistentConnectionSupported()), contentLength); Index: MessageWriter.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/MessageWriter.java,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -u -d -r1.4.2.4 -r1.4.2.5 --- MessageWriter.java 20 May 2011 14:39:45 -0000 1.4.2.4 +++ MessageWriter.java 23 Jan 2013 20:53:45 -0000 1.4.2.5 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2005, 2011 + * (C) Copyright IBM Corp. 2005, 2013 * * 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 @@ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) * 3304058 2011-05-20 blaschke-oss Use same date format in change history + * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing */ package org.sblim.cimclient.internal.http; @@ -28,10 +29,12 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.util.logging.Level; import org.sblim.cimclient.internal.http.io.ASCIIPrintStream; import org.sblim.cimclient.internal.http.io.ChunkedOutputStream; import org.sblim.cimclient.internal.http.io.PersistentOutputStream; +import org.sblim.cimclient.internal.logging.LogAndTraceBroker; /** * Class MessageWriter is responsible for creating http messages @@ -149,10 +152,14 @@ this.iHeader.addField("Content-Type", "application/xml;charset=\"utf-8\""); if (!this.iChunked) this.iHeader.addField("Content-length", Integer .toString(this.iBufferedOS.size())); + LogAndTraceBroker.getBroker().trace(Level.FINER, + "Indication Response HTTP Headers= " + this.iHeader.toString()); this.iHeader.write(this.iRealOS); this.iRealOS.flush(); this.iBufferedOS.writeTo(this.iRealOS); if (this.iChunked && (this.iTrailer != null)) { + LogAndTraceBroker.getBroker().trace(Level.FINER, + "Indication Response HTTP Trailer Headers= " + this.iTrailer.toString()); this.iTrailer.write(this.iRealOS); } this.iRealOS.flush(); Index: HttpHeader.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/HttpHeader.java,v retrieving revision 1.3.2.12 retrieving revision 1.3.2.13 diff -u -d -r1.3.2.12 -r1.3.2.13 --- HttpHeader.java 7 Aug 2012 00:45:29 -0000 1.3.2.12 +++ HttpHeader.java 23 Jan 2013 20:53:45 -0000 1.3.2.13 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2005, 2012 + * (C) Copyright IBM Corp. 2005, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -25,10 +25,11 @@ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) - * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) + * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) * 2641758 2009-02-27 blaschke-oss CIM Client does not recognize HTTP extension headers * 3304058 2011-05-20 blaschke-oss Use same date format in change history * 3553858 2012-08-06 blaschke-oss Append duplicate HTTP header fields instead of replace + * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing */ package org.sblim.cimclient.internal.http; @@ -439,12 +440,32 @@ * @throws TrailerException */ public void examineTrailer() throws TrailerException { + examineTrailer(null); + } + + /** + * Throws a TrailerException if it contains recognized CIM errors in http + * trailer entries. + * + * @param pOrigin + * The origin of the trailer (response, request, etc.) + * @throws TrailerException + */ + public void examineTrailer(String pOrigin) throws TrailerException { Iterator<Entry<HeaderEntry, String>> itr = this.iterator(); - int code = 0; + int code = 0, i = 0; String desc = null; + StringBuilder hdrs = null; + if (LogAndTraceBroker.getBroker().isLoggableTrace(Level.FINER)) hdrs = new StringBuilder(); while (itr.hasNext()) { Entry<HeaderEntry, String> ent = itr.next(); String keyStr = ent.getKey().toString(); + if (hdrs != null) { + if (i++ > 0) hdrs.append(','); + hdrs.append(keyStr); + hdrs.append(": "); + hdrs.append(this.getField(keyStr)); + } try { if (keyStr.equalsIgnoreCase(WBEMConstants.HTTP_TRAILER_STATUS_CODE)) { String valStr = URLDecoder.decode(this.getField(keyStr), WBEMConstants.UTF8); @@ -457,6 +478,10 @@ throw new Error(e); } } + if (hdrs != null && hdrs.length() > 0) LogAndTraceBroker.getBroker().trace( + Level.FINER, + (pOrigin == null ? "Unknown" : pOrigin) + " HTTP Trailer Headers= " + + hdrs.toString()); if (code > 0 || desc != null) { if (code > 0) { throw new TrailerException(new WBEMException(code, desc)); } throw new TrailerException(new WBEMException(desc)); Index: HttpClient.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/HttpClient.java,v retrieving revision 1.12.2.32 retrieving revision 1.12.2.33 diff -u -d -r1.12.2.32 -r1.12.2.33 --- HttpClient.java 5 Nov 2012 23:04:18 -0000 1.12.2.32 +++ HttpClient.java 23 Jan 2013 20:53:46 -0000 1.12.2.33 @@ -1,7 +1,7 @@ /** * HttpClient.java * - * (C) Copyright IBM Corp. 2005, 2012 + * (C) Copyright IBM Corp. 2005, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -66,6 +66,7 @@ * 3523918 2012-05-06 blaschke-oss "java.io.IOException: Unexpected EOF" returned as HTTP 401 * 3524050 2012-06-06 blaschke-oss Improve WWW-Authenticate in HTTPClient.java * 3557283 2012-11-05 blaschke-oss Print full response when get EOF from CIMOM + * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing */ package org.sblim.cimclient.internal.http; @@ -618,7 +619,7 @@ this.iRequestHeaders.write(out); - logger.trace(Level.FINER, "HTTP Headers= " + this.iRequestHeaders); + logger.trace(Level.FINER, "Request HTTP Headers= " + this.iRequestHeaders); if (out.checkError() != null) { delayedException = out.checkError(); @@ -675,6 +676,8 @@ ResponseTime = System.currentTimeMillis(); this.iResponseHeaders = new HttpHeader(this.iIStream); + logger.trace(Level.FINER, "Response HTTP Headers= " + + this.iResponseHeaders.toString()); this.iKeepAlive = false; if ("Keep-alive".equalsIgnoreCase(this.iResponseHeaders .getField("Connection")) @@ -706,7 +709,8 @@ if (transferEncoding != null && transferEncoding.toLowerCase().endsWith("chunked")) { - this.iServerInput = new ChunkedInputStream(this.iServerInput); + this.iServerInput = new ChunkedInputStream(this.iServerInput, + "Response"); this.iKeepAlive = true; } this.iServerInput = new BoundedInputStream(this.iServerInput, length); |
From: Dave H. <hel...@us...> - 2013-01-23 02:33:57
|
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_1.3 has been updated via 832300434ba887029c7990c3d28821ebf09ea845 (commit) from 47b55037ce7513f90db8da85ca29eb26344e905c (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 832300434ba887029c7990c3d28821ebf09ea845 Author: Dave Heller <hel...@us...> Date: Tue Jan 22 21:31:57 2013 -0500 [ 3599160 ] Add sfcbproc utility ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 6e95fe2..4d61596 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-22 Dave Heller <hel...@us...> + + * sfcbproc.c, Makefile.am + [ 3599160 ] Add sfcbproc utility + 2013-01-08 Dave Heller <hel...@us...> * cimXmlRequest.c httpAdapter.c mlog.c msgqueue.c providerDrv.c diff --git a/Makefile.am b/Makefile.am index 1fb047c..f6b0184 100644 --- a/Makefile.am +++ b/Makefile.am @@ -176,7 +176,7 @@ sbin_PROGRAMS = \ sfcbd bin_PROGRAMS = \ - sfcbmofpp sfcbdump sfcbinst2mof sfcbtrace + sfcbmofpp sfcbdump sfcbinst2mof sfcbtrace sfcbproc noinst_PROGRAMS = \ sfcbdumpP32onI32 classSchema2c sfcbsem @@ -428,6 +428,8 @@ sfcbmofpp_SOURCES=mofpp.c sfcbdump_SOURCES=sfcbdump.c +sfcbproc_SOURCES=sfcbproc.c + sfcbinst2mof_SOURCES=sfcbinst2mof.c sfcbinst2mof_LDADD = -lsfcFileRepository -lsfcBrokerCore -lsfcUtil diff --git a/NEWS b/NEWS index d75c182..11d2beb 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ Changes in 1.3.17 ================= New features: - 3597805 Restart HTTP daemon without restarting SFCB +- 3599160 Add sfcbproc utility Bugs fixed: - 3599329 dlopen failed for sfcbCustomLib diff --git a/sfcbproc.c b/sfcbproc.c new file mode 100644 index 0000000..d5a011c --- /dev/null +++ b/sfcbproc.c @@ -0,0 +1,678 @@ +/* + * $Id$ + * + * (C) Copyright IBM Corp. 2013 + * + * 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: Dave Heller <hel...@us...> + * + * Based on the original shell script by Mark Lanzo <ma...@us...> + * + * Description: Identify running SFCB processes + * + */ + +#define TRUE 1 +#define FALSE 0 +#define ERROR -1 + +#define BUFFER_SZ 32 +#define MAX_CMD_SZ 64 +#define MAX_PATH_SZ 64 +#define MAX_PATTERN_SZ 32 +#define MAX_PORTS 6 +#define MAX_INODES 12 + +#define DEFAULT_HTTP_PORT 5988 +#define DEFAULT_HTTPS_PORT 5989 + +#include <arpa/inet.h> +#include <dirent.h> +#include <errno.h> +#include <getopt.h> +#include <malloc.h> +#include <regex.h> +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +char *name; +int debug=0, raw=0, verbose=0; + +typedef struct { + char *ip; + int port; + int inode; +} SockDescr; + +typedef struct { + int pid; + char comm[MAX_CMD_SZ]; + char cmd[MAX_CMD_SZ]; + char state; + int ppid; + int pgrp; +} ProcStat; + +typedef struct { + char *regex; /* reg expr for matching against /proc/pid/map entries */ + char *label; /* display name; if "*", use matched substring */ +} ProviderLstEntry; + +/* + * Convert IPv4 or IPv6 address in hex to presentation format. + * + * mallocs space for return string; it is up to the user to free as necessary. + * + * in: fam (AF_INET or AF_INET6), + * ipHex - hex string like that returned by /proc/net/tcp[6] + * + * returns ptr to IP address in presentation format, NULL if conversion failed. + */ +static char* ipHexToPres(sa_family_t fam, char *ipHex) { + struct in6_addr ip; + char *ipPres = NULL; + int n = sscanf(ipHex, + "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx", + &ip.s6_addr[3], &ip.s6_addr[2], &ip.s6_addr[1], &ip.s6_addr[0], + &ip.s6_addr[7], &ip.s6_addr[6], &ip.s6_addr[5], &ip.s6_addr[4], + &ip.s6_addr[11], &ip.s6_addr[10], &ip.s6_addr[9], &ip.s6_addr[8], + &ip.s6_addr[15], &ip.s6_addr[14], &ip.s6_addr[13], &ip.s6_addr[12]); + if (n==4 || n==16) { + ipPres = calloc(1, INET6_ADDRSTRLEN); // not checking calloc() + inet_ntop(fam, &ip, ipPres, INET6_ADDRSTRLEN); // TODO: check for failure here + } + return ipPres; +} + +/* + * Follow symbolic link to get real filename + * + * mallocs space for return string; it is up to the user to free as necessary. + * + */ +char *readLink(const char *path) { + int len = BUFFER_SZ; + char *buf = NULL; + while (TRUE) { + buf = (char *) realloc(buf, len); + int num = readlink(path, buf, len); + if (num < 0) { + free(buf); + return NULL; + } + if (num < len) { + buf = (char *) realloc(buf, num+1); + buf[num] = 0; + break; + } + len *= 2; + } + return buf; +} + +/* + * Determine if a process is holding one of the SFCB sockets. + * + * in: pid, inodeList, inodeCnt + * out: fdCntPtr + * + * returns TRUE if an inode in inodeList is found in this process' fd list + */ +static int isProcHoldingSocket(int pid, SockDescr *socketList, int socketCnt, + int *fdCntPtr, char **matchingIp) { + int i, rc; + int match = FALSE; + char msgbuf[BUFFER_SZ]; + char pathname[MAX_PATH_SZ]; + char pattern[MAX_PATTERN_SZ]; + char *realname; + + struct dirent *entry; + DIR *dir; + regex_t regexpr; + + sprintf(pathname, "/proc/%d/fd", pid); + if ((dir = opendir(pathname)) == 0) { + // pid already gone + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, pathname); + return ERROR; + } + /* + * This function takes a shortcut by quitting the search after the first match + * (although we continue to count fds for other purposes). This is equivalent + * to assuming each HTTP adapter only holds one socket. In fact, with the + * current design an adapter may hold sockets for both http and https, and we + * do not differentiate between sockets (ports) here. Instead we report only + * the IP address that the adapter is holding. Really. we should find all + * sockets for an adapter process and report them all to the user. + */ + *fdCntPtr = 0; + while ((entry = readdir(dir))) { + // Each entry is a fd that is potentially a socket. + if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { + (*fdCntPtr)++; + // If we already found a match, only need to count fds from here out. + if (match) continue; + + sprintf(pathname, "/proc/%d/fd/%s", pid, entry->d_name); + + realname = readLink(pathname); + if (realname != NULL) { + + for (i=0; i<socketCnt; i++) { + + // Compile regular expression + sprintf(pattern, ".*\\[%d\\]", socketList[i].inode); + if ((rc = regcomp(®expr, pattern, 0))) { + fprintf(stderr, "%s: error: failure to compile regex at %s(%d)\n", + name, __FILE__, __LINE__); + exit(1); + } + + // Execute regular expression + if (!(rc = regexec(®expr, realname, 0, NULL, 0))) { + match = TRUE; + *matchingIp = socketList[i].ip; + break; // iterating over socket list + } + else if (rc == REG_NOMATCH) { + // continue + } + else { + regerror(rc, ®expr, msgbuf, sizeof(msgbuf)); + fprintf(stderr, "%s: error: regex match failed (%s) at %s(%d)\n", + name, msgbuf, __FILE__, __LINE__); + exit(1); + } + regfree(®expr); + } + if (realname) free(realname); + } + else { + // pid (or file descriptor) already gone + if (debug) + fprintf(stderr, + "%s: warning: cannot access %s (process may be gone)\n", name, + pathname); + break; + } + } + } + return match; +} + +/* + * Determine if process is a provider process by checking /proc/pid/maps entries + * against a list of provider signatures. + * + * in: pid + * + * returns a pointer to the display name of the provider, if a match is found, + * otherwise returns NULL. + */ +char* isProcProviderX(int pid, ProviderLstEntry* provLst) { + int i, rc; + int precedent = -1; + char filename[MAX_PATH_SZ]; + char msgbuf[BUFFER_SZ]; + char pattern[MAX_PATTERN_SZ]; + char *dot, *bestmatch = NULL; + char *line = NULL; + char *pathname; + size_t len = 0; + ssize_t read; + + FILE *fp; + regex_t regexpr; + + sprintf(filename, "/proc/%d/maps", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return NULL; + } + + while ((read = getline(&line, &len, fp)) != -1) { + + if (!(pathname = strchr(line, '/'))) continue; + + size_t nmatch = 1; + regmatch_t matchinfo[1]; + + for (i=0; provLst[i].regex; i++) { + + // Compile regular expression + sprintf(pattern, "%s", provLst[i].regex); + if ((rc = regcomp(®expr, pattern, 0))) { + fprintf(stderr, "%s: error: failure to compile regex at %s(%d)\n", name, + __FILE__, __LINE__); + exit(1); + } + + // Execute regular expression (and determine match substring) + if (!(rc = regexec(®expr, pathname, nmatch, matchinfo, 0))) { + *(pathname + (int) matchinfo->rm_eo) = '\0'; + + if (precedent < 0 || precedent > i) { + precedent = i; + if (*(provLst[i].label) == '*') { + if ((dot = strchr(pathname, '.'))) { *dot = '\0'; } + // use the match substring as display name + bestmatch = strdup(pathname + (int) matchinfo->rm_so); + } + else { + // use the label as display name + bestmatch = provLst[i].label; + } + } + break; // iterating over provider list + } + else if (rc == REG_NOMATCH) { + // continue + } + else { + regerror(rc, ®expr, msgbuf, sizeof(msgbuf)); + fprintf(stderr, "%s: error: regex match failed (%s) at %s(%d)\n", name, + msgbuf, __FILE__, __LINE__); + exit(1); + } + regfree(®expr); + } + } + if (line) free(line); + fclose(fp); + return bestmatch; +} + +/* + * Get vital data for a single SFCB processes. + * + * in: pid + * out: p is a ProcStat structure to be populated with retrieved data + * + * returns the pid if the process is an SFCB process, otherwise returns 0 + */ +static int getProcStat(int pid, ProcStat *p) { + FILE *fp; + char filename[MAX_PATH_SZ]; + char *line = NULL; + size_t len = 0; + ssize_t read; + const char *fmt = "%d %s %c %d %d"; + + sprintf(filename, "/proc/%d/stat", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return 0; + } + + if (5 == fscanf(fp, fmt, &p->pid, p->comm, &p->state, &p->ppid, &p->pgrp)) { + fclose(fp); + + if (strcmp(p->comm, "(sfcbd)") != 0 && strcmp(p->comm, "(lt-sfcbd)")) + return 0; + + // Get the full cmdline for the process + sprintf(filename, "/proc/%d/cmdline", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return 0; + } + int pass = 0; + *p->cmd = '\0'; + while ((read = getdelim(&line, &len, 0, fp)) != -1) { + if (strlen(p->cmd) + strlen(line) > MAX_CMD_SZ-2) { + break; + } + else { + if (pass++ > 0) strcat(p->cmd, " "); + strcat(p->cmd, line); + } + } + if (line) free(line); + return pid; + } + else { + if (debug) + fprintf(stderr, + "%s: warning: scanf failed for /proc/%d/stat (process may be gone)\n", + name, pid); + fclose(fp); + return ERROR; + } +} + +/* + * Get vital data for all SFCB processes. + * + * out: p is a dynamically malloced array of ProcStat structures + * + * returns the number of SFCB processes found + */ +int getProcStatList(ProcStat **p) { + int pid; + int cnt = 0; + DIR *procDIR; + struct dirent *entry; + ProcStat *procList; + + if ((procList = calloc(1, sizeof(ProcStat))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + if ((procDIR = opendir("/proc/")) == 0) { + fprintf(stderr, "%s: error: cannot access /proc (%s)\n", name, + strerror(errno)); + return ERROR; + } + while ((entry = readdir(procDIR))) { + if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { + // If dirname is numeric, it's a pid. + if ((pid = atoi(entry->d_name))) { + + if (getProcStat(pid, &procList[cnt]) > 0) { // this is a SFCB process + cnt++; + if ((procList = realloc(procList, (cnt+1) * sizeof(ProcStat))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + } + } + } + } + closedir(procDIR); + *p = procList; + return cnt; +} + +/* + * Get the list of inodes (sockets) for a given TCP port on IPv4 or IPv6. + * Note there may be more than one if SFCB binds to >1 IP address. . + * + * in: port, addressFam + * out: iListPtr is a dynamically malloced array inode numbers + * + * returns the number of inodes (sockets) found + */ +static int getSocketInodeList(int port, int addrFam, SockDescr **sockListPtr) { + int cnt=0, numFields; + char bufr[256]; + char filename[MAX_PATH_SZ]; + char *scnfmt; + FILE *fp; + + // For reading /proc/net/tcp and /proc/net/tcp6 + char *scnfmt4 = + "%*d: %8s:%4x %8s:%4x %*2x %*8x:%*8x %*2x:%*8x %*8x %d %*d %u \n"; + char *scnfmt6 = + "%*d: %32s:%4x %32s:%4x %*2x %*8x:%*8x %*2x:%*8x %*8x %d %*d %u \n"; + + char locaddr[33], remaddr[33]; + int locport, remport, uid, inode; + + SockDescr *sockList; + + if ((sockList = calloc(1, sizeof(SockDescr))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + + if (addrFam==AF_INET) { + sprintf(filename, "/proc/net/tcp"); + scnfmt = scnfmt4; + numFields = 6; + } + else if (addrFam==AF_INET6) { + sprintf(filename, "/proc/net/tcp6"); + scnfmt = scnfmt6; + numFields = 6; + } + else { + fprintf(stderr,"%s: error: invalid address family: %d\n", name, addrFam); + return ERROR; + } + + if ((fp = fopen(filename, "r")) == 0) { + fprintf(stderr, "%s: error: cannot access %s (%s)\n", name, filename, + strerror(errno)); + return ERROR; + } + + while (fgets(bufr, 256, fp)) { + + if (numFields + != fscanf(fp, scnfmt, locaddr, &locport, remaddr, &remport, &uid, + &inode)) { + *sockListPtr = sockList; + return cnt; + } + + if (locport == port) { /* match */ + + if (verbose) + (sockList + cnt)->ip = ipHexToPres(addrFam, locaddr); + else + (sockList + cnt)->ip = NULL; /* more efficient */ + + (sockList + cnt)->port = port; + (sockList + cnt)->inode = inode; + cnt++; + + if ((sockList = realloc(sockList, (cnt+1) * sizeof(SockDescr))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + } + } + return ERROR; +} + +static void usage(int status) { + + if (status != 0) + fprintf(stderr, "Try '%s --help' for more information.\n", name); + + else + { + static const char * help[] = { + "", + "Options:", + " -d, --debug show additional debug info", + " -h, --help display this message and exit", + " -p, --portlist=<PORTLIST> specify the TCP ports to hunt for", + " PORTLIST is a comma-separated list of port numbers", + " -r, --raw list raw ps info rather than trying to analyze", + " -v, --verbose show more details", + "" + }; + + int i; + + fprintf(stdout, "Usage: %s [options]\n", name); + for (i=0; i < sizeof(help) / sizeof(char*); i++) + fprintf(stdout, "%s\n", help[i]); + } + exit(status); +} + +int main(int argc, char **argv) { + char *role, *type, *matchIp=NULL, *portlist=NULL; + int c, i, j, n, procCnt, fdCnt, socketCnt=0; + + int port; + int portList[MAX_PORTS] = { DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT, 0 }; + + SockDescr *sList, socketList[MAX_INODES]; + + ProcStat *psInfo, *p; + + ProviderLstEntry providerLst[] = { +// { "REGEX", "LABEL" }, + { "libdctmi.so", "Instrumentation Provider (DCTMI)" }, // not tested + { "IndCIMXMLHandler", "IndCIMXMLHandler" }, + { "InteropProvider", "Interop Provider" }, + { "sfcClassProvider", "Class Provider" }, + { "sfcProfileProvider", "Profile Provider" }, + { "sfcInternalProvider", "SFCB Internal Provider" }, + { "sfcInteropServerProvider", "SFCB Interop Server Provider" }, + { "[^/]*Provider.so", "*" }, + { NULL, NULL }, + }; + + name = strrchr(argv[0], '/'); + if (name != NULL) ++name; + else name = argv[0]; + + static struct option const long_options[] = { + { "debug", no_argument, 0, 'd' }, + { "help", no_argument, 0, 'h' }, + { "portlist", required_argument, 0, 'p' }, + { "raw", no_argument, 0, 'r' }, + { "verbose", no_argument, 0, 'v' }, + { 0, 0, 0, 0 } + }; + + while ((c = getopt_long(argc, argv, "dhp:rv", long_options, 0)) != -1) + { + switch(c) + { + case 0: + break; + + case 'd': + debug = 1; + break; + + case 'h': + usage(0); + break; + + case 'p': + portlist = strdup(optarg); + break; + + case 'r': + raw = 1; + break; + + case 'v': + verbose = 1; + break; + + default: + usage(3); + break; + } + } + + if (optind < argc) { + fprintf(stderr,"%s: unrecognized config property: %s\n", name,argv[optind]); + usage(1); + } + + // Find SFCB processes + if ((procCnt = getProcStatList(&psInfo)) <= 0) { + printf("No SFCB Processes found.\n"); + exit(0); + } + + // Raw mode + if (raw) { + printf("%5s %5s %5s %-4s %s\n", "PID", "PPID", "PGID", "STAT", "CMD"); + for (i=0; i<procCnt; i++) { + ProcStat *p = (psInfo+i); + printf("%5d %5d %5d %-4c %s\n", p->pid,p->ppid,p->pgrp,p->state,p->cmd); + } + exit(0); + } + + // Parse comma-delimited list from cmdline (overrides default list) + if (portlist) { + char* t = strtok(portlist,","); + int portCnt = 0; + while (t) { + portList[portCnt] = atoi(t); + portCnt++; + t = strtok(NULL,","); + } + portList[portCnt] = 0; // terminate the list + } + + // For each port, look for open sockets on IPv4 & IPv6, add to socketList + for (i=0; (port=portList[i]); i++) { + + n = getSocketInodeList(port, AF_INET, &sList); + for (j=0; j<n; j++) { + socketList[socketCnt++] = sList[j]; + if (debug) + printf("Got inode %d for socket %s:%u (%#x)\n", sList[j].inode, + sList[j].ip, sList[j].port, port); + } + n = getSocketInodeList(port, AF_INET6, &sList); + for (j=0; j<n; j++) { + socketList[socketCnt++] = sList[j]; + if (debug) + printf("Got inode %d for socket [%s]:%u (%#x)\n", sList[j].inode, + sList[j].ip, sList[j].port, port); + } + } + + if (debug) { + printf("\nFound a total of %d SFCB socket inodes: ", socketCnt); + for (i=0; i<socketCnt; i++) + printf("%u ", socketList[i].inode); + + printf("\nFound a total of %d SFCB processes\n\n", procCnt); + } + + // Print process list with role + printf("%5s %5s %5s %-4s %s\n", "PID", "PPID", "PGID", "STAT", "ROLE"); + for (i=0; i<procCnt; i++) { + p = &psInfo[i]; + + if (p->pid == p->pgrp || p->ppid == 1) { + role = "SFCB Main"; + } + else if (isProcHoldingSocket(p->pid,socketList,socketCnt,&fdCnt,&matchIp)) { + type = (p->ppid == p->pgrp) ? "Http Daemon" : "Http Request Handler"; + if (verbose) { + role = malloc(INET6_ADDRSTRLEN + 30); + sprintf(role, "%s [%s]", type, matchIp); /* show bind ip */ + } else { + role = type; + } + } + else if (fdCnt > 0 && fdCnt < 45) { + role = "SFCB Logger"; + } + else if ((role = isProcProviderX(p->pid, providerLst))) { + // nothing further need to be done + } + else { + role = "Unknown"; + } + + printf("%5d %5d %5d %-4c %s\n", p->pid, p->ppid, p->pgrp, p->state, role); + } + exit(0); +} hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave H. <hel...@us...> - 2013-01-23 01:56:28
|
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 e7f1871e88f39d84971a24ac3050581fdb793789 (commit) from facb84413b5892abb803b4bf3782e80e18507051 (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 e7f1871e88f39d84971a24ac3050581fdb793789 Author: Dave Heller <hel...@us...> Date: Tue Jan 22 20:53:15 2013 -0500 [ 3599160 ] Add sfcbproc utility ----------------------------------------------------------------------- Summary of changes: diff --git a/Makefile.am b/Makefile.am index fac9c87..beb696b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -153,7 +153,7 @@ sbin_PROGRAMS = \ sfcbd bin_PROGRAMS = \ - sfcbmofpp sfcbdump sfcbinst2mof sfcbtrace + sfcbmofpp sfcbdump sfcbinst2mof sfcbtrace sfcbproc noinst_PROGRAMS = \ sfcbdumpP32onI32 classSchema2c sfcbsem @@ -358,6 +358,8 @@ sfcbmofpp_SOURCES=mofpp.c sfcbdump_SOURCES=sfcbdump.c +sfcbproc_SOURCES=sfcbproc.c + sfcbinst2mof_SOURCES=sfcbinst2mof.c sfcbinst2mof_LDADD = -lsfcFileRepository -lsfcBrokerCore diff --git a/NEWS b/NEWS index 705c966..7569606 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ New features: - 3597805 Restart HTTP daemon without restarting SFCB - 3597806 Bind to arbitrary list of IP addresses in SFCB - 3601386 Add test for EmbeddedObject output +- 3599160 Add sfcbproc utility Bugs fixed: - 3599526 segfault during ecn with classProviderSf diff --git a/sfcbproc.c b/sfcbproc.c new file mode 100644 index 0000000..d5a011c --- /dev/null +++ b/sfcbproc.c @@ -0,0 +1,678 @@ +/* + * $Id$ + * + * (C) Copyright IBM Corp. 2013 + * + * 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: Dave Heller <hel...@us...> + * + * Based on the original shell script by Mark Lanzo <ma...@us...> + * + * Description: Identify running SFCB processes + * + */ + +#define TRUE 1 +#define FALSE 0 +#define ERROR -1 + +#define BUFFER_SZ 32 +#define MAX_CMD_SZ 64 +#define MAX_PATH_SZ 64 +#define MAX_PATTERN_SZ 32 +#define MAX_PORTS 6 +#define MAX_INODES 12 + +#define DEFAULT_HTTP_PORT 5988 +#define DEFAULT_HTTPS_PORT 5989 + +#include <arpa/inet.h> +#include <dirent.h> +#include <errno.h> +#include <getopt.h> +#include <malloc.h> +#include <regex.h> +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +char *name; +int debug=0, raw=0, verbose=0; + +typedef struct { + char *ip; + int port; + int inode; +} SockDescr; + +typedef struct { + int pid; + char comm[MAX_CMD_SZ]; + char cmd[MAX_CMD_SZ]; + char state; + int ppid; + int pgrp; +} ProcStat; + +typedef struct { + char *regex; /* reg expr for matching against /proc/pid/map entries */ + char *label; /* display name; if "*", use matched substring */ +} ProviderLstEntry; + +/* + * Convert IPv4 or IPv6 address in hex to presentation format. + * + * mallocs space for return string; it is up to the user to free as necessary. + * + * in: fam (AF_INET or AF_INET6), + * ipHex - hex string like that returned by /proc/net/tcp[6] + * + * returns ptr to IP address in presentation format, NULL if conversion failed. + */ +static char* ipHexToPres(sa_family_t fam, char *ipHex) { + struct in6_addr ip; + char *ipPres = NULL; + int n = sscanf(ipHex, + "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx", + &ip.s6_addr[3], &ip.s6_addr[2], &ip.s6_addr[1], &ip.s6_addr[0], + &ip.s6_addr[7], &ip.s6_addr[6], &ip.s6_addr[5], &ip.s6_addr[4], + &ip.s6_addr[11], &ip.s6_addr[10], &ip.s6_addr[9], &ip.s6_addr[8], + &ip.s6_addr[15], &ip.s6_addr[14], &ip.s6_addr[13], &ip.s6_addr[12]); + if (n==4 || n==16) { + ipPres = calloc(1, INET6_ADDRSTRLEN); // not checking calloc() + inet_ntop(fam, &ip, ipPres, INET6_ADDRSTRLEN); // TODO: check for failure here + } + return ipPres; +} + +/* + * Follow symbolic link to get real filename + * + * mallocs space for return string; it is up to the user to free as necessary. + * + */ +char *readLink(const char *path) { + int len = BUFFER_SZ; + char *buf = NULL; + while (TRUE) { + buf = (char *) realloc(buf, len); + int num = readlink(path, buf, len); + if (num < 0) { + free(buf); + return NULL; + } + if (num < len) { + buf = (char *) realloc(buf, num+1); + buf[num] = 0; + break; + } + len *= 2; + } + return buf; +} + +/* + * Determine if a process is holding one of the SFCB sockets. + * + * in: pid, inodeList, inodeCnt + * out: fdCntPtr + * + * returns TRUE if an inode in inodeList is found in this process' fd list + */ +static int isProcHoldingSocket(int pid, SockDescr *socketList, int socketCnt, + int *fdCntPtr, char **matchingIp) { + int i, rc; + int match = FALSE; + char msgbuf[BUFFER_SZ]; + char pathname[MAX_PATH_SZ]; + char pattern[MAX_PATTERN_SZ]; + char *realname; + + struct dirent *entry; + DIR *dir; + regex_t regexpr; + + sprintf(pathname, "/proc/%d/fd", pid); + if ((dir = opendir(pathname)) == 0) { + // pid already gone + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, pathname); + return ERROR; + } + /* + * This function takes a shortcut by quitting the search after the first match + * (although we continue to count fds for other purposes). This is equivalent + * to assuming each HTTP adapter only holds one socket. In fact, with the + * current design an adapter may hold sockets for both http and https, and we + * do not differentiate between sockets (ports) here. Instead we report only + * the IP address that the adapter is holding. Really. we should find all + * sockets for an adapter process and report them all to the user. + */ + *fdCntPtr = 0; + while ((entry = readdir(dir))) { + // Each entry is a fd that is potentially a socket. + if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { + (*fdCntPtr)++; + // If we already found a match, only need to count fds from here out. + if (match) continue; + + sprintf(pathname, "/proc/%d/fd/%s", pid, entry->d_name); + + realname = readLink(pathname); + if (realname != NULL) { + + for (i=0; i<socketCnt; i++) { + + // Compile regular expression + sprintf(pattern, ".*\\[%d\\]", socketList[i].inode); + if ((rc = regcomp(®expr, pattern, 0))) { + fprintf(stderr, "%s: error: failure to compile regex at %s(%d)\n", + name, __FILE__, __LINE__); + exit(1); + } + + // Execute regular expression + if (!(rc = regexec(®expr, realname, 0, NULL, 0))) { + match = TRUE; + *matchingIp = socketList[i].ip; + break; // iterating over socket list + } + else if (rc == REG_NOMATCH) { + // continue + } + else { + regerror(rc, ®expr, msgbuf, sizeof(msgbuf)); + fprintf(stderr, "%s: error: regex match failed (%s) at %s(%d)\n", + name, msgbuf, __FILE__, __LINE__); + exit(1); + } + regfree(®expr); + } + if (realname) free(realname); + } + else { + // pid (or file descriptor) already gone + if (debug) + fprintf(stderr, + "%s: warning: cannot access %s (process may be gone)\n", name, + pathname); + break; + } + } + } + return match; +} + +/* + * Determine if process is a provider process by checking /proc/pid/maps entries + * against a list of provider signatures. + * + * in: pid + * + * returns a pointer to the display name of the provider, if a match is found, + * otherwise returns NULL. + */ +char* isProcProviderX(int pid, ProviderLstEntry* provLst) { + int i, rc; + int precedent = -1; + char filename[MAX_PATH_SZ]; + char msgbuf[BUFFER_SZ]; + char pattern[MAX_PATTERN_SZ]; + char *dot, *bestmatch = NULL; + char *line = NULL; + char *pathname; + size_t len = 0; + ssize_t read; + + FILE *fp; + regex_t regexpr; + + sprintf(filename, "/proc/%d/maps", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return NULL; + } + + while ((read = getline(&line, &len, fp)) != -1) { + + if (!(pathname = strchr(line, '/'))) continue; + + size_t nmatch = 1; + regmatch_t matchinfo[1]; + + for (i=0; provLst[i].regex; i++) { + + // Compile regular expression + sprintf(pattern, "%s", provLst[i].regex); + if ((rc = regcomp(®expr, pattern, 0))) { + fprintf(stderr, "%s: error: failure to compile regex at %s(%d)\n", name, + __FILE__, __LINE__); + exit(1); + } + + // Execute regular expression (and determine match substring) + if (!(rc = regexec(®expr, pathname, nmatch, matchinfo, 0))) { + *(pathname + (int) matchinfo->rm_eo) = '\0'; + + if (precedent < 0 || precedent > i) { + precedent = i; + if (*(provLst[i].label) == '*') { + if ((dot = strchr(pathname, '.'))) { *dot = '\0'; } + // use the match substring as display name + bestmatch = strdup(pathname + (int) matchinfo->rm_so); + } + else { + // use the label as display name + bestmatch = provLst[i].label; + } + } + break; // iterating over provider list + } + else if (rc == REG_NOMATCH) { + // continue + } + else { + regerror(rc, ®expr, msgbuf, sizeof(msgbuf)); + fprintf(stderr, "%s: error: regex match failed (%s) at %s(%d)\n", name, + msgbuf, __FILE__, __LINE__); + exit(1); + } + regfree(®expr); + } + } + if (line) free(line); + fclose(fp); + return bestmatch; +} + +/* + * Get vital data for a single SFCB processes. + * + * in: pid + * out: p is a ProcStat structure to be populated with retrieved data + * + * returns the pid if the process is an SFCB process, otherwise returns 0 + */ +static int getProcStat(int pid, ProcStat *p) { + FILE *fp; + char filename[MAX_PATH_SZ]; + char *line = NULL; + size_t len = 0; + ssize_t read; + const char *fmt = "%d %s %c %d %d"; + + sprintf(filename, "/proc/%d/stat", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return 0; + } + + if (5 == fscanf(fp, fmt, &p->pid, p->comm, &p->state, &p->ppid, &p->pgrp)) { + fclose(fp); + + if (strcmp(p->comm, "(sfcbd)") != 0 && strcmp(p->comm, "(lt-sfcbd)")) + return 0; + + // Get the full cmdline for the process + sprintf(filename, "/proc/%d/cmdline", pid); + if ((fp = fopen(filename, "r")) == 0) { + if (debug) + fprintf(stderr, "%s: warning: cannot access %s (process may be gone)\n", + name, filename); + return 0; + } + int pass = 0; + *p->cmd = '\0'; + while ((read = getdelim(&line, &len, 0, fp)) != -1) { + if (strlen(p->cmd) + strlen(line) > MAX_CMD_SZ-2) { + break; + } + else { + if (pass++ > 0) strcat(p->cmd, " "); + strcat(p->cmd, line); + } + } + if (line) free(line); + return pid; + } + else { + if (debug) + fprintf(stderr, + "%s: warning: scanf failed for /proc/%d/stat (process may be gone)\n", + name, pid); + fclose(fp); + return ERROR; + } +} + +/* + * Get vital data for all SFCB processes. + * + * out: p is a dynamically malloced array of ProcStat structures + * + * returns the number of SFCB processes found + */ +int getProcStatList(ProcStat **p) { + int pid; + int cnt = 0; + DIR *procDIR; + struct dirent *entry; + ProcStat *procList; + + if ((procList = calloc(1, sizeof(ProcStat))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + if ((procDIR = opendir("/proc/")) == 0) { + fprintf(stderr, "%s: error: cannot access /proc (%s)\n", name, + strerror(errno)); + return ERROR; + } + while ((entry = readdir(procDIR))) { + if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { + // If dirname is numeric, it's a pid. + if ((pid = atoi(entry->d_name))) { + + if (getProcStat(pid, &procList[cnt]) > 0) { // this is a SFCB process + cnt++; + if ((procList = realloc(procList, (cnt+1) * sizeof(ProcStat))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + } + } + } + } + closedir(procDIR); + *p = procList; + return cnt; +} + +/* + * Get the list of inodes (sockets) for a given TCP port on IPv4 or IPv6. + * Note there may be more than one if SFCB binds to >1 IP address. . + * + * in: port, addressFam + * out: iListPtr is a dynamically malloced array inode numbers + * + * returns the number of inodes (sockets) found + */ +static int getSocketInodeList(int port, int addrFam, SockDescr **sockListPtr) { + int cnt=0, numFields; + char bufr[256]; + char filename[MAX_PATH_SZ]; + char *scnfmt; + FILE *fp; + + // For reading /proc/net/tcp and /proc/net/tcp6 + char *scnfmt4 = + "%*d: %8s:%4x %8s:%4x %*2x %*8x:%*8x %*2x:%*8x %*8x %d %*d %u \n"; + char *scnfmt6 = + "%*d: %32s:%4x %32s:%4x %*2x %*8x:%*8x %*2x:%*8x %*8x %d %*d %u \n"; + + char locaddr[33], remaddr[33]; + int locport, remport, uid, inode; + + SockDescr *sockList; + + if ((sockList = calloc(1, sizeof(SockDescr))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + + if (addrFam==AF_INET) { + sprintf(filename, "/proc/net/tcp"); + scnfmt = scnfmt4; + numFields = 6; + } + else if (addrFam==AF_INET6) { + sprintf(filename, "/proc/net/tcp6"); + scnfmt = scnfmt6; + numFields = 6; + } + else { + fprintf(stderr,"%s: error: invalid address family: %d\n", name, addrFam); + return ERROR; + } + + if ((fp = fopen(filename, "r")) == 0) { + fprintf(stderr, "%s: error: cannot access %s (%s)\n", name, filename, + strerror(errno)); + return ERROR; + } + + while (fgets(bufr, 256, fp)) { + + if (numFields + != fscanf(fp, scnfmt, locaddr, &locport, remaddr, &remport, &uid, + &inode)) { + *sockListPtr = sockList; + return cnt; + } + + if (locport == port) { /* match */ + + if (verbose) + (sockList + cnt)->ip = ipHexToPres(addrFam, locaddr); + else + (sockList + cnt)->ip = NULL; /* more efficient */ + + (sockList + cnt)->port = port; + (sockList + cnt)->inode = inode; + cnt++; + + if ((sockList = realloc(sockList, (cnt+1) * sizeof(SockDescr))) == 0) { + fprintf(stderr, "%s: error: malloc failed (%s) at %s(%d)\n", name, + strerror(errno), __FILE__, __LINE__); + return ERROR; + } + } + } + return ERROR; +} + +static void usage(int status) { + + if (status != 0) + fprintf(stderr, "Try '%s --help' for more information.\n", name); + + else + { + static const char * help[] = { + "", + "Options:", + " -d, --debug show additional debug info", + " -h, --help display this message and exit", + " -p, --portlist=<PORTLIST> specify the TCP ports to hunt for", + " PORTLIST is a comma-separated list of port numbers", + " -r, --raw list raw ps info rather than trying to analyze", + " -v, --verbose show more details", + "" + }; + + int i; + + fprintf(stdout, "Usage: %s [options]\n", name); + for (i=0; i < sizeof(help) / sizeof(char*); i++) + fprintf(stdout, "%s\n", help[i]); + } + exit(status); +} + +int main(int argc, char **argv) { + char *role, *type, *matchIp=NULL, *portlist=NULL; + int c, i, j, n, procCnt, fdCnt, socketCnt=0; + + int port; + int portList[MAX_PORTS] = { DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT, 0 }; + + SockDescr *sList, socketList[MAX_INODES]; + + ProcStat *psInfo, *p; + + ProviderLstEntry providerLst[] = { +// { "REGEX", "LABEL" }, + { "libdctmi.so", "Instrumentation Provider (DCTMI)" }, // not tested + { "IndCIMXMLHandler", "IndCIMXMLHandler" }, + { "InteropProvider", "Interop Provider" }, + { "sfcClassProvider", "Class Provider" }, + { "sfcProfileProvider", "Profile Provider" }, + { "sfcInternalProvider", "SFCB Internal Provider" }, + { "sfcInteropServerProvider", "SFCB Interop Server Provider" }, + { "[^/]*Provider.so", "*" }, + { NULL, NULL }, + }; + + name = strrchr(argv[0], '/'); + if (name != NULL) ++name; + else name = argv[0]; + + static struct option const long_options[] = { + { "debug", no_argument, 0, 'd' }, + { "help", no_argument, 0, 'h' }, + { "portlist", required_argument, 0, 'p' }, + { "raw", no_argument, 0, 'r' }, + { "verbose", no_argument, 0, 'v' }, + { 0, 0, 0, 0 } + }; + + while ((c = getopt_long(argc, argv, "dhp:rv", long_options, 0)) != -1) + { + switch(c) + { + case 0: + break; + + case 'd': + debug = 1; + break; + + case 'h': + usage(0); + break; + + case 'p': + portlist = strdup(optarg); + break; + + case 'r': + raw = 1; + break; + + case 'v': + verbose = 1; + break; + + default: + usage(3); + break; + } + } + + if (optind < argc) { + fprintf(stderr,"%s: unrecognized config property: %s\n", name,argv[optind]); + usage(1); + } + + // Find SFCB processes + if ((procCnt = getProcStatList(&psInfo)) <= 0) { + printf("No SFCB Processes found.\n"); + exit(0); + } + + // Raw mode + if (raw) { + printf("%5s %5s %5s %-4s %s\n", "PID", "PPID", "PGID", "STAT", "CMD"); + for (i=0; i<procCnt; i++) { + ProcStat *p = (psInfo+i); + printf("%5d %5d %5d %-4c %s\n", p->pid,p->ppid,p->pgrp,p->state,p->cmd); + } + exit(0); + } + + // Parse comma-delimited list from cmdline (overrides default list) + if (portlist) { + char* t = strtok(portlist,","); + int portCnt = 0; + while (t) { + portList[portCnt] = atoi(t); + portCnt++; + t = strtok(NULL,","); + } + portList[portCnt] = 0; // terminate the list + } + + // For each port, look for open sockets on IPv4 & IPv6, add to socketList + for (i=0; (port=portList[i]); i++) { + + n = getSocketInodeList(port, AF_INET, &sList); + for (j=0; j<n; j++) { + socketList[socketCnt++] = sList[j]; + if (debug) + printf("Got inode %d for socket %s:%u (%#x)\n", sList[j].inode, + sList[j].ip, sList[j].port, port); + } + n = getSocketInodeList(port, AF_INET6, &sList); + for (j=0; j<n; j++) { + socketList[socketCnt++] = sList[j]; + if (debug) + printf("Got inode %d for socket [%s]:%u (%#x)\n", sList[j].inode, + sList[j].ip, sList[j].port, port); + } + } + + if (debug) { + printf("\nFound a total of %d SFCB socket inodes: ", socketCnt); + for (i=0; i<socketCnt; i++) + printf("%u ", socketList[i].inode); + + printf("\nFound a total of %d SFCB processes\n\n", procCnt); + } + + // Print process list with role + printf("%5s %5s %5s %-4s %s\n", "PID", "PPID", "PGID", "STAT", "ROLE"); + for (i=0; i<procCnt; i++) { + p = &psInfo[i]; + + if (p->pid == p->pgrp || p->ppid == 1) { + role = "SFCB Main"; + } + else if (isProcHoldingSocket(p->pid,socketList,socketCnt,&fdCnt,&matchIp)) { + type = (p->ppid == p->pgrp) ? "Http Daemon" : "Http Request Handler"; + if (verbose) { + role = malloc(INET6_ADDRSTRLEN + 30); + sprintf(role, "%s [%s]", type, matchIp); /* show bind ip */ + } else { + role = type; + } + } + else if (fdCnt > 0 && fdCnt < 45) { + role = "SFCB Logger"; + } + else if ((role = isProcProviderX(p->pid, providerLst))) { + // nothing further need to be done + } + else { + role = "Unknown"; + } + + printf("%5d %5d %5d %-4c %s\n", p->pid, p->ppid, p->pgrp, p->state, role); + } + exit(0); +} hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave H. <hel...@us...> - 2013-01-22 22:10:37
|
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 facb84413b5892abb803b4bf3782e80e18507051 (commit) from 82f2f2d60f106c4366f4cc7cac8c1bc5d12bad98 (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 facb84413b5892abb803b4bf3782e80e18507051 Author: Dave Heller <hel...@us...> Date: Tue Jan 22 17:02:50 2013 -0500 [ 3601661 ] Reenable no-fork http adapter mode ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index 36ae40a..705c966 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Bugs fixed: - 3599437 missing include of <sys/resource.h> - 3601301 Add stubs for empty CMPI functions for internal providers - 2878328 sfcb and mofc won't compile with --disable-qualifierrep +- 3601661 Reenable no-fork http adapter mode Changes in 1.4.3 ================ diff --git a/httpAdapter.c b/httpAdapter.c index 381ec76..b74998f 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -78,7 +78,6 @@ unsigned long exFlags = 0; static char *name; -static int debug; static int doBa; #ifdef HAVE_UDS static int doUdsAuth; @@ -211,7 +210,6 @@ initHttpProcCtl(int p) union semun sun; int i; - mlogf(M_INFO, M_SHOW, "--- Max Http procs: %d\n", p); if ((httpProcSem = semget(httpProcSemKey, 1, 0600)) != -1) semctl(httpProcSem, 0, IPC_RMID, sun); @@ -931,6 +929,7 @@ doHttpRequest(CommHndl conn_fd) } else if (rc == 3) { genError(conn_fd, &inBuf, 400, "Bad Request", NULL); _SFCB_TRACE(1, ("--- exiting after request timeout.")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -939,7 +938,9 @@ doHttpRequest(CommHndl conn_fd) /* * no buffer data - end of file - quit */ - _SFCB_TRACE(1, ("--- HTTP connection EOF, quit %d ", currentProc)); + _SFCB_TRACE(1, ("--- HTTP connection EOF, normal termination")); + if (!doFork) _SFCB_RETURN(1); + _SFCB_TRACE(1, ("--- Request processor exiting %d", currentProc)); commClose(conn_fd); exit(1); } @@ -972,6 +973,7 @@ doHttpRequest(CommHndl conn_fd) if (badReq) { genError(conn_fd, &inBuf, 400, "Bad Request", NULL); _SFCB_TRACE(1, ("--- exiting after malformed header.")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -989,6 +991,7 @@ doHttpRequest(CommHndl conn_fd) if (cp[0] == '-') { genError(conn_fd, &inBuf, 400, "Negative Content-Length", NULL); _SFCB_TRACE(1, ("--- exiting: content-length too big")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -999,6 +1002,7 @@ doHttpRequest(CommHndl conn_fd) "Error converting Content-Length to a decimal value", NULL); _SFCB_TRACE(1, ("--- exiting: content-length conversion error")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -1007,12 +1011,14 @@ doHttpRequest(CommHndl conn_fd) genError(conn_fd, &inBuf, 501, "Server misconfigured (httpMaxContentLength)", NULL); _SFCB_TRACE(1, ("--- exiting: bad config httpMaxContentLength")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } if ((clen >= UINT_MAX) || ((maxLen) && (clen > maxLen))) { genError(conn_fd, &inBuf, 413, "Request Entity Too Large", NULL); _SFCB_TRACE(1, ("--- exiting: content-length too big")); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -1064,6 +1070,7 @@ doHttpRequest(CommHndl conn_fd) */ mlogf(M_ERROR, M_SHOW, "\n--- Client certificate not accessible - closing connection\n"); + if (!doFork) _SFCB_RETURN(1); commClose(conn_fd); exit(1); } @@ -1169,12 +1176,13 @@ doHttpRequest(CommHndl conn_fd) genError(conn_fd, &inBuf, 411, "Length Required", NULL); } _SFCB_TRACE(1, ("--- exiting after missing content length.")); - commClose(conn_fd); freeBuffer(&inBuf); if (more) { free(more); more=NULL; } + if (!doFork) _SFCB_RETURN(1); + commClose(conn_fd); exit(1); } @@ -1187,11 +1195,12 @@ doHttpRequest(CommHndl conn_fd) if (rc < 0) { genError(conn_fd, &inBuf, 400, "Bad Request", NULL); _SFCB_TRACE(1, ("--- exiting after request timeout.")); - commClose(conn_fd); if (more) { free(more); more=NULL; } + if (!doFork) _SFCB_RETURN(1); + commClose(conn_fd); exit(1); } if (discardInput) { @@ -1304,9 +1313,8 @@ handleHttpRequest(int connFd, int __attribute__ ((unused)) sslMode) _SFCB_ENTER(TRACE_HTTPDAEMON, "handleHttpRequest"); - _SFCB_TRACE(1, ("--- Forking request processor")); - if (doFork) { + _SFCB_TRACE(1, ("--- Forking request processor")); semAcquire(httpWorkSem, 0); semAcquire(httpProcSem, 0); for (httpProcIdX = 0; httpProcIdX < hMax; httpProcIdX++) @@ -1581,8 +1589,10 @@ handleHttpRequest(int connFd, int __attribute__ ((unused)) sslMode) /* * no persistence wanted or exceeded - quit */ + _SFCB_TRACE(1,("--- keepalive disabled or max requests exceeded")); break; } + _SFCB_TRACE(1, ("--- keepalive enabled, waiting for new request")); /* * wait for next request or timeout */ @@ -1603,8 +1613,10 @@ handleHttpRequest(int connFd, int __attribute__ ((unused)) sslMode) } while (1); commClose(conn_fd); - if (!doFork) - return; + if (!doFork) { + _SFCB_TRACE(1, ("--- Request processor completed")); + _SFCB_EXIT(); + } _SFCB_TRACE(1, ("--- Request processor exiting %d", currentProc)); dumpTiming(currentProc); @@ -1933,8 +1945,7 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, #endif socklen_t httpSin_len = 0; - int i, - rc; + int rc; char *cp; long httpPort; int httpListenFd = -1; @@ -1961,7 +1972,6 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, socklen_t sun_len; #endif - debug = 1; doFork = 1; _SFCB_ENTER(TRACE_HTTPDAEMON, "httpDaemon"); @@ -1997,11 +2007,12 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, udsPath = NULL; #endif - if (!enableHttp) - httpPort = -1; - /* - * note: we check for enableHttps in sfcBroker - */ + /* note: we check if httpProcs==0 in sfcBroker and disable http accordingly */ + mlogf(M_INFO, M_SHOW, "--- Max Http procs: %d\n", hMax); + if (hMax == 1) { + mlogf(M_INFO, M_SHOW, "--- Forking of http request handlers disabled\n"); + doFork = 0; + } initHttpProcCtl(hMax); @@ -2030,29 +2041,6 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, else if (strcmp(chunkStr, "always") == 0) chunkMode = CHUNK_FORCE; } - /* - * grab commandline options - */ - i = 1; - while (i < argc && argv[i][0] == '-') { - if (strcmp(argv[i], "-D") == 0) - debug = 1; - else if (strcmp(argv[i], "-nD") == 0) - debug = 0; - else if (strcmp(argv[i], "-p") == 0 && i + 1 < argc) { - ++i; - httpPort = (unsigned short) atoi(argv[i]); - } else if (strcmp(argv[i], "-tm") == 0) { - if (isdigit(*argv[i + 1])) { - ++i; - } - } else if (strcmp(argv[i], "-F") == 0) - doFork = 1; - else if (strcmp(argv[i], "-nF") == 0) - doFork = 0; - ++i; - } - name = argv[0]; cp = strrchr(name, '/'); if (cp != NULL) @@ -2144,16 +2132,6 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, if (bindrc > 0) return 1; /* if can't bind to port, return 1 */ - if (!debug) { - int rc = fork(); - if (rc == -1) { - char *emsg = strerror(errno); - mlogf(M_ERROR, M_SHOW, "--- fork daemon: %s", emsg); - exit(1); - } else if (rc) - exit(0); - } - currentProc = getpid(); setSignal(SIGCHLD, handleSigChld, 0); diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in index 28ebdb1..3da634b 100644 --- a/sfcb.cfg.pre.in +++ b/sfcb.cfg.pre.in @@ -57,6 +57,9 @@ httpPort: 5988 #httpUser: ## Max number of HTTP processes. +## Setting to 0 disables starting of HTTP adapter and allows connections via +## LocalConnect only. Setting to 1 enables no-fork mode which prevents forking +## of request handler processes. ## Default is 8 httpProcs: 8 hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-22 18:32: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 82f2f2d60f106c4366f4cc7cac8c1bc5d12bad98 (commit) from ab54fbf546070dba77147ea57f89264d3215989f (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 82f2f2d60f106c4366f4cc7cac8c1bc5d12bad98 Author: buccella <buc...@li...> Date: Tue Jan 22 13:29:45 2013 -0500 [ 2878328 ] sfcb and mofc won't compile with --disable-qualifierrep ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index a4eb74c..36ae40a 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Bugs fixed: - 3601026 Fixup compiler warnings from -Wextra - 3599437 missing include of <sys/resource.h> - 3601301 Add stubs for empty CMPI functions for internal providers +- 2878328 sfcb and mofc won't compile with --disable-qualifierrep Changes in 1.4.3 ================ diff --git a/cimXmlOps.y b/cimXmlOps.y index 3881c84..0af0e86 100644 --- a/cimXmlOps.y +++ b/cimXmlOps.y @@ -44,8 +44,10 @@ extern CMPIConstClass initConstClass(ClClass * cl); extern MsgSegment setConstClassMsgSegment(CMPIConstClass * cl); extern MsgSegment setInstanceMsgSegment(CMPIInstance *ci); -extern CMPIQualifierDecl initQualifier(ClQualifierDeclaration * qual); extern MsgSegment setArgsMsgSegment(CMPIArgs * args); +#ifdef HAVE_QUALREP +extern CMPIQualifierDecl initQualifier(ClQualifierDeclaration * qual); +#endif int updateMethodParamTypes(RequestHdr * hdr); // @@ -1169,6 +1171,8 @@ buildSetPropertyRequest(void *parm) binCtx->pAs = NULL; } +#ifdef HAVE_QUALREP + static void buildGetQualifierRequest(void *parm) { @@ -1361,6 +1365,13 @@ buildEnumQualifiersRequest(void *parm) binCtx->chunkedMode = 0; binCtx->pAs = NULL; } +#else + +static void buildDeleteQualifierRequest(void *parm) { return; } +static void buildGetQualifierRequest(void *parm) { return; } +static void buildSetQualifierRequest(void *parm) { return; } +static void buildEnumQualifiersRequest(void *parm) { return; } +#endif // HAVE_QUALREP static void buildInvokeMethodRequest(void *parm) hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-18 15:20:50
|
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 ab54fbf546070dba77147ea57f89264d3215989f (commit) from 525240d35f40a07d5ae6453b8c876689ac64dd32 (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 ab54fbf546070dba77147ea57f89264d3215989f Author: buccella <buc...@li...> Date: Fri Jan 18 10:18:11 2013 -0500 [ 3601386 ] Add test for EmbeddedObject output ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index 880abd6..a4eb74c 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Everything in 1.3.17 (see below), plus: New features: - 3597805 Restart HTTP daemon without restarting SFCB - 3597806 Bind to arbitrary list of IP addresses in SFCB +- 3601386 Add test for EmbeddedObject output Bugs fixed: - 3599526 segfault during ecn with classProviderSf diff --git a/test/TestProviders/cmpiTestInstanceProvider.c b/test/TestProviders/cmpiTestInstanceProvider.c index a974de3..eba1812 100644 --- a/test/TestProviders/cmpiTestInstanceProvider.c +++ b/test/TestProviders/cmpiTestInstanceProvider.c @@ -103,16 +103,19 @@ initialize() CMPIArray *arr_ptr; CMPIValue value1, value2, + value3, value_inst1, value_inst2; CMPIInstance *instance1, *instance2, - *instance3; + *instance3, + *Einst; CMPIObjectPath *cop1, *cop2, *cop3; value1.uint8 = 1; value2.string = CMNewString(_broker, "Hello World", &rc); + value3.string = CMNewString(_broker, "I'm an EmbeddedObject", &rc); /* * create a new array to hold the instances created @@ -139,6 +142,13 @@ initialize() */ CMSetProperty(instance1, "Identifier", &value1, CMPI_uint8); CMSetProperty(instance1, "Message", &value2, CMPI_string); + + /* EmbeddedObject */ + Einst = CMNewInstance(_broker, cop1, &rc); + CMSetProperty(Einst, "Message", &value3, CMPI_string); + CMSetProperty(instance1, "EInst", &Einst, CMPI_instance); + + value_inst1.inst = instance1; /* diff --git a/test/TestProviders/tests/Test1EnumerateInstances.OK b/test/TestProviders/tests/Test1EnumerateInstances.OK new file mode 100644 index 0000000..e87011f --- /dev/null +++ b/test/TestProviders/tests/Test1EnumerateInstances.OK @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8" ?> +<CIM CIMVERSION="2.0" DTDVERSION="2.0"> +<MESSAGE ID="10001" PROTOCOLVERSION="1.0"> +<SIMPLERSP> +<IMETHODRESPONSE NAME="EnumerateInstances"> +<IRETURNVALUE> +<VALUE.NAMEDINSTANCE> +<INSTANCENAME CLASSNAME="Sample_Instance"> +<KEYBINDING NAME="Identifier"> +<KEYVALUE VALUETYPE="numeric">1</KEYVALUE> +</KEYBINDING> +</INSTANCENAME> +<INSTANCE CLASSNAME="Sample_Instance"> +<PROPERTY NAME="Identifier" TYPE="uint8"> +<VALUE>1</VALUE> +</PROPERTY> +<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +<VALUE><![CDATA[<INSTANCE CLASSNAME="Sample_Instance"> +<PROPERTY NAME="Identifier" TYPE="uint8"> +<VALUE>1</VALUE> +</PROPERTY> +<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Message" TYPE="string"> +<VALUE>I'm an EmbeddedObject</VALUE> +</PROPERTY> +</INSTANCE> +]]></VALUE> +</PROPERTY> +<PROPERTY NAME="Message" TYPE="string"> +<VALUE>Hello World</VALUE> +</PROPERTY> +</INSTANCE> +</VALUE.NAMEDINSTANCE> +<VALUE.NAMEDINSTANCE> +<INSTANCENAME CLASSNAME="Sample_Instance"> +<KEYBINDING NAME="Identifier"> +<KEYVALUE VALUETYPE="numeric">2</KEYVALUE> +</KEYBINDING> +</INSTANCENAME> +<INSTANCE CLASSNAME="Sample_Instance"> +<PROPERTY NAME="Identifier" TYPE="uint8"> +<VALUE>2</VALUE> +</PROPERTY> +<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Message" TYPE="string"> +<VALUE>Yo Planet</VALUE> +</PROPERTY> +</INSTANCE> +</VALUE.NAMEDINSTANCE> +<VALUE.NAMEDINSTANCE> +<INSTANCENAME CLASSNAME="Sample_Instance"> +<KEYBINDING NAME="Identifier"> +<KEYVALUE VALUETYPE="numeric">3</KEYVALUE> +</KEYBINDING> +</INSTANCENAME> +<INSTANCE CLASSNAME="Sample_Instance"> +<PROPERTY NAME="Identifier" TYPE="uint8"> +<VALUE>3</VALUE> +</PROPERTY> +<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Message" TYPE="string"> +<VALUE>Hey Earth</VALUE> +</PROPERTY> +</INSTANCE> +</VALUE.NAMEDINSTANCE> +</IRETURNVALUE> +</IMETHODRESPONSE> +</SIMPLERSP> +</MESSAGE> +</CIM> diff --git a/test/TestProviders/tests/Test1EnumerateInstances.lines b/test/TestProviders/tests/Test1EnumerateInstances.lines deleted file mode 100644 index 7ae92e7..0000000 --- a/test/TestProviders/tests/Test1EnumerateInstances.lines +++ /dev/null @@ -1,43 +0,0 @@ -<INSTANCENAME CLASSNAME="Sample_Instance"> -<KEYBINDING NAME="Identifier"> -<KEYVALUE VALUETYPE="numeric">1</KEYVALUE> -</KEYBINDING> -</INSTANCENAME> -<INSTANCE CLASSNAME="Sample_Instance"> -<PROPERTY NAME="Message" TYPE="string"> -<VALUE>Hello World</VALUE> -</PROPERTY> -<PROPERTY NAME="Identifier" TYPE="uint8"> -<VALUE>1</VALUE> -</PROPERTY> -</INSTANCE> -</VALUE.NAMEDINSTANCE> -<VALUE.NAMEDINSTANCE> -<INSTANCENAME CLASSNAME="Sample_Instance"> -<KEYBINDING NAME="Identifier"> -<KEYVALUE VALUETYPE="numeric">2</KEYVALUE> -</KEYBINDING> -</INSTANCENAME> -<INSTANCE CLASSNAME="Sample_Instance"> -<PROPERTY NAME="Message" TYPE="string"> -<VALUE>Yo Planet</VALUE> -</PROPERTY> -<PROPERTY NAME="Identifier" TYPE="uint8"> -<VALUE>2</VALUE> -</PROPERTY> -</INSTANCE> -</VALUE.NAMEDINSTANCE> -<VALUE.NAMEDINSTANCE> -<INSTANCENAME CLASSNAME="Sample_Instance"> -<KEYBINDING NAME="Identifier"> -<KEYVALUE VALUETYPE="numeric">3</KEYVALUE> -</KEYBINDING> -</INSTANCENAME> -<INSTANCE CLASSNAME="Sample_Instance"> -<PROPERTY NAME="Message" TYPE="string"> -<VALUE>Hey Earth</VALUE> -</PROPERTY> -<PROPERTY NAME="Identifier" TYPE="uint8"> -<VALUE>3</VALUE> -</PROPERTY> -</INSTANCE> diff --git a/test/schema/root/cimv2/Test_Instance.mof b/test/schema/root/cimv2/Test_Instance.mof index a9a1017..066dd8c 100644 --- a/test/schema/root/cimv2/Test_Instance.mof +++ b/test/schema/root/cimv2/Test_Instance.mof @@ -11,4 +11,7 @@ class Sample_Instance : Sample_Class { [read, write] string Message; + + [EmbeddedObject] + string Einst; }; hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-18 00:13:06
|
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 525240d35f40a07d5ae6453b8c876689ac64dd32 (commit) from feca55e8aaed772e4c3aed68b677011091ad8124 (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 525240d35f40a07d5ae6453b8c876689ac64dd32 Author: Michael Chase-Salerno <br...@li...> Date: Thu Jan 17 19:09:05 2013 -0500 - 3600283 Fixup compiler warnings from gcc 4.7 Fix change that causes httpAdapter to hang on startup. ----------------------------------------------------------------------- Summary of changes: diff --git a/httpAdapter.c b/httpAdapter.c index f262cf8..381ec76 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -2050,8 +2050,7 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, doFork = 1; else if (strcmp(argv[i], "-nF") == 0) doFork = 0; - else if (strcmp(argv[i], "-H") == 0) - ++i; + ++i; } name = argv[0]; hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-17 23:36:44
|
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 feca55e8aaed772e4c3aed68b677011091ad8124 (commit) from 7e458cea2bffa653336d76018d5d78085d8420b8 (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 feca55e8aaed772e4c3aed68b677011091ad8124 Author: Michael Chase-Salerno <br...@li...> Date: Thu Jan 17 18:35:29 2013 -0500 3600159 TestProviders should have their own Makefile Missing changes to actually use the new makefile ----------------------------------------------------------------------- Summary of changes: diff --git a/configure.ac b/configure.ac index 95dc5ff..b25f59d 100644 --- a/configure.ac +++ b/configure.ac @@ -263,7 +263,8 @@ if [test "$enable_tests"]; then AC_CONFIG_FILES([test/finaltest/Makefile]) # Enable the various tests if [test "$test_providers" == "yes"]; then - TEST_SUBDIRS="$TEST_SUBDIRS TestProviders/tests" + TEST_SUBDIRS="$TEST_SUBDIRS TestProviders TestProviders/tests" + AC_CONFIG_FILES([test/TestProviders/Makefile]) AC_CONFIG_FILES([test/TestProviders/tests/Makefile]) fi diff --git a/test/TestProviders/Makefile.am b/test/TestProviders/Makefile.am index 3f7590d..6c9054e 100644 --- a/test/TestProviders/Makefile.am +++ b/test/TestProviders/Makefile.am @@ -20,34 +20,36 @@ # # +MAINTAINERCLEANFILES = Makefile.in + +AM_CPPFLAGS=-I$(top_srcdir) +AM_LDFLAGS=-L"$(top_builddir)/.libs" + +sfcbprovtestdir=$(libdir)/sfcb + +sfcbprovtest_LTLIBRARIES = \ + libTestAssociationProvider.la \ + libTestMethodProvider.la \ + libTestInstanceProvider.la \ + libTestMiscProvider.la \ + libTestExecQueryProvider.la \ + libTestIndicationProvider.la + libTestAssociationProvider_la_SOURCES = cmpiTestAssociationProvider.c libTestAssociationProvider_la_LIBADD = -lsfcBrokerCore -libTestAssociationProvider_la_DEPENDENCIES=libsfcBrokerCore.la libTestMethodProvider_la_SOURCES = cmpiTestMethodProvider.c libTestMethodProvider_la_LIBADD = -lsfcBrokerCore -libTestMethodProvider_la_DEPENDENCIES=libsfcBrokerCore.la libTestInstanceProvider_la_SOURCES = cmpiTestInstanceProvider.c libTestInstanceProvider_la_LIBADD = -lsfcBrokerCore -libTestInstanceProvider_la_DEPENDENCIES=libsfcBrokerCore.la libTestMiscProvider_la_SOURCES = cmpiTestMiscProvider.c libTestMiscProvider_la_LIBADD = -lsfcBrokerCore -libTestMiscProvider_la_DEPENDENCIES=libsfcBrokerCore.la libTestExecQueryProvider_la_SOURCES = cmpiTestExecQueryProvider.c libTestExecQueryProvider_la_LIBADD = -lsfcBrokerCore -libTestExecQueryProvider_la_DEPENDENCIES=libsfcBrokerCore.la libTestIndicationProvider_la_SOURCES = cmpiTestIndicationProvider.c libTestIndicationProvider_la_LIBADD = -lsfcBrokerCore -libTestIndicationProvider_la_DEPENDENCIES=libsfcBrokerCore.la -sfcblib_LTLIBRARIES += \ - libTestAssociationProvider.la \ - libTestMethodProvider.la \ - libTestInstanceProvider.la \ - libTestMiscProvider.la \ - libTestExecQueryProvider.la \ - libTestIndicationProvider.la hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-17 19:32:28
|
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 7e458cea2bffa653336d76018d5d78085d8420b8 (commit) from 61bce03e4cf2f32721aa67809e7021f89201f112 (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 7e458cea2bffa653336d76018d5d78085d8420b8 Author: buccella <buc...@li...> Date: Thu Jan 17 14:32:11 2013 -0500 [ 3601301 ] Add stubs for empty CMPI functions for internal providers ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index c61b637..880abd6 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Bugs fixed: - 3600159 TestProviders should have their own Makefile - 3601026 Fixup compiler warnings from -Wextra - 3599437 missing include of <sys/resource.h> +- 3601301 Add stubs for empty CMPI functions for internal providers Changes in 1.4.3 ================ diff --git a/classProvider.c b/classProvider.c index ea406dd..6c35e00 100644 --- a/classProvider.c +++ b/classProvider.c @@ -959,8 +959,7 @@ ClassProviderSetClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * cop, const CMPIConstClass * ci) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -1091,13 +1090,8 @@ loopOnChildCount(ClassRegister * cReg, char *cn, int *i, int ignprov) _SFCB_EXIT(); } -static CMPIStatus -ClassProviderMethodCleanup(CMPIMethodMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* ClassProviderMethodCleanup */ +static CMPIStatus okCleanup(ClassProvider,Method); static CMPIStatus ClassProviderInvokeMethod(CMPIMethodMI * mi, diff --git a/classProviderCommon.h b/classProviderCommon.h index 3ac5472..a809ccc 100644 --- a/classProviderCommon.h +++ b/classProviderCommon.h @@ -31,6 +31,7 @@ #include "providerRegister.h" #include "trace.h" #include "control.h" +#include "sfcbmacs.h" #include "cmpi/cmpidt.h" #include "cmpi/cmpift.h" diff --git a/classProviderGz.c b/classProviderGz.c index 81301f4..e65bc12 100644 --- a/classProviderGz.c +++ b/classProviderGz.c @@ -864,8 +864,7 @@ ClassProviderCreateClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * ref, const CMPIConstClass * cc) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -874,8 +873,7 @@ ClassProviderSetClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * cop, const CMPIConstClass * ci) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -883,8 +881,7 @@ ClassProviderDeleteClass(CMPIClassMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * cop) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } /* @@ -965,13 +962,8 @@ loopOnChildCount(ClassRegister * cReg, char *cn, int *i, int ignprov) _SFCB_EXIT(); } -static CMPIStatus -ClassProviderMethodCleanup(CMPIMethodMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* ClassProviderMethodCleanup */ +static CMPIStatus okCleanup(ClassProvider,Method); static CMPIStatus ClassProviderInvokeMethod(CMPIMethodMI * mi, diff --git a/classProviderMem.c b/classProviderMem.c index d654141..8fb6430 100644 --- a/classProviderMem.c +++ b/classProviderMem.c @@ -780,8 +780,7 @@ ClassProviderSetClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * cop, const CMPIConstClass * ci) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -912,13 +911,8 @@ loopOnChildCount(ClassRegister * cReg, char *cn, int *i, int ignprov) _SFCB_EXIT(); } -static CMPIStatus -ClassProviderMethodCleanup(CMPIMethodMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* ClassProviderMethodCleanup */ +static CMPIStatus okCleanup(ClassProvider,Method); static CMPIStatus ClassProviderInvokeMethod(CMPIMethodMI * mi, diff --git a/classProviderSf.c b/classProviderSf.c index d83b349..4fc48a5 100644 --- a/classProviderSf.c +++ b/classProviderSf.c @@ -1240,8 +1240,7 @@ ClassProviderCreateClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * ref, const CMPIConstClass * cc) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -1250,8 +1249,7 @@ ClassProviderSetClass(CMPIClassMI * mi, const CMPIResult *rslt, const CMPIObjectPath * cop, const CMPIConstClass * ci) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } static CMPIStatus @@ -1259,8 +1257,7 @@ ClassProviderDeleteClass(CMPIClassMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * cop) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + return notSupSt; } /* @@ -1363,13 +1360,8 @@ loopOnChildCount(ClassRegister * cReg, char *cn, int *i, int ignprov) _SFCB_EXIT(); } -static CMPIStatus -ClassProviderMethodCleanup(CMPIMethodMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* ClassProviderMethodCleanup */ +static CMPIStatus okCleanup(ClassProvider,Method); static CMPIStatus ClassProviderInvokeMethod(CMPIMethodMI * mi, diff --git a/elementCapabilitiesProvider.c b/elementCapabilitiesProvider.c index 4fbaa5f..5270713 100644 --- a/elementCapabilitiesProvider.c +++ b/elementCapabilitiesProvider.c @@ -40,6 +40,7 @@ #include "native.h" #include "control.h" #include "config.h" +#include "sfcbmacs.h" #define NEW(x) ((x *) malloc(sizeof(x))) @@ -50,7 +51,6 @@ #include "cmpimacsx.h" static const CMPIBroker *_broker; -static CMPIStatus okSt = { CMPI_RC_OK, NULL }; void ElementCapabilitiesInitInstances(const CMPIContext *ctx) @@ -142,13 +142,8 @@ ElementCapabilitiesReferenceNames(CMPIAssociationMI * mi, return okSt; } -CMPIStatus -ElementCapabilitiesAssociationCleanup(CMPIAssociationMI * mi, - const CMPIContext *ctx, - CMPIBoolean terminate) -{ - return okSt; -} +/* ElementCapabilitiesAssociationCleanup */ +static CMPIStatus okCleanup(ElementCapabilities,Association); static CMPIAssociationMIFT assocMIFT__ElementCapabilities = { CMPICurrentVersion, diff --git a/internalProvider.c b/internalProvider.c index 56e8f8c..75931c4 100644 --- a/internalProvider.c +++ b/internalProvider.c @@ -35,6 +35,7 @@ #include "internalProvider.h" #include "native.h" #include "objectpath.h" +#include "sfcbmacs.h" #define LOCALCLASSNAME "InternalProvider" @@ -47,16 +48,10 @@ extern CMPIInstance *relocateSerializedInstance(void *area); extern char *sfcb_value2Chars(CMPIType type, CMPIValue * value); extern CMPIObjectPath *getObjectPath(char *path, char **msg); extern CMPIBroker *Broker; -//extern UtilStringBuffer *newStringBuffer(int s); extern void setStatus(CMPIStatus *st, CMPIrc rc, const char *msg); static const CMPIBroker *_broker; -/* - * static int cpy2lower(char *in, char *out) { int i = 0; while ((out[i] = - * tolower(in[i++])) != 0); return i - 1; } - */ - static CMPIInstance * instifyBlob(void *blob) { @@ -534,17 +529,8 @@ InternalProviderDeleteInstance(CMPIInstanceMI __attribute__ ((unused)) *mi, _SFCB_RETURN(st); } -CMPIStatus -InternalProviderExecQuery(CMPIInstanceMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - const CMPIResult __attribute__ ((unused)) *rslt, - const CMPIObjectPath __attribute__ ((unused)) *cop, - const char __attribute__ ((unused)) *lang, - const char __attribute__ ((unused)) *query) -{ - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; -} +/* InternalProviderExecQuery */ +static CMPIStatus notSupCMPI_EQ(InternalProvider); /* * ------------------------------------------------------------------ * @@ -790,17 +776,8 @@ getRefs(const CMPIContext *ctx, const CMPIResult *rslt, } } -CMPIStatus -InternalProviderAssociationCleanup(CMPIAssociationMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - CMPIBoolean __attribute__ ((unused)) terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_INTERNALPROVIDER, - "InternalProviderAssociationCleanup"); - - _SFCB_RETURN(st); -} +/* InternalProviderAssociationCleanup */ +static CMPIStatus okCleanup(InternalProvider,Association); CMPIStatus InternalProviderAssociators(CMPIAssociationMI __attribute__ ((unused)) *mi, @@ -871,28 +848,11 @@ InternalProviderReferenceNames(CMPIAssociationMI __attribute__ ((unused)) *mi, * ------------------------------------------------------------------ */ -CMPIStatus -InternalProviderMethodCleanup(CMPIMethodMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - CMPIBoolean __attribute__ ((unused)) terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* InternalProviderMethodCleanup */ +static CMPIStatus okCleanup(InternalProvider,Method); -CMPIStatus -InternalProviderInvokeMethod(CMPIMethodMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - const CMPIResult __attribute__ ((unused)) *rslt, - const CMPIObjectPath __attribute__ ((unused)) *ref, - const char __attribute__ ((unused)) *methodName, - const CMPIArgs __attribute__ ((unused)) *in, - CMPIArgs __attribute__ ((unused)) *out) -{ - _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderInvokeMethod"); - CMReturnWithChars(_broker, CMPI_RC_ERR_FAILED, - "DefaultProvider does not support invokeMethod operations"); -} +/* InternalProviderInvokeMethod */ +static CMPIStatus notSupCMPI_IM(InternalProvider); /* * ------------------------------------------------------------------ * @@ -900,39 +860,14 @@ InternalProviderInvokeMethod(CMPIMethodMI __attribute__ ((unused)) *mi, * ------------------------------------------------------------------ */ -CMPIStatus -InternalProviderPropertyCleanup(CMPIPropertyMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - CMPIBoolean __attribute__ ((unused)) terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - return st; -} +/* InternalProviderPropertyCleanup */ +static CMPIStatus okCleanup(InternalProvider,Property); -CMPIStatus -InternalProviderSetProperty(CMPIPropertyMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - const CMPIResult __attribute__ ((unused)) *rslt, - const CMPIObjectPath __attribute__ ((unused)) *ref, - const char __attribute__ ((unused)) *propName, - const CMPIData __attribute__ ((unused)) data) -{ - _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderSetProperty"); - CMReturnWithChars(_broker, CMPI_RC_ERR_FAILED, - "DefaultProvider does not support property operations"); -} +/* InternalProviderSetProperty */ +static CMPIStatus notSupCMPI_SP(InternalProvider); -CMPIStatus -InternalProviderGetProperty(CMPIPropertyMI __attribute__ ((unused)) *mi, - const CMPIContext __attribute__ ((unused)) *ctx, - const CMPIResult __attribute__ ((unused)) *rslt, - const CMPIObjectPath __attribute__ ((unused)) *ref, - const char __attribute__ ((unused)) *propName) -{ - _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderGetProperty"); - CMReturnWithChars(_broker, CMPI_RC_ERR_FAILED, - "DefaultProvider does not support property operations"); -} +/* InternalProviderGetProperty */ +static CMPIStatus notSupCMPI_GP(InternalProvider); /* * ------------------------------------------------------------------ * diff --git a/interopProvider.c b/interopProvider.c index 47862f2..97c5771 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -23,6 +23,8 @@ #include "cmpi/cmpift.h" #include "cmpi/cmpimacs.h" +#include "sfcbmacs.h" + #include <stdlib.h> #include <string.h> #include <ctype.h> @@ -1484,21 +1486,8 @@ InteropProviderDeleteInstance(CMPIInstanceMI * mi, _SFCB_RETURN(st); } -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -InteropProviderExecQuery(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const char *lang, const char *query) -{ - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "InteropProviderExecQuery"); - _SFCB_RETURN(st); -} +/* InteropProviderExecQuery */ +static CMPIStatus notSupCMPI_EQ(InteropProvider); /* * -------------------------------------------------------------------------- @@ -1510,14 +1499,9 @@ InteropProviderExecQuery(CMPIInstanceMI * mi, * -------------------------------------------------------------------------- */ -CMPIStatus -InteropProviderMethodCleanup(CMPIMethodMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "InteropProviderMethodCleanup"); - _SFCB_RETURN(st); -} +/* InteropProviderMethodCleanup */ +static CMPIStatus okCleanup(InteropProvider,Method); + /* * ------------------------------------------------------------------------- @@ -1716,15 +1700,8 @@ InteropProviderInvokeMethod(CMPIMethodMI * mi, * -------------------------------------------------------------------------- */ -CMPIStatus -InteropProviderAssociationCleanup(CMPIAssociationMI * mi, - const CMPIContext *ctx, - CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "InteropProviderAssociationCleanup"); - _SFCB_RETURN(st); -} +/* InteropProviderAssociationCleanup */ +static CMPIStatus okCleanup(InteropProvider,Association); /* * ------------------------------------------------------------------------- diff --git a/interopServerProvider.c b/interopServerProvider.c index 5c864a4..7b096ae 100644 --- a/interopServerProvider.c +++ b/interopServerProvider.c @@ -46,6 +46,7 @@ #include "control.h" #include "config.h" #include "objectpath.h" +#include "sfcbmacs.h" #define NEW(x) ((x *) malloc(sizeof(x))) @@ -57,8 +58,6 @@ static const CMPIBroker *_broker; static CMPIStatus invClassSt = { CMPI_RC_ERR_INVALID_CLASS, NULL }; -static CMPIStatus notSuppSt = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; -static CMPIStatus okSt = { CMPI_RC_OK, NULL }; // ------------------------------------------------------------------ @@ -719,9 +718,7 @@ static CMPIStatus ServerProviderCleanup(CMPIInstanceMI * mi, const CMPIContext *ctx, CMPIBoolean terminate) { - CMPIStatus st = { CMPI_RC_OK, NULL }; - - return (st); + return okSt; } static CMPIStatus @@ -814,15 +811,8 @@ ServerProviderEnumInstances(CMPIInstanceMI * mi, return okSt; } -static CMPIStatus -ServerProviderCreateInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const CMPIInstance *ci) -{ - return notSuppSt; -} +/* ServerProviderCreateInstance */ +static CMPIStatus notSupCMPI_CI(ServerProvider); static CMPIStatus ServerProviderModifyInstance(CMPIInstanceMI * mi, @@ -832,7 +822,7 @@ ServerProviderModifyInstance(CMPIInstanceMI * mi, const CMPIInstance *ci, const char **properties) { - CMPIStatus rc = { CMPI_RC_ERR_NOT_SUPPORTED, 0 }; + CMPIStatus rc = notSupSt; CMPIContext *ctxLocal; CMPIValue val; @@ -871,24 +861,11 @@ ServerProviderModifyInstance(CMPIInstanceMI * mi, return rc; } -static CMPIStatus -ServerProviderDeleteInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * ref) -{ - return notSuppSt; -} +/* ServerProviderDeleteInstance */ +static CMPIStatus notSupCMPI_DI(ServerProvider); -static CMPIStatus -ServerProviderExecQuery(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const char *lang, const char *query) -{ - return notSuppSt; -} +/* ServerProviderExecQuery */ +static CMPIStatus notSupCMPI_EQ(ServerProvider); void ServerProviderInitInstances(const CMPIContext *ctx) @@ -930,16 +907,8 @@ CMInstanceMIStub(ServerProvider, ServerProvider, _broker, /*---------------------- Association interface --------------------------*/ -CMPIStatus -ServerProviderAssociationCleanup(CMPIAssociationMI * mi, - const CMPIContext *ctx, - CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_PROVIDERS, "ServerProviderAssociationCleanup"); - - _SFCB_RETURN(st); -} +/* ServerProviderAssociationCleanup */ +static CMPIStatus okCleanup(ServerProvider,Association); /** \brief buildAssoc - Builds the Association instances * diff --git a/sfcbmacs.h b/sfcbmacs.h new file mode 100644 index 0000000..07fcf60 --- /dev/null +++ b/sfcbmacs.h @@ -0,0 +1,56 @@ +/* + * Helper macros for SFCB + */ + +static CMPIStatus __attribute__ ((unused)) notSupSt = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; +static CMPIStatus okSt = { CMPI_RC_OK, NULL }; + +#define notSupCMPI_EQ(pfx) \ + pfx##ExecQuery(CMPIInstanceMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) * cop, \ + const char __attribute__ ((unused)) *lang, \ + const char __attribute__ ((unused)) *query) { return notSupSt; } + +#define notSupCMPI_CI(pfx) \ + pfx##CreateInstance(CMPIInstanceMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) * cop, \ + const CMPIInstance __attribute__ ((unused)) *ci) { return notSupSt; } + +#define notSupCMPI_DI(pfx) \ + pfx##DeleteInstance(CMPIInstanceMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) * cop) { return notSupSt; } + +#define notSupCMPI_SP(pfx) \ + pfx##SetProperty(CMPIPropertyMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) *ref, \ + const char __attribute__ ((unused)) *propName, \ + const CMPIData __attribute__ ((unused)) data) { return notSupSt; } + +#define notSupCMPI_GP(pfx) \ + pfx##GetProperty(CMPIPropertyMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) *ref, \ + const char __attribute__ ((unused)) *propName) { return notSupSt; } + +#define notSupCMPI_IM(pfx) \ + pfx##InvokeMethod(CMPIMethodMI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + const CMPIResult __attribute__ ((unused)) *rslt, \ + const CMPIObjectPath __attribute__ ((unused)) *ref, \ + const char __attribute__ ((unused)) *methodName, \ + const CMPIArgs __attribute__ ((unused)) *in, \ + CMPIArgs __attribute__ ((unused)) *out) { return notSupSt; } + +#define okCleanup(pfx,mi) \ + pfx##mi##Cleanup(CMPI##mi##MI __attribute__ ((unused)) *mi, \ + const CMPIContext __attribute__ ((unused)) *ctx, \ + CMPIBoolean __attribute__ ((unused)) terminate) { return okSt; } diff --git a/test/xmltest/GetProperty.OK b/test/xmltest/GetProperty.OK index a5cd18a..ef8e4b2 100644 --- a/test/xmltest/GetProperty.OK +++ b/test/xmltest/GetProperty.OK @@ -3,7 +3,7 @@ <MESSAGE ID="4711" PROTOCOLVERSION="1.0"> <SIMPLERSP> <IMETHODRESPONSE NAME="GetProperty"> -<ERROR CODE="1" DESCRIPTION="DefaultProvider does not support property operations"/> +<ERROR CODE="7" DESCRIPTION="The requested operation is not supported"/> </IMETHODRESPONSE> </SIMPLERSP> </MESSAGE> diff --git a/test/xmltest/SetProperty.OK b/test/xmltest/SetProperty.OK index 3b97e4b..0a72a6e 100644 --- a/test/xmltest/SetProperty.OK +++ b/test/xmltest/SetProperty.OK @@ -3,7 +3,7 @@ <MESSAGE ID="4711" PROTOCOLVERSION="1.0"> <SIMPLERSP> <IMETHODRESPONSE NAME="SetProperty"> -<ERROR CODE="1" DESCRIPTION="DefaultProvider does not support property operations"/> +<ERROR CODE="7" DESCRIPTION="The requested operation is not supported"/> </IMETHODRESPONSE> </SIMPLERSP> </MESSAGE> diff --git a/test/xmltest/callmethod.lines b/test/xmltest/callmethod.lines index 92866c0..4da7299 100644 --- a/test/xmltest/callmethod.lines +++ b/test/xmltest/callmethod.lines @@ -1,3 +1,3 @@ <METHODRESPONSE NAME="SayHello"> -<ERROR CODE="1" DESCRIPTION="DefaultProvider does not support invokeMethod operations"/> +<ERROR CODE="7" DESCRIPTION="The requested operation is not supported"/> </METHODRESPONSE> hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave B. <bla...@us...> - 2013-01-17 14:28:22
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26483/src/org/sblim/cimclient/internal/cimxml Modified Files: Tag: Experimental CIMXMLParserImpl.java Log Message: 3598613 different data type in cim instance and cim object path Index: CIMXMLParserImpl.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/CIMXMLParserImpl.java,v retrieving revision 1.14.2.39 retrieving revision 1.14.2.40 diff -u -d -r1.14.2.39 -r1.14.2.40 --- CIMXMLParserImpl.java 2 Oct 2012 02:03:39 -0000 1.14.2.39 +++ CIMXMLParserImpl.java 17 Jan 2013 14:28:20 -0000 1.14.2.40 @@ -1,7 +1,7 @@ /** * CIMXMLParserImpl.java * - * (C) Copyright IBM Corp. 2005, 2012 + * (C) Copyright IBM Corp. 2005, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -56,6 +56,7 @@ * 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors * 3526679 2012-05-14 blaschke-oss DOM parser ignores ERROR node CODE * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability + * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path */ package org.sblim.cimclient.internal.cimxml; @@ -1294,8 +1295,11 @@ // PROPERTY CIMProperty<?>[] props = parsePROPERTIES(pInstanceE); - return new CIMInstance(pObjPath == null ? cLocalPathBuilder.build(className, null) - : pObjPath, props); + if (pObjPath == null) return new CIMInstance(cLocalPathBuilder.build(className, null), + props); + if (WBEMConfiguration.getGlobalConfiguration().synchronizeNumericKeyDataTypes()) return CIMHelper + .CIMInstanceWithSynchonizedNumericKeyDataTypes(pObjPath, props); + return new CIMInstance(pObjPath, props); } /** |
From: Dave B. <bla...@us...> - 2013-01-17 14:28:21
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26483/src/org/sblim/cimclient Modified Files: Tag: Experimental WBEMConfigurationProperties.java Log Message: 3598613 different data type in cim instance and cim object path Index: WBEMConfigurationProperties.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/WBEMConfigurationProperties.java,v retrieving revision 1.17.2.34 retrieving revision 1.17.2.35 diff -u -d -r1.17.2.34 -r1.17.2.35 --- WBEMConfigurationProperties.java 2 Oct 2012 02:03:38 -0000 1.17.2.34 +++ WBEMConfigurationProperties.java 17 Jan 2013 14:28:15 -0000 1.17.2.35 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -42,6 +42,7 @@ * 3524050 2012-06-06 blaschke-oss Improve WWW-Authenticate in HTTPClient.java * 3536399 2012-08-25 hellerda Add client/listener peer authentication properties * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability + * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path */ package org.sblim.cimclient; @@ -955,4 +956,22 @@ * </pre> */ public static final String VERIFY_JAVA_LANG_DOUBLE_STRINGS = "sblim.wbem.verifyJavaLangDoubleStrings"; + + /** + * <pre> + * If set to true, numeric key data types in a CIMInstance's CIMObjectPath + * will be synchronized to match those of the corresponding keys within + * the CIMInstance's CIMProperty[]. If set to false, the numeric key data + * types will not be synchronized. + * + * Note: Only numeric key data types in CIMInstances from CIMOM responses + * are synchronized, application calls to the CIMInstance constructor are + * not affected. + * + * Type: Boolean + * Recognition: Startup + * Default: false + * </pre> + */ + public static final String SYNCHRONIZE_NUMERIC_KEY_DATA_TYPES = "sblim.wbem.synchronizeNumericKeyDataTypes"; } |
From: Dave B. <bla...@us...> - 2013-01-17 02:44:43
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12852/src/org/sblim/cimclient/doc-files Modified Files: Tag: Experimental unittest.html Log Message: 3596303 windows http response WWW-Authenticate: Negotiate fails Index: unittest.html =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files/unittest.html,v retrieving revision 1.1.2.27 retrieving revision 1.1.2.28 diff -u -d -r1.1.2.27 -r1.1.2.28 --- unittest.html 4 Dec 2012 19:40:16 -0000 1.1.2.27 +++ unittest.html 17 Jan 2013 02:44:39 -0000 1.1.2.28 @@ -3,7 +3,7 @@ <head> <!-- * - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -35,6 +35,7 @@ * 3536399 2012-08-25 hellerda Add client/listener peer authentication properties * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability * 3592502 2012-12-04 blaschke-oss Enhance CIMDataType unit test + * 3596303 2013-01-04 blaschke-oss windows http response WWW-Authenticate: Negotiate fails --> </head> <body style="background-color: white;"> @@ -496,6 +497,17 @@ if the trailer exceptions are thrown only when expected and that status codes and description are correctly set in the exception.</td></tr> </table> + +<h3>http.HttpChallengeTest</h3> + <table border="1" cellpadding="5" cellspacing="0" width="100%"> + <tr><td>testValidChallenges</td> + <td>Tests Challenge.parseChallenge() with several valid challenges and checks + that the number of challenges along with each challenge's scheme and realm + are correctly set.</td></tr> + <tr><td>testInvalidChallenges</td> + <td>Tests Challenge.parseChallenge() with several invalid challenges and + checks if exceptions are thrown only when expected.</td></tr> + </table> <h3>cim.CIMOctetStringTest</h3> <table border="1" cellpadding="5" cellspacing="0" width="100%"> |
From: Chris B. <buc...@us...> - 2013-01-17 00:12:42
|
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 61bce03e4cf2f32721aa67809e7021f89201f112 (commit) from 6137c76fafaf520d6384b3fa52e58c3d14e53fb7 (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 61bce03e4cf2f32721aa67809e7021f89201f112 Author: buccella <buc...@li...> Date: Wed Jan 16 19:04:17 2013 -0500 [ 3599437 ] missing include of <sys/resource.h> ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index 9a2a989..c61b637 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Bugs fixed: - 3600283 Fixup compiler warnings from gcc 4.7 - 3600159 TestProviders should have their own Makefile - 3601026 Fixup compiler warnings from -Wextra +- 3599437 missing include of <sys/resource.h> Changes in 1.4.3 ================ hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-15 23:18:03
|
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 6137c76fafaf520d6384b3fa52e58c3d14e53fb7 (commit) from f87ff4c5d7193cdb3d3cd2ab6be3ed38e1bd3b41 (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 6137c76fafaf520d6384b3fa52e58c3d14e53fb7 Author: buccella <buc...@li...> Date: Tue Jan 15 18:17:54 2013 -0500 [ 3599437 ] missing include of <sys/resource.h> ----------------------------------------------------------------------- Summary of changes: diff --git a/cimRequest.c b/cimRequest.c index 54dadc2..92393e0 100644 --- a/cimRequest.c +++ b/cimRequest.c @@ -20,6 +20,8 @@ * */ +#include <sys/resource.h> + #include "cmpi/cmpidt.h" #include "cimXmlGen.h" #include "cimXmlParser.h" diff --git a/contributions.txt b/contributions.txt index c8773d8..32b5092 100644 --- a/contributions.txt +++ b/contributions.txt @@ -118,6 +118,7 @@ Klaus Kampf, Novell 03/29/2012 [ 3441028 ] sblim-sfcb fails on large https requests 03/29/2012 [ 3416054 ] Provider continues despite SIGSEGV 01/05/2013 [ 3599329 ] dlopen failed for sfcbCustomLib +01/15/2013 [ 3599437 ] missing include of <sys/resource.h> Mike Brasher, Inova ------------------- diff --git a/httpAdapter.c b/httpAdapter.c index b627b5f..f262cf8 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -62,6 +62,8 @@ #include <sys/fsuid.h> #endif +#include <sys/resource.h> + #include "httpComm.h" #include "sfcVersion.h" #include "control.h" diff --git a/providerMgr.c b/providerMgr.c index d8c6729..890de33 100644 --- a/providerMgr.c +++ b/providerMgr.c @@ -23,6 +23,7 @@ #include <signal.h> #include <time.h> #include <pthread.h> +#include <sys/resource.h> #include "cmpi/cmpidt.h" #include "providerRegister.h" hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-11 16:58:11
|
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 19a6aa18534c05f4a89410e072322269e521e565 (commit) from 38bf26a628d57814265d87468b060e7f6843036c (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 19a6aa18534c05f4a89410e072322269e521e565 Author: Michael Chase-Salerno <br...@li...> Date: Fri Jan 11 11:57:47 2013 -0500 3600159 TestProviders should have their own Makefile Missed NEWS change ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index d26031e..f1691a8 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Bugs fixed: - 3599329 dlopen failed for sfcbCustomLib - 3600125 Share client tracing shm segment - 3600283 Fixup compiler warnings from gcc 4.7 +- 3600159 TestProviders should have their own Makefile Changes in 1.4.3 ================ hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-10 20:28:20
|
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 38bf26a628d57814265d87468b060e7f6843036c (commit) via a18b0bdbe0fc04a68285dfd94ea60ea55fa219aa (commit) via 7d50a4b7a6718fb997cc502f0d559c6014414782 (commit) from b3e37b718ae13e86c203dec3f43c974d02efc476 (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 38bf26a628d57814265d87468b060e7f6843036c Merge: a18b0bd b3e37b7 Author: buccella <buc...@li...> Date: Thu Jan 10 15:27:20 2013 -0500 Merge branch 'master' of ssh://sblim.git.sourceforge.net/gitroot/sblim/sfcb commit a18b0bdbe0fc04a68285dfd94ea60ea55fa219aa Author: buccella <buc...@li...> Date: Thu Jan 10 15:27:06 2013 -0500 [ 3600283 ] Fixup compiler warnings from gcc 4.7 commit 7d50a4b7a6718fb997cc502f0d559c6014414782 Author: buccella <buc...@li...> Date: Thu Jan 10 14:21:49 2013 -0500 [ 3600283 ] Fixup compiler warnings from gcc 4.7 ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index b6d4eab..d26031e 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Bugs fixed: - 3599526 segfault during ecn with classProviderSf - 3599329 dlopen failed for sfcbCustomLib - 3600125 Share client tracing shm segment +- 3600283 Fixup compiler warnings from gcc 4.7 Changes in 1.4.3 ================ diff --git a/cimRequest.c b/cimRequest.c index 8fc52fd..8220aef 100644 --- a/cimRequest.c +++ b/cimRequest.c @@ -480,7 +480,6 @@ genEnumResponses(BinRequestContext * binCtx, CMPIArray *ar; UtilStringBuffer *sb; CMPIEnumeration *enm; - CMPIStatus rc; _SFCB_ENTER(TRACE_CIMXMLPROC, "genEnumResponses"); @@ -496,7 +495,7 @@ genEnumResponses(BinRequestContext * binCtx, object = relocateSerializedConstClass(resp[i]->object[j].data); } - rc = arraySetElementNotTrackedAt(ar, c, (CMPIValue *) & object, + arraySetElementNotTrackedAt(ar, c, (CMPIValue *) & object, binCtx->type); } } @@ -572,7 +571,6 @@ genQualifierResponses(BinRequestContext * binCtx, BinResponseHdr * resp) int j; CMPIEnumeration *enm; void *object; - CMPIStatus rc; void *genheap; _SFCB_ENTER(TRACE_CIMXMLPROC, "genQualifierResponses"); @@ -581,7 +579,7 @@ genQualifierResponses(BinRequestContext * binCtx, BinResponseHdr * resp) for (j = 0; j < resp->count; j++) { object = relocateSerializedQualifier(resp->object[j].data); - rc = arraySetElementNotTrackedAt(ar, j, (CMPIValue *) & object, + arraySetElementNotTrackedAt(ar, j, (CMPIValue *) & object, binCtx->type); } diff --git a/cimRsRequest.c b/cimRsRequest.c index 707abc2..5a3af30 100644 --- a/cimRsRequest.c +++ b/cimRsRequest.c @@ -415,14 +415,10 @@ stringsort(const void *p1, const void *p2) void getSortedKeys(CimRsReq *rsReq) { - CMPIObjectPath *op; - CMPIStatus rc; CMPIArray *klist; char ** keyNames; //int i,keyCount=0; int i; - // Get a const class object - op = NewCMPIObjectPath(rsReq->ns, rsReq->cn,&rc); CMPIConstClass *cc = getConstClass(rsReq->ns,rsReq->cn); // Get the key list and count klist = cc->ft->getKeyList(cc); diff --git a/cimXmlOps.y b/cimXmlOps.y index 5a648fa..3881c84 100644 --- a/cimXmlOps.y +++ b/cimXmlOps.y @@ -70,7 +70,7 @@ extern int noChunking; -extern int yyerror(char*); +extern int yyerror(const char*); extern int yylex (void *lvalp, ParserControl *parm); //extern MsgSegment setInstanceMsgSegment(const CMPIInstance *ci); @@ -602,8 +602,7 @@ buildCreateClassRequest(void *parm) for (m = ms->first; m; m = m->next) { ClMethod *meth; ClParameter *cl_parm; - int methId, - parmId; + int methId; methId = ClClassAddMethod(cl, m->name, m->type); meth = @@ -628,7 +627,7 @@ buildCreateClassRequest(void *parm) pa.type = r->type; pa.arraySize = (unsigned int) r->arraySize; pa.refName = r->refClass; - parmId = ClClassAddMethParameter(&cl->hdr, meth, r->name, pa); + ClClassAddMethParameter(&cl->hdr, meth, r->name, pa); cl_parm = ((ClParameter *) ClObjectGetClSection(&cl->hdr, &meth->parameters)) + methId - 1; diff --git a/cimcClientSfcbLocal.c b/cimcClientSfcbLocal.c index 495addc..56645aa 100644 --- a/cimcClientSfcbLocal.c +++ b/cimcClientSfcbLocal.c @@ -32,8 +32,8 @@ #include "queryOperation.h" #define CIMCSetStatusWithChars(st,rcp,chars) \ - { if (st != NULL) { (st)->rc=(rcp); \ - (st)->msg=NewCMPIString((chars),NULL); }} + { (st)->rc=(rcp); \ + (st)->msg=NewCMPIString((chars),NULL); } //#define NewCMPIString sfcb_native_new_CMPIString @@ -163,8 +163,6 @@ cloneClient(Client * cl, CMPIStatus *st) CMPIStatus rc; CIMCSetStatusWithChars(&rc, CMPI_RC_ERR_NOT_SUPPORTED, "Clone function not supported"); - if (st) - *st = rc; return NULL; } @@ -233,7 +231,6 @@ cpyEnumResponses(BinRequestContext * binCtx, CMPIArray *ar, *art; CMPIEnumeration *enm; - CMPIStatus rc; _SFCB_ENTER(TRACE_CIMXMLPROC, "genEnumResponses"); @@ -251,8 +248,8 @@ cpyEnumResponses(BinRequestContext * binCtx, object.cls = relocateSerializedConstClass(resp[i]->object[j].data); } // object.inst=CMClone(object.inst,NULL); - rc = CMSetArrayElementAt(ar, c, (CMPIValue *) & object.inst, - binCtx->type); + CMSetArrayElementAt(ar, c, (CMPIValue *) & object.inst, + binCtx->type); } } @@ -802,7 +799,8 @@ execQuery(Client * mb, qs = parseQuery(MEM_TRACKED, query, lang, NULL, NULL, &irc); if (irc) { - CIMCSetStatusWithChars(rc, CMPI_RC_ERR_INVALID_QUERY, + if (rc) + CIMCSetStatusWithChars(rc, CMPI_RC_ERR_INVALID_QUERY, "syntax error in query."); _SFCB_RETURN(NULL); } @@ -810,7 +808,8 @@ execQuery(Client * mb, fCls = qs->ft->getFromClassList(qs); if (fCls == NULL || *fCls == NULL) { mlogf(M_ERROR, M_SHOW, "--- from clause missing\n"); - CIMCSetStatusWithChars(rc, CMPI_RC_ERR_INVALID_QUERY, + if (rc) + CIMCSetStatusWithChars(rc, CMPI_RC_ERR_INVALID_QUERY, "required from clause is missing."); _SFCB_RETURN(NULL); } diff --git a/classProvider.c b/classProvider.c index 8f3923e..87340a6 100644 --- a/classProvider.c +++ b/classProvider.c @@ -737,8 +737,7 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, ClassBase *cb; HashTableIterator *it; char *key; - int rc, - n; + int rc; CMPIConstClass *cls; CMPIObjectPath *op; ClassRegister *cReg; @@ -768,7 +767,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, cn = NULL; if (cn == NULL) { - n = 0; for (it = cb->ht->ft->getFirst(cb->ht, (void **) &key, (void **) &cls); key && it && cls; it = diff --git a/classProviderGz.c b/classProviderGz.c index fe154db..f45ebe0 100644 --- a/classProviderGz.c +++ b/classProviderGz.c @@ -34,7 +34,7 @@ struct _ClassRegister { int assocs, topAssocs; char *fn; - gzFile *f; + gzFile f; }; typedef struct _ClassRegister ClassRegister; @@ -184,7 +184,6 @@ getFirstClass(ClassRegister * cr, char **cn, CMPIConstClass ** cls, CMPIConstClass *cc; ClassBase *cb = (ClassBase *) cr->hdl; ClassRecord *crec; - int r; Iterator i = cb->ht->ft->getFirst(cb->ht, (void **) cn, (void **) &crec); @@ -198,10 +197,10 @@ getFirstClass(ClassRegister * cr, char **cn, CMPIConstClass ** cls, } *id = NULL; - r = gzseek(cr->f, crec->position, SEEK_SET); + gzseek(cr->f, crec->position, SEEK_SET); buf = (char *) malloc(crec->length); - r = gzread(cr->f, buf, crec->length); + gzread(cr->f, buf, crec->length); cc = NEW(CMPIConstClass); cc->hdl = buf; @@ -219,7 +218,6 @@ getNextClass(ClassRegister * cr, Iterator ip, char **cn, CMPIConstClass *cc; ClassBase *cb = (ClassBase *) cr->hdl; ClassRecord *crec; - int r; Iterator i = cb->ht->ft->getNext(cb->ht, ip, (void **) cn, (void **) &crec); @@ -233,10 +231,10 @@ getNextClass(ClassRegister * cr, Iterator ip, char **cn, } *id = NULL; - r = gzseek(cr->f, crec->position, SEEK_SET); + gzseek(cr->f, crec->position, SEEK_SET); buf = (char *) malloc(crec->length); - r = gzread(cr->f, buf, crec->length); + gzread(cr->f, buf, crec->length); cc = NEW(CMPIConstClass); cc->hdl = buf; @@ -558,7 +556,6 @@ static CMPIConstClass * getClass(ClassRegister * cr, const char *clsName) { ClassRecord *crec; - int r; CMPIConstClass *cc; char *buf; @@ -573,9 +570,9 @@ getClass(ClassRegister * cr, const char *clsName) if (crec->cachedCls == NULL) { // fprintf(stderr,"--- reading class %s\n",clsName); - r = gzseek(cr->f, crec->position, SEEK_SET); + gzseek(cr->f, crec->position, SEEK_SET); buf = (char *) malloc(crec->length); - r = gzread(cr->f, buf, crec->length); + gzread(cr->f, buf, crec->length); cc = NEW(CMPIConstClass); cc->hdl = buf; @@ -675,11 +672,9 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, char *cn = NULL; CMPIFlags flgs = 0; CMPIString *cni; - ClassBase *cb; Iterator it; char *key; - int rc, - n; + int rc; ClassRecord *crec; CMPIObjectPath *op; ClassRegister *cReg; @@ -701,7 +696,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, if (cn && *cn == 0) cn = NULL; } - cb = (ClassBase *) cReg->hdl; cReg->ft->wLock(cReg); @@ -709,7 +703,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, cn = NULL; if (cn == NULL) { - n = 0; for (it = cReg->ft->getFirstClassRecord(cReg, &key, &crec); key && it && crec; it = cReg->ft->getNextClassRecord(cReg, it, &key, &crec)) { @@ -770,7 +763,6 @@ ClassProviderEnumClasses(CMPIClassMI * mi, char *cn = NULL; CMPIFlags flgs = 0; CMPIString *cni; - ClassBase *cb; Iterator it; char *key; int rc; @@ -795,7 +787,6 @@ ClassProviderEnumClasses(CMPIClassMI * mi, if (cn && *cn == 0) cn = NULL; } - cb = (ClassBase *) cReg->hdl; if (cn == NULL) { for (it = cReg->ft->getFirstClass(cReg, &key, &cls, &cid); diff --git a/classProviderMem.c b/classProviderMem.c index 86a620a..f0d393e 100644 --- a/classProviderMem.c +++ b/classProviderMem.c @@ -558,8 +558,7 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, ClassBase *cb; HashTableIterator *it; char *key; - int rc, - n; + int rc; CMPIConstClass *cls; CMPIObjectPath *op; ClassRegister *cReg; @@ -589,7 +588,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, cn = NULL; if (cn == NULL) { - n = 0; for (it = cb->ht->ft->getFirst(cb->ht, (void **) &key, (void **) &cls); key && it && cls; it = diff --git a/classProviderSf.c b/classProviderSf.c index b899c31..45978ce 100644 --- a/classProviderSf.c +++ b/classProviderSf.c @@ -43,7 +43,7 @@ struct _ClassRegister { int assocs, topAssocs; char *fn; - gzFile *f; + gzFile f; }; typedef struct _ClassRegister ClassRegister; @@ -797,7 +797,6 @@ static CMPIConstClass * getClass(ClassRegister * cr, const char *clsName, ReadCtl *ctl) { ClassRecord *crec; - int r; CMPIConstClass *cc; char *buf; @@ -812,9 +811,9 @@ getClass(ClassRegister * cr, const char *clsName, ReadCtl *ctl) /* class is not cached */ if (crec->cachedCCls == NULL) { - r = gzseek(cr->f, crec->position, SEEK_SET); + gzseek(cr->f, crec->position, SEEK_SET); buf = (char *) malloc(crec->length); - r = gzread(cr->f, buf, crec->length); + gzread(cr->f, buf, crec->length); cc = NEW(CMPIConstClass); cc->hdl = buf; @@ -1022,11 +1021,9 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, char *cn = NULL; CMPIFlags flgs = 0; CMPIString *cni; - ClassBase *cb; Iterator it; char *key; - int rc, - n; + int rc; ClassRecord *crec; CMPIObjectPath *op; ClassRegister *cReg; @@ -1048,7 +1045,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, if (cn && *cn == 0) cn = NULL; } - cb = (ClassBase *) cReg->hdl; cReg->ft->wLock(cReg); @@ -1056,7 +1052,6 @@ ClassProviderEnumClassNames(CMPIClassMI * mi, cn = NULL; if (cn == NULL) { - n = 0; for (it = cReg->ft->getFirstClassRecord(cReg, &key, &crec); key && it && crec; it = cReg->ft->getNextClassRecord(cReg, it, &key, &crec)) { @@ -1125,7 +1120,6 @@ ClassProviderEnumClasses(CMPIClassMI * mi, char *cn = NULL; CMPIFlags flgs = 0; CMPIString *cni; - ClassBase *cb; Iterator it; char *key; int rc; @@ -1151,7 +1145,6 @@ ClassProviderEnumClasses(CMPIClassMI * mi, if (cn && *cn == 0) cn = NULL; } - cb = (ClassBase *) cReg->hdl; if (cn == NULL) { for (it = cReg->ft->getFirstClassRecord(cReg, &key, &crec); diff --git a/classSchema2c.c b/classSchema2c.c index dce30c7..e09ecef 100644 --- a/classSchema2c.c +++ b/classSchema2c.c @@ -102,8 +102,7 @@ static void buildClassSource(ClassRegister * cr, char *ns) { ClassBase *cb = (ClassBase *) (cr + 1); - UtilHashTable *ct = cb->ht, - *it; + UtilHashTable *ct = cb->ht; HashTableIterator *i; char *cn; CMPIConstClass *cc; @@ -112,9 +111,9 @@ buildClassSource(ClassRegister * cr, char *ns) int j; int size; - it = cb->it = UtilFactory->newHashTable(61, - UtilHashTable_charKey | - UtilHashTable_ignoreKeyCase); + cb->it = UtilFactory->newHashTable(61, + UtilHashTable_charKey | + UtilHashTable_ignoreKeyCase); fprintf(stdout, "\n#include \"classSchemaMem.h\"\n\n"); fprintf(stdout, "\n#include <stddef.h>\n\n"); diff --git a/fileRepository.c b/fileRepository.c index 832e510..2bda01a 100644 --- a/fileRepository.c +++ b/fileRepository.c @@ -412,7 +412,6 @@ rebuild(BlobIndex * bi, const char *id, void *blob, int blen) xt = 0, dt = 0, rc = 0; - unsigned long pos; char *xn = alloca(strlen(bi->dir) + 8); char *dn = alloca(strlen(bi->dir) + 8); FILE *x, @@ -432,7 +431,7 @@ rebuild(BlobIndex * bi, const char *id, void *blob, int blen) if (len) copy(d, bi->fd, bi->dlen - (bi->bofs + bi->blen), bi->bofs + bi->blen); dt += len; - pos = ftell(d); + //pos = ftell(d); if (blen) rc = fwrite(blob,blen,1,d) - 1; dt += blen; diff --git a/httpAdapter.c b/httpAdapter.c index 509370f..e7382f7 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -1296,7 +1296,7 @@ handleHttpRequest(int connFd, int sslMode) CommHndl conn_fd; int isReady; fd_set httpfds; - struct sembuf procReleaseUnDo = { 0, 1, SEM_UNDO }; + // struct sembuf procReleaseUnDo = { 0, 1, SEM_UNDO }; struct timeval httpTimeout; int breakloop; @@ -1310,7 +1310,7 @@ handleHttpRequest(int connFd, int sslMode) for (httpProcIdX = 0; httpProcIdX < hMax; httpProcIdX++) if (semGetValue(httpProcSem, httpProcIdX + 1) == 0) break; - procReleaseUnDo.sem_num = httpProcIdX + 1; + // procReleaseUnDo.sem_num = httpProcIdX + 1; sessionId++; r = fork(); @@ -1930,7 +1930,7 @@ httpDaemon(int argc, char *argv[], int sslMode, char *ipAddr, struct sockaddr_in httpSin; #endif - socklen_t httpSin_len; + socklen_t httpSin_len = 0; int i, rc; char *cp; @@ -2249,10 +2249,9 @@ get_cert(int preverify_ok, X509_STORE_CTX * x509_ctx) _SFCB_ENTER(TRACE_HTTPDAEMON, "get_cert"); char buf[256]; - int err, depth; + int depth; x509 = X509_STORE_CTX_get_current_cert(x509_ctx); - err = X509_STORE_CTX_get_error(x509_ctx); depth = X509_STORE_CTX_get_error_depth(x509_ctx); _SFCB_TRACE(2, ("--- Verify peer certificate chain: level %d:", depth)); @@ -2305,7 +2304,7 @@ ccValidate(X509 * certificate, char **principal, int mode) static int load_cert(const char *cert_file) { - STACK_OF(x509_NAME) *cert_names; + STACK_OF(X509_NAME) *cert_names; if (cert_file == NULL) { mlogf(M_ERROR, M_SHOW, diff --git a/indCIMXMLExport.c b/indCIMXMLExport.c index b628b65..60f7208 100644 --- a/indCIMXMLExport.c +++ b/indCIMXMLExport.c @@ -183,6 +183,7 @@ genRequest(CurlData * cd, char *url, char **msg) */ rv = curl_easy_setopt(cd->mHandle, CURLOPT_POST, 1); + /* * Enable endpoint cert verification as required */ @@ -266,6 +267,11 @@ genRequest(CurlData * cd, char *url, char **msg) if (curldebug && strcasecmp(curldebug,"false")) rv = curl_easy_setopt(cd->mHandle, CURLOPT_VERBOSE, 1); + if (rv) { + *msg = strdup("Some curl opts failed during setup"); + return 2; + } + return 0; } diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c index 1b38632..9f9e602 100644 --- a/indCIMXMLHandler.c +++ b/indCIMXMLHandler.c @@ -320,7 +320,6 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi, CMPIArgs *in, *out = NULL; CMPIObjectPath *op; - CMPIData rv; unsigned short persistenceType; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerCreateInstance"); @@ -433,13 +432,13 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi, CMAddArg(in, "key", &copLocal, CMPI_ref); op = CMNewObjectPath(_broker, "root/interop", "cim_indicationsubscription", &st); - rv = CBInvokeMethod(_broker, ctx, op, "_addHandler", in, out, &st); + CBInvokeMethod(_broker, ctx, op, "_addHandler", in, out, &st); if (st.rc == CMPI_RC_OK) { st = InternalProviderCreateInstance(NULL, ctx, rslt, copLocal, ciLocal); } else { - rv=CBInvokeMethod(_broker,ctx,op,"_removeHandler",in,out,NULL); + CBInvokeMethod(_broker,ctx,op,"_removeHandler",in,out,NULL); } _SFCB_RETURN(st); @@ -460,7 +459,6 @@ IndCIMXMLHandlerModifyInstance(CMPIInstanceMI * mi, CMPIString *cn = CMGetClassName(cop, NULL); const char *cns = cn->ft->getCharPtr(cn,NULL); CMPIArgs *in; - CMPIData rv; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerModifyInstance"); @@ -480,13 +478,13 @@ IndCIMXMLHandlerModifyInstance(CMPIInstanceMI * mi, CMAddArg(in,"key",&cop,CMPI_ref); /* cn needs to be IndicationSub to route the IM call to interopProv */ CMPIObjectPath* sop=CMNewObjectPath(_broker,"root/interop","cim_indicationsubscription",&st); - rv = CBInvokeMethod(_broker,ctx,sop,"_updateHandler",in,NULL,&st); + CBInvokeMethod(_broker,ctx,sop,"_updateHandler",in,NULL,&st); if (st.rc==CMPI_RC_OK) { st=InternalProviderModifyInstance(NULL,ctx,rslt,cop,ci,properties); } else { - rv=CBInvokeMethod(_broker,ctx,sop,"_removeHandler",in,NULL,NULL); + CBInvokeMethod(_broker,ctx,sop,"_removeHandler",in,NULL,NULL); } } @@ -504,7 +502,6 @@ IndCIMXMLHandlerDeleteInstance(CMPIInstanceMI * mi, CMPIArgs *in, *out = NULL; CMPIObjectPath *op; - CMPIData rv; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerDeleteInstance"); @@ -519,7 +516,7 @@ IndCIMXMLHandlerDeleteInstance(CMPIInstanceMI * mi, CMAddArg(in, "key", &cop, CMPI_ref); op = CMNewObjectPath(_broker, "root/interop", "cim_indicationsubscription", &st); - rv = CBInvokeMethod(_broker, ctx, op, "_removeHandler", in, out, &st); + CBInvokeMethod(_broker, ctx, op, "_removeHandler", in, out, &st); if (st.rc == CMPI_RC_OK) { st = InternalProviderDeleteInstance(NULL, ctx, rslt, cop); @@ -578,12 +575,11 @@ IndCIMXMLHandlerMethodCleanup(CMPIMethodMI * mi, * the target destination */ -CMPIStatus +int deliverInd(const CMPIObjectPath * ref, const CMPIArgs * in, CMPIInstance * ind) { _SFCB_ENTER(TRACE_INDPROVIDER, "deliverInd"); - CMPIInstance *hci, - *sub; + CMPIInstance *hci; CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIString *dest; char strId[64]; @@ -595,21 +591,16 @@ deliverInd(const CMPIObjectPath * ref, const CMPIArgs * in, CMPIInstance * ind) int rc = 0; if ((hci = internalProviderGetInstance(ref, &st)) == NULL) { - setStatus(&st, CMPI_RC_ERR_NOT_FOUND, NULL); - _SFCB_RETURN(st); + _SFCB_RETURN(1); } dest = CMGetProperty(hci, "destination", NULL).value.string; _SFCB_TRACE(1, ("--- destination: %s\n", (char *) dest->hdl)); - sub = CMGetArg(in, "subscription", NULL).value.inst; sprintf(strId, "%d", id++); xs = exportIndicationReq(ind, strId); sb = segments2stringBuffer(xs.segments); rc = exportIndication((char*)dest->hdl, (char*)sb->ft->getCharPtr(sb), &resp, &msg); - if (rc != 0) { - setStatus(&st,rc,NULL); - } RespSegment rs = xs.segments[5]; UtilStringBuffer *usb = (UtilStringBuffer *) rs.txt; CMRelease(usb); @@ -618,7 +609,7 @@ deliverInd(const CMPIObjectPath * ref, const CMPIArgs * in, CMPIInstance * ind) free(resp); if (msg) free(msg); - _SFCB_RETURN(st); + _SFCB_RETURN(rc); } // Retry queue element and control vars @@ -782,6 +773,7 @@ retryExport(void *lctx) sigaction(SIGUSR2, &sa, NULL); CMPIStatus st = { CMPI_RC_OK, NULL }; + int rc = 0; ctxLocal = prepareUpcall(ctx); @@ -841,11 +833,11 @@ retryExport(void *lctx) if(retryShutdown) break; // Provider shutdown pthread_mutex_lock(&RQlock); } - st = deliverInd(ref, in, iinst); - if ((st.rc == 0) || (cur->count >= maxcount - 1)) { + rc = deliverInd(ref, in, iinst); + if ((rc == 0) || (cur->count >= maxcount - 1)) { // either it worked, or we maxed out on retries // If it succeeded, clear the failtime - if (st.rc == 0) { + if (rc == 0) { _SFCB_TRACE(1,("--- Indication succeeded.")); sfc = 0; CMSetProperty(sub, "DeliveryFailureTime", &sfc, CMPI_uint64); @@ -985,6 +977,7 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIStatus circ = { CMPI_RC_OK, NULL }; + int drc = 0; struct timeval tv; struct timezone tz; static unsigned int indID=1; @@ -1056,9 +1049,9 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, } // Now send the indication - st = deliverInd(ref, in, ind); + drc = deliverInd(ref, in, ind); - switch (st.rc) { + switch (drc) { case 0: /* Success */ case 400: /* Bad Request XML */ case 501: /* Not Implemented */ diff --git a/internalProvider.c b/internalProvider.c index 039d363..a891842 100644 --- a/internalProvider.c +++ b/internalProvider.c @@ -183,7 +183,6 @@ InternalProviderEnumInstanceNames(CMPIInstanceMI * mi, *out; CMPIObjectPath *op; CMPIArray *ar; - CMPIData rv; _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderEnumInstanceNames"); _SFCB_TRACE(1, ("%s %s", nss, cns)); @@ -192,7 +191,7 @@ InternalProviderEnumInstanceNames(CMPIInstanceMI * mi, out = CMNewArgs(Broker, NULL); CMAddArg(in, "class", cns, CMPI_chars); op = CMNewObjectPath(Broker, nss, "$ClassProvider$", &sti); - rv = CBInvokeMethod(Broker, ctx, op, "getallchildren", in, out, &sti); + CBInvokeMethod(Broker, ctx, op, "getallchildren", in, out, &sti); ar = CMGetArg(out, "children", NULL).value.array; if (ar) ac = CMGetArrayCount(ar, NULL); @@ -254,7 +253,6 @@ enumInstances(CMPIInstanceMI * mi, *out; CMPIObjectPath *op; CMPIArray *ar; - CMPIData rv; _SFCB_ENTER(TRACE_INTERNALPROVIDER, "enumInstances"); _SFCB_TRACE(1, ("--- %s %s", nss, cns)); @@ -268,7 +266,7 @@ enumInstances(CMPIInstanceMI * mi, op = CMNewObjectPath(Broker, nss, "$ClassProvider$", &sti); _SFCB_TRACE(1, ("--- getallchildren")); - rv = CBInvokeMethod(Broker, ctx, op, "getallchildren", in, out, &sti); + CBInvokeMethod(Broker, ctx, op, "getallchildren", in, out, &sti); _SFCB_TRACE(1, ("--- getallchildren rc: %d", sti.rc)); ar = CMGetArg(out, "children", NULL).value.array; @@ -628,12 +626,11 @@ getRefs(const CMPIContext *ctx, const CMPIResult *rslt, } else { - CMPIData rv; CMPIObjectPath *op = CMNewObjectPath(Broker, ns, "$ClassProvider$", &st); CMPIArgs *in = CMNewArgs(Broker, NULL); CMPIArgs *out = CMNewArgs(Broker, NULL); - rv = CBInvokeMethod(Broker, ctx, op, "getassocs", in, out, &st); + CBInvokeMethod(Broker, ctx, op, "getassocs", in, out, &st); if (out) { int i, m; diff --git a/interopProvider.c b/interopProvider.c index 771d36e..fca1c36 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -911,9 +911,7 @@ initInterOp(const CMPIBroker * broker, const CMPIContext *ctx) CMPIStatus st; while (enm->ft->hasNext(enm, &st) && (ci = (enm->ft->getNext(enm, &st)).value.inst)) { - CMPIObjectPath *hop; cop = CMGetObjectPath(ci, &st); - hop = CMGetKey(cop, "handler", NULL).value.ref; st = processSubscription(broker,ctx,ci,cop); /* if the on-disk repo is modified between startups, it is possible for a subscription instance to exist w/o a filter or diff --git a/msgqueue.c b/msgqueue.c index 1ea77d5..adbcf43 100644 --- a/msgqueue.c +++ b/msgqueue.c @@ -716,7 +716,6 @@ stopLocalConnectServer() static struct sockaddr_un *serverAddr; int sock, size = 0; - unsigned long int l; char *path; if (getControlChars("localSocketPath", &path) != 0) { @@ -740,7 +739,7 @@ stopLocalConnectServer() return; } - l = write(sock, &size, sizeof(size)); + write(sock, &size, sizeof(size)); close(sock); } diff --git a/objectImpl.c b/objectImpl.c index 315d4a5..37d10a1 100644 --- a/objectImpl.c +++ b/objectImpl.c @@ -1218,12 +1218,8 @@ copyParameters(int ofs, int max, char *to, ClSection * ts, static void freeParameters(ClObjectHdr * hdr, ClSection * s) { - ClParameter *p; - _SFCB_ENTER(TRACE_OBJECTIMPL, "freeParameters"); - p = (ClParameter *) ClObjectGetClSection(hdr, s); - if (isMallocedSection(s)) free(s->sectionPtr); diff --git a/predicate.c b/predicate.c index 261d6bd..89e46b8 100644 --- a/predicate.c +++ b/predicate.c @@ -70,15 +70,14 @@ __eft_getData(const CMPIPredicate *pred, CMPIType *type, if (op) { if (op->opr == QL_bin) { - QLOpd type = QL_Invalid; if (op->lhon) o = op->lhon; else o = op->rhon; if (o->lhod && o->lhod->type != QL_PropertyName) - type = o->lhod->type; + *type = (o->lhod->type < 0) ? CMPI_null : (CMPIType)o->lhod->type; else if (o->rhod && o->rhod->type != QL_PropertyName) - type = o->rhod->type; + *type = (o->rhod->type < 0) ? CMPI_null : (CMPIType)o->rhod->type; if (opc) *opc = o->opr; if (lhs) { diff --git a/providerDrv.c b/providerDrv.c index edd68a5..fdec3c8 100644 --- a/providerDrv.c +++ b/providerDrv.c @@ -318,7 +318,6 @@ int testStartedProc(int pid, int *left) { ProviderProcess *pp = provProc; - ProviderInfo *info; int i, stopped = 0; @@ -327,7 +326,6 @@ testStartedProc(int pid, int *left) if ((pp + i)->pid == pid) { stopped = 1; (pp + i)->pid = 0; - info = (pp + i)->firstProv; if (pReg) pReg->ft->resetProvider(pReg, pid); } @@ -1550,7 +1548,7 @@ enumClasses(BinRequestHdr * hdr, ProviderInfo * info, int requestor) CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; - CMPIArray *r; + // CMPIArray *r; CMPIResult *result = native_new_CMPIResult(requestor < 0 ? 0 : requestor, 0, NULL); CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED, info); @@ -1572,7 +1570,8 @@ enumClasses(BinRequestHdr * hdr, ProviderInfo * info, int requestor) rci = info->classMI->ft->enumClasses(info->classMI, ctx, result, path); TIMING_STOP(hdr, info) - r = native_result2array(result); + //need to release ignored return value? + // native_result2array(result); _SFCB_TRACE(1, ("--- Back from provider rc: %d", rci.rc)); @@ -2141,7 +2140,6 @@ modifyInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor) CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0, 1, NULL); CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED, info); - CMPICount count; BinResponseHdr *resp; CMPIFlags flgs = 0; char **props = NULL; @@ -2170,7 +2168,6 @@ modifyInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor) _SFCB_TRACE(1, ("--- Back from provider rc: %d", rci.rc)); if (rci.rc == CMPI_RC_OK) { - count = 1; resp = (BinResponseHdr *) calloc(1, sizeof(BinResponseHdr) - diff --git a/providerMgr.c b/providerMgr.c index ade1098..519594a 100644 --- a/providerMgr.c +++ b/providerMgr.c @@ -985,8 +985,6 @@ processProviderMgrRequests() unsigned long rl; int rc, options = 0; - char *cn, - *ns; MqgStat mqg; _SFCB_ENTER(TRACE_PROVIDERMGR, "processProviderMgrRequests"); @@ -1037,8 +1035,6 @@ processProviderMgrRequests() (void *) ((long) req->className.data + (char *) req); else req->className.data = NULL; - cn = (char *) req->className.data; - ns = (char *) req->nameSpace.data; options = req->options; _SFCB_TRACE(1, @@ -1812,7 +1808,6 @@ _getConstClassChildren(const char *ns, const char *cn) OperationHdr req = { OPS_InvokeMethod, 1 }; CMPIArgs *in = NewCMPIArgs(NULL); CMPIArgs *out = NULL; - CMPIData data; CMPIArray *ar = NULL; CMPIStatus rc; UtilList *ul = NULL; @@ -1830,8 +1825,7 @@ _getConstClassChildren(const char *ns, const char *cn) irc = _methProvider(&binCtx, &req); if (irc == MSG_X_PROVIDER) { - data = - localInvokeMethod(&binCtx, path, "getchildren", in, &out, &rc, 0); + localInvokeMethod(&binCtx, path, "getchildren", in, &out, &rc, 0); if (out) { ar = CMGetArg(out, "children", &rc).value.array; ul = UtilFactory->newList(NULL, NULL); @@ -1863,7 +1857,6 @@ _getAssocClassNames(const char *ns) OperationHdr req = { OPS_InvokeMethod, 1 }; CMPIArgs *in = NewCMPIArgs(NULL); CMPIArgs *out = NULL; - CMPIData data; CMPIArray *ar; CMPIStatus rc; UtilList *ul = NULL; @@ -1881,7 +1874,7 @@ _getAssocClassNames(const char *ns) irc = _methProvider(&binCtx, &req); if (irc == MSG_X_PROVIDER) { - data = localInvokeMethod(&binCtx, path, "getassocs", in, &out, &rc, 0); + localInvokeMethod(&binCtx, path, "getassocs", in, &out, &rc, 0); if (out) { ar = CMGetArg(out, "assocs", &rc).value.array; ul = UtilFactory->newList(NULL, NULL); diff --git a/queryOperation.h b/queryOperation.h index 0f72b73..98b6a13 100644 --- a/queryOperation.h +++ b/queryOperation.h @@ -52,21 +52,22 @@ typedef struct qlCollector QLCollector; extern void *qsAlloc(QLStatement * qs, unsigned int size); +/* use negative number to avoid collisions with CMPI types */ typedef enum qlOpd { - QL_Invalid, - QL_NotFound, - QL_Null, - QL_Integer, - QL_UInteger, - QL_Double, - QL_Boolean, - QL_Chars, - QL_Char, - QL_PropertyName, - QL_Name, - QL_Inst, - QL_Ref, - QL_DateTime, + QL_Invalid = -2, + QL_NotFound = -1, + QL_Null = CMPI_null, + QL_Integer = CMPI_SINT, + QL_UInteger = CMPI_UINT, + QL_Double = CMPI_real64, + QL_Boolean = CMPI_boolean, + QL_Chars = CMPI_chars, + QL_Char = CMPI_char16, + QL_PropertyName = CMPI_string, + QL_Name = CMPI_nameString, + QL_Inst = CMPI_instance, + QL_Ref = CMPI_ref, + QL_DateTime = CMPI_dateTime, } QLOpd; typedef enum qlFnc { diff --git a/queryParser.y b/queryParser.y index fc4635f..64d9359 100644 --- a/queryParser.y +++ b/queryParser.y @@ -75,7 +75,7 @@ extern int yylex(void *); extern void sfcQueryErr(char*,char*,char*); extern void yyError(char*); extern void yyerror(char*); -extern void sfcQueryError(char* s1); +extern void sfcQueryError(const char* s1); extern char * qsStrDup(QLStatement *qs, char *str); extern QLOperand* newNameQueryOperand(QLStatement *qs, char* val); @@ -467,7 +467,7 @@ functionArg builtInFunction : TOK_IDENTIFIER functionArg { - int fnc=QL_FNC_NoFunction; + int fnc __attribute__ ((unused)) =QL_FNC_NoFunction; if (QS->lang==QL_CQL) { if (strcasecmp($1,"classname")==0) fnc=QL_FNC_Classname; else if (strcasecmp($1,"namespacename")==0) fnc=QL_FNC_Namespacename; diff --git a/sfcBroker.c b/sfcBroker.c index 745191b..1d9f164 100644 --- a/sfcBroker.c +++ b/sfcBroker.c @@ -83,10 +83,6 @@ extern TraceId traceIds[]; extern unsigned long exFlags; static int startHttp = 0; -#ifdef HAVE_JDBC -static int startDbp = 1; -#endif - char *name; extern int collectStat; @@ -193,7 +189,7 @@ static void stopBroker(void *p) { struct timespec waitTime; - int rc,sa=0,sp=0, count = 0; + int sa=0,sp=0, count = 0; /* SF 3497096 bugzilla 77022 */ /* stopping is set to prevent other threads calling this routine */ @@ -234,7 +230,7 @@ stopBroker(void *p) fprintf(stderr, "--- Stopping adapters\n"); sa++; if (stopNextAdapter()) { - rc = pthread_cond_timedwait(&sdCnd, &sdMtx, &waitTime); + pthread_cond_timedwait(&sdCnd, &sdMtx, &waitTime); } else { /* * no adapters found @@ -253,7 +249,7 @@ stopBroker(void *p) fprintf(stderr, "--- Stopping providers\n"); sp++; if (stopNextProc()) { - rc = pthread_cond_timedwait(&sdCnd, &sdMtx, &waitTime); + pthread_cond_timedwait(&sdCnd, &sdMtx, &waitTime); } // else providersStopped=1; pthread_mutex_unlock(&sdMtx); @@ -398,7 +394,7 @@ handleSigUsr2(int sig) { #ifndef LOCAL_CONNECT_ONLY_ENABLE struct timespec waitTime; - int rc, sa=0; + int sa=0; inaHttpdRestart=1; while(!adaptersStopped) { @@ -408,7 +404,7 @@ handleSigUsr2(int sig) if (sa==0) fprintf(stderr,"--- Stopping http adapters\n"); sa++; if (stopNextAdapter()) { - rc=pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); + pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); } else { /* no adapters found */ @@ -442,12 +438,11 @@ handleSigSegv(int sig) static int startHttpd(int argc, char *argv[], int sslMode) { - int pid, - sfcPid = currentProc; + int pid; int httpSFCB, rc; char *httpUser; - uid_t httpuid; + uid_t httpuid = 0; struct passwd *passwd; // Get/check http user info @@ -514,35 +509,6 @@ startHttpd(int argc, char *argv[], int sslMode) #endif // LOCAL_CONNECT_ONLY_ENABLE -#ifdef HAVE_JDBC - -extern int dbpDaemon(int argc, char *argv[], int sslMode, - int sfcbPid); -static int -startDbpd(int argc, char *argv[], int sslMode) -{ - int pid, - sfcPid = currentProc; - // sleep(2); - pid = fork(); - if (pid < 0) { - perror("dbpd fork"); - exit(2); - } - if (pid == 0) { - currentProc = getpid(); - dbpDaemon(argc, argv, sslMode, sfcPid); - closeSocket(&sfcbSockets, cRcv, "startHttpd"); - closeSocket(&resultSockets, cAll, "startHttpd"); - } else { - addStartedAdapter(pid); - return 0; - } - return 0; -} - -#endif - static void usage(int status) { @@ -632,7 +598,6 @@ main(int argc, char *argv[]) i; long tmask = 0, //sslMode = 0, /* 3597805 */ - sslOMode = 0, tracelevel = 0; char *tracefile = NULL; #ifdef HAVE_UDS @@ -850,16 +815,10 @@ main(int argc, char *argv[]) enableHttps = 0; sslMode = enableHttps; -#ifdef HAVE_UDS - sslOMode = sslMode & !enableHttp & !enableUds; -#else - sslOMode = sslMode & !enableHttp; -#endif #else mlogf(M_INFO, M_SHOW, "--- SSL not configured\n"); enableHttps = 0; sslMode = 0; - sslOMode = 0; #endif if (getControlBool("useChunking", &useChunking)) @@ -1022,16 +981,6 @@ main(int argc, char *argv[]) #endif mlogf(M_INFO, M_SHOW, "--- Request handlers enabled:%s\n",rtmsg); -#ifdef HAVE_JDBC - // Start dbProtocol-Daemon - if (startDbp) { - if (sslMode) - startDbpd(argc, argv, 1); - if (!sslOMode) - startDbpd(argc, argv, 0); - } -#endif - setSignal(SIGSEGV, handleSigSegv, SA_ONESHOT); setSignal(SIGCHLD, handleSigChld, 0); setSignal(SIGUSR2, handleSigUsr2, 0); hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-10 20:11:58
|
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 b3e37b718ae13e86c203dec3f43c974d02efc476 (commit) from dcaeb6cb5c52d759b6a743171e8818ae7ae22a12 (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 b3e37b718ae13e86c203dec3f43c974d02efc476 Author: Michael Chase-Salerno <br...@li...> Date: Thu Jan 10 15:11:04 2013 -0500 3600159 TestProviders should have their own Makefile ----------------------------------------------------------------------- Summary of changes: diff --git a/test/TestProviders/Makefile.am b/test/TestProviders/Makefile.am new file mode 100644 index 0000000..3f7590d --- /dev/null +++ b/test/TestProviders/Makefile.am @@ -0,0 +1,53 @@ +# $Id: Makefile.am,v 1.105 2010/02/10 20:51:15 buccella Exp $ +# +# Makefile.am +# +# © Copyright IBM Corp. 2013 +# +# 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: Michael Chase-Salerno <br...@li...> +# Contributions: +# +# Description: +# +# Makefile process input for sfcb testProviders tests. +# +# + +libTestAssociationProvider_la_SOURCES = cmpiTestAssociationProvider.c +libTestAssociationProvider_la_LIBADD = -lsfcBrokerCore +libTestAssociationProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +libTestMethodProvider_la_SOURCES = cmpiTestMethodProvider.c +libTestMethodProvider_la_LIBADD = -lsfcBrokerCore +libTestMethodProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +libTestInstanceProvider_la_SOURCES = cmpiTestInstanceProvider.c +libTestInstanceProvider_la_LIBADD = -lsfcBrokerCore +libTestInstanceProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +libTestMiscProvider_la_SOURCES = cmpiTestMiscProvider.c +libTestMiscProvider_la_LIBADD = -lsfcBrokerCore +libTestMiscProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +libTestExecQueryProvider_la_SOURCES = cmpiTestExecQueryProvider.c +libTestExecQueryProvider_la_LIBADD = -lsfcBrokerCore +libTestExecQueryProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +libTestIndicationProvider_la_SOURCES = cmpiTestIndicationProvider.c +libTestIndicationProvider_la_LIBADD = -lsfcBrokerCore +libTestIndicationProvider_la_DEPENDENCIES=libsfcBrokerCore.la + +sfcblib_LTLIBRARIES += \ + libTestAssociationProvider.la \ + libTestMethodProvider.la \ + libTestInstanceProvider.la \ + libTestMiscProvider.la \ + libTestExecQueryProvider.la \ + libTestIndicationProvider.la hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-10 17:37:43
|
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 dcaeb6cb5c52d759b6a743171e8818ae7ae22a12 (commit) from abfe7e51f34c780e65b92d525517315a557fa55b (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 dcaeb6cb5c52d759b6a743171e8818ae7ae22a12 Author: Michael Chase-Salerno <br...@li...> Date: Thu Jan 10 12:25:53 2013 -0500 3600159 TestProviders should have their own Makefile ----------------------------------------------------------------------- Summary of changes: diff --git a/Makefile.am b/Makefile.am index c244030..fac9c87 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,16 +149,6 @@ sfcblib_LTLIBRARIES = \ $(SFC_CUSTOM_LIB) \ $(ACCOUNT_PASSTHRU_LIBS) -if TEST_ENABLED -sfcblib_LTLIBRARIES += \ - libTestAssociationProvider.la \ - libTestMethodProvider.la \ - libTestInstanceProvider.la \ - libTestMiscProvider.la \ - libTestExecQueryProvider.la \ - libTestIndicationProvider.la -endif - sbin_PROGRAMS = \ sfcbd @@ -317,39 +307,6 @@ libsfcClassProviderMem_la_SOURCES = \ libsfcClassProviderMem_la_LIBADD=-lsfcBrokerCore libsfcClassProviderMem_la_DEPENDENCIES=libsfcBrokerCore.la -# Building providers in the test/TestProviders directory -if TEST_ENABLED -libTestAssociationProvider_la_SOURCES = \ - test/TestProviders/cmpiTestAssociationProvider.c -libTestAssociationProvider_la_LIBADD = -lsfcBrokerCore -libTestAssociationProvider_la_DEPENDENCIES=libsfcBrokerCore.la - -libTestMethodProvider_la_SOURCES = \ - test/TestProviders/cmpiTestMethodProvider.c -libTestMethodProvider_la_LIBADD = -lsfcBrokerCore -libTestMethodProvider_la_DEPENDENCIES=libsfcBrokerCore.la - -libTestInstanceProvider_la_SOURCES = \ - test/TestProviders/cmpiTestInstanceProvider.c -libTestInstanceProvider_la_LIBADD = -lsfcBrokerCore -libTestInstanceProvider_la_DEPENDENCIES=libsfcBrokerCore.la - -libTestMiscProvider_la_SOURCES = \ - test/TestProviders/cmpiTestMiscProvider.c -libTestMiscProvider_la_LIBADD = -lsfcBrokerCore -libTestMiscProvider_la_DEPENDENCIES=libsfcBrokerCore.la - -libTestExecQueryProvider_la_SOURCES = \ - test/TestProviders/cmpiTestExecQueryProvider.c -libTestExecQueryProvider_la_LIBADD = -lsfcBrokerCore -libTestExecQueryProvider_la_DEPENDENCIES=libsfcBrokerCore.la - -libTestIndicationProvider_la_SOURCES = \ - test/TestProviders/cmpiTestIndicationProvider.c -libTestIndicationProvider_la_LIBADD = -lsfcBrokerCore -libTestIndicationProvider_la_DEPENDENCIES=libsfcBrokerCore.la -endif - # if we enable CIMrs requests, then compile in the CIMrs # request processor if CIMRS hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2013-01-09 18:16:01
|
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 abfe7e51f34c780e65b92d525517315a557fa55b (commit) from 8fa527ba5807999599178f7c0e660df315d5a283 (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 abfe7e51f34c780e65b92d525517315a557fa55b Author: Michael Chase-Salerno <br...@li...> Date: Wed Jan 9 13:15:10 2013 -0500 3600125 Share client tracing shm segment ----------------------------------------------------------------------- Summary of changes: diff --git a/NEWS b/NEWS index 9d92c6b..b6d4eab 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ New features: Bugs fixed: - 3599526 segfault during ecn with classProviderSf - 3599329 dlopen failed for sfcbCustomLib +- 3600125 Share client tracing shm segment Changes in 1.4.3 ================ diff --git a/trace.c b/trace.c index 6a0cea7..95191a0 100644 --- a/trace.c +++ b/trace.c @@ -58,7 +58,7 @@ unsigned long _sfcb_trace_mask = 0; /* use pointer indirect _sfcb_trace_mask to allow shared memory flag */ unsigned long *_ptr_sfcb_trace_mask = &_sfcb_trace_mask; void *vpDP = NULL; -int shmid; +int shmid=0; char *_SFCB_TRACE_FILE = NULL; int _SFCB_TRACE_TO_SYSLOG = 0; @@ -129,8 +129,9 @@ _sfcb_trace_init() char *err = NULL; FILE *ferr = NULL; int tryid = 0xDEB001; - - while ((shmid = shmget(tryid, sizeof(unsigned long), (IPC_EXCL | IPC_CREAT | 0660))) < 0 && (errno == EEXIST)) tryid++; + if (shmid == 0) { + while ((shmid = shmget(tryid, sizeof(unsigned long), (IPC_EXCL | IPC_CREAT | 0660))) < 0 && (errno == EEXIST)) tryid++; + } mlogf(M_INFO,M_SHOW,"--- Shared memory ID for tracing: %x\n", tryid); if (shmid < 0) { mlogf(M_ERROR,M_SHOW, "shmget(%x) failed in %s at line %d.\n", tryid, __FILE__, __LINE__ ); hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave H. <hel...@us...> - 2013-01-09 00:02:19
|
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_1.3 has been updated via 47b55037ce7513f90db8da85ca29eb26344e905c (commit) from dd9304f041e14c7704c9c2961497c6c79192e325 (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 47b55037ce7513f90db8da85ca29eb26344e905c Author: Dave Heller <hel...@us...> Date: Tue Jan 8 18:55:18 2013 -0500 [ 3597805 ] Restart HTTP daemon without restarting SFCB ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 7c59263..6e95fe2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-01-08 Dave Heller <hel...@us...> + + * cimXmlRequest.c httpAdapter.c mlog.c msgqueue.c providerDrv.c + sfcBroker.c + [ 3597805 ] Restart HTTP daemon without restarting SFCB + 2013-01-07 Dave Heller <hel...@us...> * support.c diff --git a/NEWS b/NEWS index b7e9fc1..d75c182 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ Changes in 1.3.17 ================= New features: +- 3597805 Restart HTTP daemon without restarting SFCB Bugs fixed: - 3599329 dlopen failed for sfcbCustomLib diff --git a/cimXmlRequest.c b/cimXmlRequest.c index 6ea0100..57a9180 100644 --- a/cimXmlRequest.c +++ b/cimXmlRequest.c @@ -52,10 +52,12 @@ #define SFCB_ASM(x) #endif +#ifdef NEEDS_CLEANUP #ifdef LOCAL_CONNECT_ONLY_ENABLE // from httpAdapter.c int chunkMode = CHUNK_NEVER; #endif // LOCAL_CONNECT_ONLY_ENABLE +#endif typedef struct handler { RespSegments(*handler) (CimXmlRequestContext *, RequestHdr * hdr); diff --git a/httpAdapter.c b/httpAdapter.c index d63cd8f..7b28435 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -1498,7 +1498,6 @@ getSocket() return fd; } - #ifdef USE_INET6 static struct sockaddr * prepSockAddr6(int port, void *ssin, socklen_t * sin_len) @@ -1527,7 +1526,7 @@ prepSockAddr4(int port, void *ssin, socklen_t * sin_len) *sin_len = sizeof(*sin); memset(sin, 0, *sin_len); - + sin->sin_family = AF_INET; if (httpLocalOnly) { const char *loopback_int = "127.0.0.1"; @@ -1539,7 +1538,6 @@ prepSockAddr4(int port, void *ssin, socklen_t * sin_len) return (struct sockaddr *) sin; } - static int bindToPort(int sock, int port, void *ssin, socklen_t * sin_len) { @@ -1551,20 +1549,48 @@ bindToPort(int sock, int port, void *ssin, socklen_t * sin_len) if (getControlBool("httpLocalOnly", &httpLocalOnly)) httpLocalOnly = 0; + char *ip = httpLocalOnly ? "127.0.0.1" : "0.0.0.0"; + #ifdef USE_INET6 - if (!fallback_ipv4) - sin = prepSockAddr6(port, ssin, sin_len); + if (!fallback_ipv4) { + ip = httpLocalOnly ? "[::1]" : "[::]"; + if (!(sin = prepSockAddr6(port, ssin, sin_len))) + return 1; + } else #endif - sin = prepSockAddr4(port, ssin, sin_len); + if (!(sin = prepSockAddr4(port, ssin, sin_len))) + return 1; - if (bind(sock, sin, *sin_len) || listen(sock, 10)) { - mlogf(M_ERROR, M_SHOW, "--- Cannot listen on port %ld (%s)\n", port, + int maxtries = 5; + int i = maxtries; + while (1) { + if (!bind(sock, sin, *sin_len)) { + if (!listen(sock, 10)) { + break; + } else { + mlogf(M_ERROR, M_SHOW, "--- Cannot listen on socket %s:%d (%s)\n", + ip, port, strerror(errno)); + return 1; + } + } else if (errno==EADDRINUSE) { + if (--i <= 0) { + mlogf(M_ERROR, M_SHOW, + "--- Cannot bind to socket %s:%d after %d attempts. (%s)\n", + ip, port, maxtries, strerror(errno)); + return 1; + } + mlogf(M_ERROR, M_SHOW, + "--- Socket %s:%d not ready (%s), retrying...\n", ip, port, strerror(errno)); - sleep(1); - return 1; + sleep(1); + } else { + mlogf(M_ERROR, M_SHOW, "--- Cannot bind to socket %s:%d (%s)\n", + ip, port, strerror(errno)); + return 1; + } } - + mlogf(M_ERROR, M_SHOW, "--- Listening on socket %s:%d\n", ip, port); return 0; } @@ -1908,7 +1934,7 @@ int httpDaemon(int argc, char *argv[], int sslMode, int sfcbPid) } #endif - int bindrc = 0; + int bindrc = 0; if (enableHttp) { bindrc = bindToPort(httpListenFd, httpPort, &httpSin, &httpSin_len); } @@ -1926,8 +1952,7 @@ int httpDaemon(int argc, char *argv[], int sslMode, int sfcbPid) #endif if (bindrc > 0) - return 1; /* if can't bind to port, return 1 to - * shutdown sfcb */ + return 1; /* if can't bind to port, return 1 */ if (!debug) { int rc = fork(); @@ -1946,6 +1971,7 @@ int httpDaemon(int argc, char *argv[], int sslMode, int sfcbPid) setSignal(SIGINT, SIG_IGN, 0); setSignal(SIGTERM, SIG_IGN, 0); setSignal(SIGHUP, SIG_IGN, 0); + setSignal(SIGUSR2, SIG_IGN, 0); #if defined USE_SSL if (sslMode) { diff --git a/mlog.c b/mlog.c index 8fb78b2..a44f865 100644 --- a/mlog.c +++ b/mlog.c @@ -109,6 +109,7 @@ void startLogging(int level, int thread) { setSignal(SIGINT, SIG_IGN, 0); setSignal(SIGTERM, SIG_IGN, 0); setSignal(SIGHUP, SIG_IGN, 0); + setSignal(SIGUSR2, SIG_IGN, 0); runLogger(logfds[0], level); diff --git a/msgqueue.c b/msgqueue.c index 825562d..003b44a 100644 --- a/msgqueue.c +++ b/msgqueue.c @@ -633,12 +633,12 @@ void closeSocket(ComSockets *sp, ComCloseOpt o,char *by) _SFCB_ENTER(TRACE_MSGQUEUE | TRACE_SOCKETS, "closeSocket"); if ((o==cRcv || o==cAll) && sp->receive!=0) { - _SFCB_TRACE(1,("--- %s closing: %d - %d %d\n",by,sp->receive,getInode(sp->receive),currentProc)); + _SFCB_TRACE(1,("--- %s closing: %d - %d %d",by,sp->receive,getInode(sp->receive),currentProc)); close (sp->receive); sp->receive=0; } if ((o==cSnd || o==cAll) && sp->send!=0) { - _SFCB_TRACE(1,("--- %s closing: %d - %d %d\n",by,sp->send,getInode(sp->send),currentProc)); + _SFCB_TRACE(1,("--- %s closing: %d - %d %d",by,sp->send,getInode(sp->send),currentProc)); close (sp->send); sp->send=0; } diff --git a/providerDrv.c b/providerDrv.c index a072454..4e6b5b6 100644 --- a/providerDrv.c +++ b/providerDrv.c @@ -809,6 +809,7 @@ static int getProcess(ProviderInfo * info, ProviderProcess ** proc) setSignal(SIGHUP, SIG_IGN,0); setSignal(SIGPIPE, handleSigPipe,0); setSignal(SIGUSR1, handleSigUsr1,0); + setSignal(SIGUSR2, SIG_IGN,0); setSignal(SIGSEGV, handleSigSegv,SA_ONESHOT); diff --git a/sfcBroker.c b/sfcBroker.c index 8e555d6..7bb5bb7 100644 --- a/sfcBroker.c +++ b/sfcBroker.c @@ -102,6 +102,10 @@ extern void dumpTiming(int pid); static char **restartArgv; static int restartArgc; static int adaptersStopped=0,providersStopped=0,restartBroker=0; +static int inaHttpdRestart=0; + +long sslMode=0; +static int startHttpd(int argc, char *argv[], int sslMode); int trimws=1; @@ -217,9 +221,10 @@ static void stopBroker(void *p) rc=pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); } else { - /* no adapters found */ - adaptersStopped=1; - } + fprintf(stderr,"-- All adapters stopped.\n"); + /* no adapters found */ + adaptersStopped=1; + } pthread_mutex_unlock(&sdMtx); } @@ -343,6 +348,7 @@ static void handleSigChld(int sig) if (left==0) { fprintf(stderr,"--- Adapters stopped\n"); adaptersStopped=1; + if (!stopping && !inaHttpdRestart) kill(getpid(),SIGQUIT); } pthread_attr_init(&tattr); pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); @@ -362,6 +368,37 @@ static void handleSigChld(int sig) errno = oerrno; } +static void handleSigUsr2(int sig) +{ +#ifndef LOCAL_CONNECT_ONLY_ENABLE + struct timespec waitTime; + int rc, sa=0; + + inaHttpdRestart=1; + while(!adaptersStopped) { + pthread_mutex_lock(&sdMtx); + waitTime.tv_sec=time(NULL)+1; //5 + waitTime.tv_nsec=0; + if (sa==0) fprintf(stderr,"--- Stopping http adapters\n"); + sa++; + if (stopNextAdapter()) { + rc=pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); + } + else { + /* no adapters found */ + fprintf(stderr,"--- All http adapters stopped.\n"); + adaptersStopped=1; + } + pthread_mutex_unlock(&sdMtx); + } + + fprintf(stderr,"--- Restarting http adapters...\n"); + startHttpd(restartArgc, restartArgv, sslMode); + adaptersStopped=0; + inaHttpdRestart=0; +#endif // LOCAL_CONNECT_ONLY_ENABLE +} + #ifdef NEEDS_CLEANUP static void handleSigterm(int sig) { @@ -423,32 +460,32 @@ static int startHttpd(int argc, char *argv[], int sslMode) } } - pid= fork(); + pid = fork(); if (pid < 0) { - char *emsg=strerror(errno); - mlogf(M_ERROR,M_SHOW, "-#- http fork: %s",emsg); - exit(2); + char *emsg = strerror(errno); + mlogf(M_ERROR, M_SHOW, "-#- http fork: %s", emsg); + exit(2); } if (pid == 0) { - currentProc=getpid(); - if (!httpSFCB) { - // Set the real and effective uids - rc=setreuid(httpuid,httpuid); - if (rc == -1) { - mlogf(M_ERROR,M_SHOW,"--- Changing uid for http failed.\n"); - exit(2); - } - } - - if (httpDaemon(argc, argv, sslMode)) { - kill(sfcPid, 3); /* if port in use, shutdown */ - } - closeSocket(&sfcbSockets,cRcv,"startHttpd"); - closeSocket(&resultSockets,cAll,"startHttpd"); + currentProc = getpid(); + if (!httpSFCB) { + // Set the real and effective uids + rc = setreuid(httpuid, httpuid); + if (rc == -1) { + mlogf(M_ERROR, M_SHOW, "--- Changing uid for http failed.\n"); + exit(2); + } + } + if (httpDaemon(argc, argv, sslMode)) { + //kill(sfcPid, 3); /* if port in use, shutdown */ + /* (don't do this anymore - xxxxxxx) */ + } + closeSocket(&sfcbSockets,cRcv,"startHttpd"); + closeSocket(&resultSockets,cAll,"startHttpd"); + exit(0); } else { - addStartedAdapter(pid); - return 0; + addStartedAdapter(pid); } return 0; } @@ -564,7 +601,7 @@ static void version() int main(int argc, char *argv[]) { int c, i; - long tmask = 0, sslMode=0,sslOMode=0, tracelevel=0; + long tmask = 0, sslOMode=0, tracelevel=0; char * tracefile = NULL; #ifdef HAVE_UDS int enableUds=0; @@ -603,7 +640,7 @@ int main(int argc, char *argv[]) { "syslog-level", required_argument, 0, 'l' }, { "trace-components", required_argument, 0, 't' }, { "version", no_argument, 0, 'v' }, - { "disable-repository-default-inst-provider", no_argument, 0, 'i' }, + { "disable-repository-default-inst-provider", no_argument, 0, 'i' }, { 0, 0, 0, 0 } }; @@ -651,9 +688,9 @@ int main(int argc, char *argv[]) case 'v': version(); - case 'i': - disableDefaultProvider=1; - break; + case 'i': + disableDefaultProvider=1; + break; case 'l': if (strcmp(optarg,"LOG_ERR")==0) { @@ -830,7 +867,7 @@ int main(int argc, char *argv[]) exit(1); } - + initSem(dSockets,sSockets,pSockets); initProvProcCtl(pSockets); init_sfcBroker(); @@ -838,7 +875,6 @@ int main(int argc, char *argv[]) setSignal(SIGQUIT, handleSigquit,0); setSignal(SIGINT, handleSigquit,0); - setSignal(SIGTERM, handleSigquit,0); setSignal(SIGHUP, handleSigHup,0); @@ -865,6 +901,7 @@ int main(int argc, char *argv[]) setSignal(SIGSEGV, handleSigSegv,SA_ONESHOT); setSignal(SIGCHLD, handleSigChld,0); + setSignal(SIGUSR2, handleSigUsr2,0); processProviderMgrRequests(); hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave H. <hel...@us...> - 2013-01-08 16:25:54
|
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_1.3 has been updated via dd9304f041e14c7704c9c2961497c6c79192e325 (commit) from a0c2813d36260a59080529950524a57787ff3635 (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 dd9304f041e14c7704c9c2961497c6c79192e325 Author: Dave Heller <hel...@us...> Date: Tue Jan 8 09:22:41 2013 -0500 [ 3599329 ] dlopen failed for sfcbCustomLib ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 1ba5665..7c59263 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-07 Dave Heller <hel...@us...> + + * support.c + [ 3599329 ] dlopen failed for sfcbCustomLib + 2012-12-12 Chris Buccella <buc...@li...> * cimXmlGen.c, cimXmlParser.c, cimXmlParser.h, cimXmlRequest.c, diff --git a/NEWS b/NEWS index d9f698d..b7e9fc1 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ Changes in 1.3.17 New features: Bugs fixed: - +- 3599329 dlopen failed for sfcbCustomLib Changes in 1.3.16 ================= diff --git a/contributions.txt b/contributions.txt index 1ebbce4..67a53a1 100644 --- a/contributions.txt +++ b/contributions.txt @@ -116,6 +116,7 @@ Klaus Kampf, Novell 09/30/2011 [ 3416055 ] SIGSEGV sometimes does not print provider name 03/29/2012 [ 3441028 ] sblim-sfcb fails on large https requests 03/29/2012 [ 3416054 ] Provider continues despite SIGSEGV +01/05/2013 [ 3599329 ] dlopen failed for sfcbCustomLib Mike Brasher, Inova ------------------- diff --git a/support.c b/support.c index bab79f0..cdda9fb 100644 --- a/support.c +++ b/support.c @@ -1,6 +1,6 @@ /* - * $Id: support.c,v 1.42 2012/07/19 17:21:22 mchasal Exp $ + * $Id: support.c,v 1.43 2013/01/07 15:55:17 hellerda Exp $ * * © Copyright IBM Corp. 2005, 2007 * @@ -1039,38 +1039,43 @@ int loadHostnameLib() hostnameLib = NULL; if (getControlChars("sfcbCustomLib", &ln) == 0) { - libraryName(NULL, ln, dlName, 512); - if ((hostnameLib = dlopen(dlName, RTLD_LAZY))) { - dlerror(); - sfcbHostname = dlsym(hostnameLib, "_sfcbGetResponseHostname"); - if ((err = dlerror()) != NULL) { - printf("dlsym failed for _sfcbGetResponseHostname: %s\n", err); - dlclose(hostnameLib); - return -1; - } - dlerror(); - sfcbSlpHostname = dlsym(hostnameLib, "_sfcGetSlpHostname"); - if ((err = dlerror()) != NULL) { - printf("dlsym failed for _sfcbGetSlpHostname: %s\n", err); - dlclose(hostnameLib); - return -1; - } - dlerror(); - indAuditLog = dlsym(hostnameLib, "_sfcbIndAuditLog"); - if ((err = dlerror()) != NULL) { - printf("dlsym failed for _sfcbIndAuditLog: %s\n", err); - dlclose(hostnameLib); - return -1; - } - } - else { - printf("dlopen failed for sfcbCustomLib\n"); - return -1; - } + libraryName(NULL, ln, dlName, 512); + hostnameLib = dlopen(dlName, RTLD_LAZY); + if (!hostnameLib) { + libraryName(SFCB_LIBDIR, ln, dlName, 512); + hostnameLib = dlopen(dlName, RTLD_LAZY); + } + if (hostnameLib) { + dlerror(); + sfcbHostname = dlsym(hostnameLib, "_sfcbGetResponseHostname"); + if ((err = dlerror()) != NULL) { + printf("dlsym failed for _sfcbGetResponseHostname: %s\n", err); + dlclose(hostnameLib); + return -1; + } + dlerror(); + sfcbSlpHostname = dlsym(hostnameLib, "_sfcGetSlpHostname"); + if ((err = dlerror()) != NULL) { + printf("dlsym failed for _sfcbGetSlpHostname: %s\n", err); + dlclose(hostnameLib); + return -1; + } + dlerror(); + indAuditLog = dlsym(hostnameLib, "_sfcbIndAuditLog"); + if ((err = dlerror()) != NULL) { + printf("dlsym failed for _sfcbIndAuditLog: %s\n", err); + dlclose(hostnameLib); + return -1; + } + } + else { + printf("dlopen failed for sfcbCustomLib\n"); + return -1; + } } else { - printf("Cannot find the libary to open: %s\n", ln); - return -1; + printf("Cannot find the libary to open: %s\n", ln); + return -1; } return 0; hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Chris B. <buc...@us...> - 2013-01-07 21:49:37
|
Update of /cvsroot/sblim/sfcc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30196 Modified Files: ChangeLog NEWS Added Files: NOTICE Log Message: documented move to the git repository Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcc/NEWS,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- NEWS 14 Sep 2012 01:25:08 -0000 1.59 +++ NEWS 7 Jan 2013 21:49:35 -0000 1.60 @@ -1,3 +1,7 @@ +NO MORE UPDATES HERE! +SFCC repository has moved to git. + + Small Footprint CIM Client Library NEWS Changes in 2.2.2 --- NEW FILE: NOTICE --- SFCB's code repository has moved! The code here in CVS is no longer up-to-date. The new location is: http://sblim.git.sourceforge.net/git/gitweb.cgi?p=sblim/sfcb Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcc/ChangeLog,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- ChangeLog 14 Sep 2012 01:25:08 -0000 1.62 +++ ChangeLog 7 Jan 2013 21:49:35 -0000 1.63 @@ -1,3 +1,6 @@ +NO MORE UPDATES HERE! +SFCC repository has moved to git. + 2012-09-13 Dave Heller <hel...@us...> * backend/cimxml/cimXmlParser.c: |
From: Chris B. <buc...@us...> - 2013-01-07 18:27:50
|
Update of /cvsroot/sblim/sfcb In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15783 Modified Files: ChangeLog NEWS Added Files: NOTICE Log Message: documented move to the git repository Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.730 retrieving revision 1.731 diff -u -d -r1.730 -r1.731 --- NEWS 7 Jan 2013 15:55:17 -0000 1.730 +++ NEWS 7 Jan 2013 18:27:48 -0000 1.731 @@ -1,3 +1,6 @@ +NO MORE UPDATES HERE! +SFCB repository has moved to git. + Changes in 1.3.17 ================= New features: --- NEW FILE: NOTICE --- SFCB's code repository has moved! The code here in CVS is no longer up-to-date. The new location is: http://sblim.git.sourceforge.net/git/gitweb.cgi?p=sblim/sfcb Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.814 retrieving revision 1.815 diff -u -d -r1.814 -r1.815 --- ChangeLog 7 Jan 2013 15:55:17 -0000 1.814 +++ ChangeLog 7 Jan 2013 18:27:48 -0000 1.815 @@ -1,3 +1,6 @@ +NO MORE UPDATES HERE! +SFCB repository has moved to git. + 2013-01-07 Dave Heller <hel...@us...> * support.c |