From: Dave H. <hel...@us...> - 2013-12-28 17:28:53
|
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 405966f68966311083f66e5a974d2535390cfdb5 (commit) from 838013f2bffc67de3fa2ffd8cae891c14c5c1f76 (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 405966f68966311083f66e5a974d2535390cfdb5 Author: Dave Heller <hel...@us...> Date: Sat Dec 28 12:28:30 2013 -0500 [sfcb-tix:#90] Problems with enableInteroOp=false ----------------------------------------------------------------------- Summary of changes: classProviderGz.c | 8 ++++++++ classProviderSf.c | 8 ++++++++ providerMgr.c | 43 +++++++++++++++++++++++++++++++++---------- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/classProviderGz.c b/classProviderGz.c index eb17c36..84b2f58 100644 --- a/classProviderGz.c +++ b/classProviderGz.c @@ -101,6 +101,8 @@ int traverseChildren(ClassRegister * cReg, const char *parent, static int nsBaseLen; +extern unsigned long exFlags; + static void buildInheritanceTable(ClassRegister * cr) { @@ -458,6 +460,12 @@ gatherNameSpaces(char *dn, UtilHashTable * ns, int first) continue; if (strcmp(de->d_name, "..") == 0) continue; + if (!(exFlags & 2)) { + /* enforce enableInterOp = false [sfcb#90] */ + if (strncmp(de->d_name, "interop", 7) == 0) { + continue; + } + } l = strlen(dn) + strlen(de->d_name) + 4; n = malloc(l + 8); strcpy(n, dn); diff --git a/classProviderSf.c b/classProviderSf.c index 8e69599..9b0de41 100644 --- a/classProviderSf.c +++ b/classProviderSf.c @@ -128,6 +128,8 @@ int traverseChildren(ClassRegister * cReg, const char *parent, static int nsBaseLen; +extern unsigned long exFlags; + static void buildInheritanceTable(ClassRegister * cr) { @@ -480,6 +482,12 @@ gatherNameSpaces(char *dn, UtilHashTable * ns, int first) continue; if (strcmp(de->d_name, "..") == 0) continue; + if (!(exFlags & 2)) { + /* enforce enableInterOp = false [sfcb#90] */ + if (strncmp(de->d_name, "interop", 7) == 0) { + continue; + } + } l = strlen(dn) + strlen(de->d_name) + 4; n = malloc(l + 8); strcpy(n, dn); diff --git a/providerMgr.c b/providerMgr.c index 085eeb1..6aa1486 100644 --- a/providerMgr.c +++ b/providerMgr.c @@ -198,6 +198,15 @@ lookupProvider(long type, char *className, char *nameSpace, CMPIStatus *st) ProviderInfo *info; UtilHashTable **ht = provHt(type, 0); + /* enforce enableInterOp = false [sfcb#90] */ + if (!(exFlags & 2)) { + if (strcasecmp(nameSpace, "root/interop") == 0) { + st->msg = sfcb_native_new_CMPIString("Interop namespace disabled",NULL,0); + st->rc = CMPI_RC_ERR_INVALID_NAMESPACE; + _SFCB_RETURN(NULL); + } + } + if (*ht == NULL) { *ht = UtilFactory->newHashTable(61, UtilHashTable_charKey | @@ -1007,27 +1016,41 @@ processProviderMgrRequests() sigfillset(&mask); sigprocmask(SIG_SETMASK, &mask, &old_mask); - rc=startUpProvider("root/interop", "$ClassProvider$",0); - if (rc != 0 ) { - mlogf(M_ERROR,M_SHOW,"--- ClassProvider failed to start, rc:%d\n",rc); - sigprocmask(SIG_SETMASK, &old_mask, NULL); - _SFCB_RETURN(); + /* enforce enableInterOp = false [sfcb#90] */ + if (exFlags & 2) { + rc=startUpProvider("root/interop", "$ClassProvider$",0); + if (rc != 0 ) { + mlogf(M_ERROR,M_SHOW,"--- ClassProvider failed to start, rc:%d\n",rc); + sigprocmask(SIG_SETMASK, &old_mask, NULL); + _SFCB_RETURN(); + } + + /* wait until classProvider is finished init'ing */ + semAcquire(sfcbSem,INIT_CLASS_PROV_ID); + } + else { + interOpProvInfoPtr = forceNoProvInfoPtr; } - - /* wait until classProvider is finished init'ing */ - semAcquire(sfcbSem,INIT_CLASS_PROV_ID); #ifdef SFCB_INCL_INDICATION_SUPPORT - if (interOpProvInfoPtr != forceNoProvInfoPtr) { + if (exFlags & 2) { startUpProvider("root/interop", "$InterOpProvider$",1); /* note: we don't wait here for interopProvider to finish init'ing, because its init has some reqs that providerMgr will need to process. httpAdapter waits for interop to init before accepting HTTP requests */ + } else { + mlogf(M_INFO, M_SHOW, + "--- No indication support because InterOp namespace disabled\n"); } #endif #ifdef HAVE_SLP - startUpProvider("root/interop", "$ProfileProvider$",1); + if (exFlags & 2) { + startUpProvider("root/interop", "$ProfileProvider$",1); + } else { + mlogf(M_INFO, M_SHOW, + "--- No SLP support because InterOp namespace disabled\n"); + } #endif sigprocmask(SIG_SETMASK, &old_mask, NULL); hooks/post-receive -- sfcb - Small Footprint CIM Broker |