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: Dave H. <hel...@us...> - 2012-03-08 03:58: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 c5daa606337010b51fc2e6700be6db08fabd5c2f (commit)
from 98ad8ffee77d6a23482560af9e3f8b8fb86d8970 (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 c5daa606337010b51fc2e6700be6db08fabd5c2f
Author: Dave Heller <hel...@us...>
Date: Wed Mar 7 22:49:12 2012 -0500
[ 3498719 ] Better SSL error reporting for sfcb
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 28a8655..44c8b6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-07 Dave Heller <hel...@us...>
+
+ * httpAdapter.c:
+ [ 3498719 ] Better SSL error reporting for sfcb
+
2012-03-07 Chris Buccella <buc...@li...>
* cimAccountPassthroughProvider.c:
diff --git a/NEWS b/NEWS
index 06613b2..ba548c8 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ New features:
Bugs fixed:
- 3495804 Cleanup: httpProcId still defined, wrong define in cimXmlGen
+- 3498719 Better SSL error reporting for sfcb
Changes in 1.4.2
================
diff --git a/httpAdapter.c b/httpAdapter.c
index 1614e16..f9d2830 100644
--- a/httpAdapter.c
+++ b/httpAdapter.c
@@ -1283,6 +1283,7 @@ handleHttpRequest(int connFd, int sslMode)
if (!(conn_fd.ssl = SSL_new(ctx)))
intSSLerror("Error creating SSL object");
SSL_set_bio(conn_fd.ssl, sb, sb);
+ char *error_string;
while (1) {
int sslacc,
sslerr;
@@ -1291,6 +1292,7 @@ handleHttpRequest(int connFd, int sslMode)
/*
* accepted
*/
+ _SFCB_TRACE(1, ("--- SSL connection accepted"));
break;
}
sslerr = SSL_get_error(conn_fd.ssl, sslacc);
@@ -1302,10 +1304,16 @@ handleHttpRequest(int connFd, int sslMode)
FD_ZERO(&httpfds);
FD_SET(connFd, &httpfds);
if (sslerr == SSL_ERROR_WANT_WRITE) {
+ _SFCB_TRACE(2, (
+ "--- Waiting for SSL handshake (WANT_WRITE): timeout=%ld",
+ httpSelectTimeout.tv_sec));
isReady =
select(connFd + 1, NULL, &httpfds, NULL,
&httpSelectTimeout);
} else {
+ _SFCB_TRACE(2, (
+ "--- Waiting for SSL handshake (WANT_READ): timeout=%ld",
+ httpSelectTimeout.tv_sec));
isReady =
select(connFd + 1, &httpfds, NULL, NULL,
&httpSelectTimeout);
@@ -1313,13 +1321,119 @@ handleHttpRequest(int connFd, int sslMode)
if (isReady == 0) {
intSSLerror("Timeout error accepting SSL connection");
} else if (isReady < 0) {
+ mlogf(M_ERROR, M_SHOW, "--- Error accepting SSL connection: %s\n",
+ strerror(errno));
intSSLerror("Error accepting SSL connection");
}
+ // Error determination as follows: First, check the SSL error queue. If
+ // empty, attempt to determine the correct error string some other way.
+ // Finally, if the system errno is nonzero, report that as well.
+ } else if (sslerr == SSL_ERROR_ZERO_RETURN){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "TLS/SSL connection has been closed";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_ZERO_RETURN during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_ZERO_RETURN error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_WANT_X509_LOOKUP){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "The client_cert_cb function has not completed";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_WANT_X509_LOOKUP during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_WANT_X509_LOOKUP error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_WANT_CONNECT){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "The connect operation did not complete";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_WANT_CONNECT during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_WANT_CONNECT error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_SYSCALL){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ if (sslacc == 0) {
+ error_string = "EOF occurred: client may have aborted";
+ } else if (sslacc == -1) {
+ error_string = "BIO reported an I/O error";
+ } else { /* possible? */
+ error_string = "Unknown I/O error";
+ }
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_SYSCALL during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_SYSCALL error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_SSL){
+ /* most certificate verification errors will occur here */
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "Unknown SSL library error";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_SSL during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_SSL error during SSL handshake");
+ break;
} else {
/*
* unexpected error
*/
- intSSLerror("Error accepting SSL connection");
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "Undefined SSL library error";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- Undefined SSL_ERROR during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("Undefined error accepting SSL connection");
+ break;
}
}
flags ^= O_NONBLOCK;
@@ -1982,10 +2096,22 @@ httpDaemon(int argc, char *argv[], int sslMode)
static int
get_cert(int preverify_ok, X509_STORE_CTX * x509_ctx)
{
- if (preverify_ok) {
- x509 = X509_STORE_CTX_get_current_cert(x509_ctx);
- }
- return preverify_ok;
+ _SFCB_ENTER(TRACE_HTTPDAEMON, "get_cert");
+
+ char buf[256];
+ int err, 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));
+ X509_NAME_oneline(X509_get_subject_name(x509), buf, 256);
+ _SFCB_TRACE(2, ("--- subject=%s", buf));
+ X509_NAME_oneline(X509_get_issuer_name(x509), buf, 256);
+ _SFCB_TRACE(2, ("--- issuer= %s", buf));
+
+ _SFCB_RETURN(preverify_ok);
}
typedef int (*Validate) (X509 * certificate, char **principal,
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Dave H. <hel...@us...> - 2012-03-08 03:10:32
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv5670
Modified Files:
ChangeLog NEWS httpAdapter.c
Log Message:
Fixed 3498719: Better SSL error reporting for sfcb
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.658
retrieving revision 1.659
diff -u -d -r1.658 -r1.659
--- NEWS 7 Mar 2012 22:29:30 -0000 1.658
+++ NEWS 8 Mar 2012 03:10:29 -0000 1.659
@@ -49,6 +49,7 @@
- 3498275 Remove __Namespace
- 3498044 RIEnabled conflicts with settable retries
- 3426027 cimAccountPassThrough does not set return code
+- 3498719 Better SSL error reporting for sfcb
Changes in 1.3.13
=================
Index: httpAdapter.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- httpAdapter.c 24 Feb 2012 01:35:48 -0000 1.98
+++ httpAdapter.c 8 Mar 2012 03:10:29 -0000 1.99
@@ -1188,11 +1188,13 @@
if (!(conn_fd.ssl = SSL_new(ctx)))
intSSLerror("Error creating SSL object");
SSL_set_bio(conn_fd.ssl, sb, sb);
+ char *error_string;
while(1) {
int sslacc, sslerr;
sslacc = SSL_accept(conn_fd.ssl);
if (sslacc == 1) {
/* accepted */
+ _SFCB_TRACE(1, ("--- SSL connection accepted"));
break;
}
sslerr = SSL_get_error(conn_fd.ssl,sslacc);
@@ -1202,20 +1204,132 @@
FD_ZERO(&httpfds);
FD_SET(connFd,&httpfds);
if (sslerr == SSL_ERROR_WANT_WRITE) {
+ _SFCB_TRACE(2, (
+ "--- Waiting for SSL handshake (WANT_WRITE): timeout=%ld",
+ httpSelectTimeout.tv_sec));
isReady = select(connFd+1,NULL,&httpfds,NULL,&httpSelectTimeout);
} else {
+ _SFCB_TRACE(2, (
+ "--- Waiting for SSL handshake (WANT_READ): timeout=%ld",
+ httpSelectTimeout.tv_sec));
isReady = select(connFd+1,&httpfds,NULL,NULL,&httpSelectTimeout);
}
if (isReady == 0) {
intSSLerror("Timeout error accepting SSL connection");
} else if (isReady < 0) {
+ mlogf(M_ERROR, M_SHOW, "--- Error accepting SSL connection: %s\n",
+ strerror(errno));
intSSLerror("Error accepting SSL connection");
}
+ // Error determination as follows: First, check the SSL error queue. If
+ // empty, attempt to determine the correct error string some other way.
+ // Finally, if the system errno is nonzero, report that as well.
+ } else if (sslerr == SSL_ERROR_ZERO_RETURN){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "TLS/SSL connection has been closed";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_ZERO_RETURN during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_ZERO_RETURN error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_WANT_X509_LOOKUP){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "The client_cert_cb function has not completed";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_WANT_X509_LOOKUP during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_WANT_X509_LOOKUP error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_WANT_CONNECT){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "The connect operation did not complete";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_WANT_CONNECT during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_WANT_CONNECT error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_SYSCALL){
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ if (sslacc == 0) {
+ error_string = "EOF occurred: client may have aborted";
+ } else if (sslacc == -1) {
+ error_string = "BIO reported an I/O error";
+ } else { /* possible? */
+ error_string = "Unknown I/O error";
+ }
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_SYSCALL during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_SYSCALL error during SSL handshake");
+ break;
+ } else if (sslerr == SSL_ERROR_SSL){
+ /* most certificate verification errors will occur here */
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "Unknown SSL library error";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- SSL_ERROR_SSL during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("SSL_ERROR_SSL error during SSL handshake");
+ break;
} else {
- /* unexpected error */
- intSSLerror("Error accepting SSL connection");
- }
- }
+ /* unexpected error */
+ int syserrno = errno;
+ unsigned long sslqerr = ERR_get_error();
+ if (sslqerr != 0) {
+ error_string = ERR_error_string(sslqerr, NULL);
+ } else {
+ error_string = "Undefined SSL library error";
+ }
+ mlogf(M_ERROR, M_SHOW,
+ "--- Undefined SSL_ERROR during handshake: %s\n",
+ error_string);
+ if (syserrno)
+ mlogf(M_ERROR, M_SHOW, "--- system errno reports: %s\n",
+ strerror(syserrno));
+ intSSLerror("Undefined error accepting SSL connection");
+ break;
+ }
+ } /* while */
flags ^= O_NONBLOCK;
fcntl(connFd,F_SETFL,flags);
sslb = BIO_new(BIO_f_ssl());
@@ -1830,10 +1944,22 @@
#if defined USE_SSL
static int get_cert(int preverify_ok,X509_STORE_CTX* x509_ctx)
{
- if (preverify_ok) {
- x509 = X509_STORE_CTX_get_current_cert(x509_ctx);
- }
- return preverify_ok;
+ _SFCB_ENTER(TRACE_HTTPDAEMON, "get_cert");
+
+ char buf[256];
+ int err, 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));
+ X509_NAME_oneline(X509_get_subject_name(x509), buf, 256);
+ _SFCB_TRACE(2, ("--- subject=%s", buf));
+ X509_NAME_oneline(X509_get_issuer_name(x509), buf, 256);
+ _SFCB_TRACE(2, ("--- issuer= %s", buf));
+
+ _SFCB_RETURN(preverify_ok);
}
typedef int (*Validate)(X509 *certificate, char ** principal, int mode);
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.735
retrieving revision 1.736
diff -u -d -r1.735 -r1.736
--- ChangeLog 7 Mar 2012 22:29:29 -0000 1.735
+++ ChangeLog 8 Mar 2012 03:10:29 -0000 1.736
@@ -1,3 +1,8 @@
+2012-03-07 Dave Heller <hel...@us...>
+
+ * httpAdapter.c:
+ [ 3498719 ] Better SSL error reporting for sfcb
+
2012-03-07 Chris Buccella <buc...@li...>
* cimAccountPassthroughProvider.c:
|
|
From: Chris B. <buc...@us...> - 2012-03-07 22:32:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 98ad8ffee77d6a23482560af9e3f8b8fb86d8970 (commit)
from bd262159fae69092cd44011b6944d76e38059099 (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 98ad8ffee77d6a23482560af9e3f8b8fb86d8970
Author: buccella <buc...@li...>
Date: Wed Mar 7 17:32:14 2012 -0500
[ 3426027 ] cimAccountPassThrough does not set return code
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 97ccbe3..28a8655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-03-07 Chris Buccella <buc...@li...>
+ * cimAccountPassthroughProvider.c:
+ [ 3426027 ] cimAccountPassThrough does not set return code
+
* indCIMXMLHandler.c, interopProvider.c, test/xmltest/LD_modify*:
[ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
diff --git a/NEWS b/NEWS
index 0c2f6f5..06613b2 100644
--- a/NEWS
+++ b/NEWS
@@ -110,6 +110,7 @@ Bugs Fixed:
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
- 3497950 SFCB Semaphore Handling Improvements
- 3498275 Remove __Namespace
+- 3426027 cimAccountPassThrough does not set return code
Changes in 1.3.13
=================
diff --git a/cimAccountPassthroughProvider.c b/cimAccountPassthroughProvider.c
index b41f803..70b346d 100644
--- a/cimAccountPassthroughProvider.c
+++ b/cimAccountPassthroughProvider.c
@@ -64,6 +64,7 @@ CimAccountPassthroughProviderInvokeMethod(CMPIMethodMI * mi,
const CMPIArgs * in, CMPIArgs * out)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
+ CMPIUint8 ret_int = 1;
_SFCB_ENTER(TRACE_PROVIDERS, "CimAccountPassthroughProviderInvokeMethod");
@@ -150,6 +151,8 @@ CimAccountPassthroughProviderInvokeMethod(CMPIMethodMI * mi,
CMPIValue av;
av.string = st.msg;
CMAddArg(out, "Message", &av, CMPI_string);
+ if (st.rc == CMPI_RC_OK)
+ ret_int = 0;
}
else { /* no caInst; probably wrong principal (UserName didn't match) */
_SFCB_TRACE(1, ("--- Invalid request method: %s", methodName));
@@ -161,6 +164,8 @@ CimAccountPassthroughProviderInvokeMethod(CMPIMethodMI * mi,
setStatus(&st, CMPI_RC_ERR_METHOD_NOT_FOUND, "Invalid request method");
}
+ CMReturnData (rslt, (CMPIValue *) &ret_int, CMPI_uint8);
+ CMReturnDone(rslt);
_SFCB_RETURN(st);
}
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-07 22:29:32
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv20220
Modified Files:
cimAccountPassthroughProvider.c ChangeLog NEWS
Log Message:
[ 3426027 ] cimAccountPassThrough does not set return code
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.657
retrieving revision 1.658
diff -u -d -r1.657 -r1.658
--- NEWS 7 Mar 2012 20:59:42 -0000 1.657
+++ NEWS 7 Mar 2012 22:29:30 -0000 1.658
@@ -48,6 +48,7 @@
- 3497950 SFCB Semaphore Handling Improvements
- 3498275 Remove __Namespace
- 3498044 RIEnabled conflicts with settable retries
+- 3426027 cimAccountPassThrough does not set return code
Changes in 1.3.13
=================
Index: cimAccountPassthroughProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/cimAccountPassthroughProvider.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cimAccountPassthroughProvider.c 8 Jun 2011 22:00:12 -0000 1.1
+++ cimAccountPassthroughProvider.c 7 Mar 2012 22:29:29 -0000 1.2
@@ -64,6 +64,7 @@
const CMPIArgs * in, CMPIArgs * out)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
+ CMPIUint8 ret_int = 1;
_SFCB_ENTER(TRACE_PROVIDERS, "CimAccountPassthroughProviderInvokeMethod");
@@ -147,6 +148,8 @@
CMPIValue av;
av.string = st.msg;
CMAddArg(out, "Message", &av, CMPI_string);
+ if (st.rc == CMPI_RC_OK)
+ ret_int = 0;
}
else { /* no caInst; probably wrong principal (UserName didn't match) */
_SFCB_TRACE(1, ("--- Invalid request method: %s", methodName));
@@ -158,6 +161,8 @@
setStatus(&st, CMPI_RC_ERR_METHOD_NOT_FOUND, "Invalid request method");
}
+ CMReturnData (rslt, (CMPIValue *) &ret_int, CMPI_uint8);
+ CMReturnDone(rslt);
_SFCB_RETURN(st);
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.734
retrieving revision 1.735
diff -u -d -r1.734 -r1.735
--- ChangeLog 7 Mar 2012 20:59:42 -0000 1.734
+++ ChangeLog 7 Mar 2012 22:29:29 -0000 1.735
@@ -1,5 +1,8 @@
2012-03-07 Chris Buccella <buc...@li...>
+ * cimAccountPassthroughProvider.c:
+ [ 3426027 ] cimAccountPassThrough does not set return code
+
* interopProvider.c, indCIMXMLHandler.c, test/xmltest/LD_modify*:
[ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
|
|
From: Chris B. <buc...@us...> - 2012-03-07 21:52:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via bd262159fae69092cd44011b6944d76e38059099 (commit)
from f2188259d09fa722fc9d2ae1cfd9c3ca77e04f56 (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 bd262159fae69092cd44011b6944d76e38059099
Author: buccella <buc...@li...>
Date: Wed Mar 7 16:52:05 2012 -0500
[ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index f3d203a..97ccbe3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-03-07 Chris Buccella <buc...@li...>
+ * indCIMXMLHandler.c, interopProvider.c, test/xmltest/LD_modify*:
+ [ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
+
* 10_interop.mof, default.reg.in, interopServerProvider.c:
[ 3498275 ] Remove __Namespace
diff --git a/NEWS b/NEWS
index 961d1f7..0c2f6f5 100644
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,7 @@ Changes in 1.3.14
New Features:
- 3493493 Add sfcbsem
+- 3498932 Implement ModifyInstance for CIM_ListenerDestination
Bugs Fixed:
diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c
index 053f1bb..5110005 100644
--- a/indCIMXMLHandler.c
+++ b/indCIMXMLHandler.c
@@ -464,6 +464,9 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi,
_SFCB_RETURN(st);
}
+/*
+ * ModifyInstance only for ListenerDestination.Destination
+ */
CMPIStatus
IndCIMXMLHandlerModifyInstance(CMPIInstanceMI * mi,
const CMPIContext *ctx,
@@ -472,8 +475,41 @@ IndCIMXMLHandlerModifyInstance(CMPIInstanceMI * mi,
const CMPIInstance *ci,
const char **properties)
{
- CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL };
- _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerSetInstance");
+ CMPIStatus st = { CMPI_RC_OK, NULL };
+ CMPIString *cn = CMGetClassName(cop, NULL);
+ const char *cns = cn->ft->getCharPtr(cn,NULL);
+ CMPIArgs *in;
+ CMPIData rv;
+
+ _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerModifyInstance");
+
+ if(isa("root/interop", cns, "cim_listenerdestination")) {
+ _SFCB_TRACE(1,("--- modify %s", cns));
+
+ CMPIData newDest = CMGetProperty(ci, "Destination", &st);
+ fprintf(stderr, "new dest is %s\n", CMGetCharPtr(newDest.value.string));
+
+ if(newDest.state != CMPI_goodValue) {
+ st.rc = CMPI_RC_ERR_FAILED;
+ return st;
+ }
+
+ in=CMNewArgs(_broker,NULL);
+ CMAddArg(in,"handler",&ci,CMPI_instance);
+ 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);
+
+ if (st.rc==CMPI_RC_OK) {
+ st=InternalProviderModifyInstance(NULL,ctx,rslt,cop,ci,properties);
+ }
+ else {
+ rv=CBInvokeMethod(_broker,ctx,sop,"_removeHandler",in,NULL,NULL);
+ }
+
+ }
+
_SFCB_RETURN(st);
}
diff --git a/interopProvider.c b/interopProvider.c
index fb68a61..84b4cd9 100644
--- a/interopProvider.c
+++ b/interopProvider.c
@@ -358,6 +358,40 @@ removeHandler(Handler * ha, char *key)
_SFCB_EXIT();
}
+
+/*
+ * Similar to addHandler(), but useCount is maintained
+ * don't need to check for handlerHt because we only get here
+ * if getHandler does not return NULL
+ */
+
+static Handler *updateHandler(CMPIInstance *ci,
+ CMPIObjectPath * op)
+{
+ Handler *ha;
+ char *key;
+
+ _SFCB_ENTER(TRACE_INDPROVIDER, "updateHandler");
+
+ key=normalizeObjectPathCharsDup(op);
+
+ _SFCB_TRACE(1,("--- Handler: %s",key));
+
+ // do we need to check??
+ if ((ha=handlerHt->ft->get(handlerHt,key))==NULL) {
+ _SFCB_TRACE(1,("--- No handler %p",ha));
+ if(key) free(key);
+ _SFCB_RETURN(NULL);
+ }
+
+ CMRelease(ha->hci);
+ ha->hci=CMClone(ci,NULL);
+ ha->hop=CMClone(op,NULL);
+ handlerHt->ft->put(handlerHt,key,ha);
+
+ _SFCB_RETURN(ha);
+}
+
/*
* -------------------------------------------------------------------------
*/
@@ -1114,7 +1148,7 @@ InteropProviderCreateInstance(CMPIInstanceMI * mi,
}
/*
- * -------------------------------------------------------------------------
+ * ModifyInstance only for IndicationSubscription.SubscriptionState
*/
CMPIStatus
@@ -1166,8 +1200,29 @@ InteropProviderModifyInstance(CMPIInstanceMI * mi,
CMRelease(su->sci);
su->sci = CMClone(ci, NULL);
- } else
- setStatus(&st, CMPI_RC_ERR_NOT_SUPPORTED, "Class not supported");
+ } else if (isa("root/interop", cns, "cim_listenerdestination")) {
+ char *key = normalizeObjectPathCharsDup(cop);
+ _SFCB_TRACE(1,("--- modify cim_indicationsubscription %s",key));
+ Handler *ha;
+
+ ha = getHandler(key);
+ free(key);
+ if(!ha) {
+ st.rc = CMPI_RC_ERR_NOT_FOUND;
+ return st;
+ }
+ CMPIData newDest = CMGetProperty(ci, "Destination", &st);
+
+ if(newDest.state != CMPI_goodValue) {
+ st.rc = CMPI_RC_ERR_FAILED;
+ return st;
+ }
+ /*replace the instance in the hashtable*/
+ CMRelease(ha->hci);
+ ha->hci=CMClone(ci,NULL);
+
+ }
+ else setStatus(&st,CMPI_RC_ERR_NOT_SUPPORTED,"ModifyInstance for class not supported");
if (st.rc == CMPI_RC_OK) {
ctxLocal = prepareUpcall((CMPIContext *) ctx);
@@ -1418,6 +1473,15 @@ InteropProviderInvokeMethod(CMPIMethodMI * mi,
free(key);
}
+ else if (strcasecmp(methodName, "_updateHandler") == 0) {
+ CMPIInstance *ci=in->ft->getArg(in,"handler",&st).value.inst;
+ CMPIObjectPath *op=in->ft->getArg(in,"key",&st).value.ref;
+ CMPIString *str=CDToString(_broker,op,NULL);
+ CMPIString *ns=CMGetNameSpace(op,NULL);
+ _SFCB_TRACE(1,("--- _updateHandler %s %s",(char*)ns->hdl,(char*)str->hdl));
+ updateHandler(ci,op);
+ }
+
else if (strcasecmp(methodName, "_startup") == 0) {
initInterOp(_broker, ctx);
}
diff --git a/test/xmltest/LD_modify01-create.lines b/test/xmltest/LD_modify01-create.lines
new file mode 100644
index 0000000..4c216ca
--- /dev/null
+++ b/test/xmltest/LD_modify01-create.lines
@@ -0,0 +1,3 @@
+<KEYBINDING NAME="CreationClassName">
+<KEYVALUE VALUETYPE="string">CIM_ListenerDestinationCIMXML</KEYVALUE>
+</KEYBINDING>
diff --git a/test/TestProviders/tests/IndTest2CreateHandler.xml b/test/xmltest/LD_modify01-create.xml
similarity index 86%
copy from test/TestProviders/tests/IndTest2CreateHandler.xml
copy to test/xmltest/LD_modify01-create.xml
index a67dedd..ceaba11 100644
--- a/test/TestProviders/tests/IndTest2CreateHandler.xml
+++ b/test/xmltest/LD_modify01-create.xml
@@ -8,7 +8,7 @@
<NAMESPACE NAME="interop"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
- <INSTANCE CLASSNAME="CIM_IndicationHandlerCIMXML">
+ <INSTANCE CLASSNAME="CIM_ListenerDestinationCIMXML">
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
@@ -16,7 +16,7 @@
<VALUE>Test_Indication_Handler_</VALUE>
</PROPERTY>
<PROPERTY NAME="Destination" TYPE="string">
- <VALUE>file:///tmp/SFCB_Listener.txt</VALUE>
+ <VALUE>file:///tmp/SFCB_Listener.tx</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
diff --git a/test/xmltest/modifyInstance_internalProv.lines b/test/xmltest/LD_modify02-modify.lines
similarity index 100%
copy from test/xmltest/modifyInstance_internalProv.lines
copy to test/xmltest/LD_modify02-modify.lines
diff --git a/test/xmltest/LD_modify02-modify.xml b/test/xmltest/LD_modify02-modify.xml
new file mode 100644
index 0000000..657bd7d
--- /dev/null
+++ b/test/xmltest/LD_modify02-modify.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<CIM CIMVERSION="2.0" DTDVERSION="2.0">
+<MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="ModifyInstance"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH>
+<IPARAMVALUE NAME="ModifiedInstance">
+ <VALUE.NAMEDINSTANCE>
+ <INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML">
+ <KEYBINDING NAME="creationclassname"><KEYVALUE VALUETYPE="string">CIM_ListenerDestinationCIMXML</KEYVALUE></KEYBINDING>
+ <KEYBINDING NAME="name"><KEYVALUE VALUETYPE="string">Test_Indication_Handler_</KEYVALUE></KEYBINDING>
+ <KEYBINDING NAME="systemcreationclassname"><KEYVALUE VALUETYPE="string">CIM_ComputerSystem</KEYVALUE></KEYBINDING>
+ <KEYBINDING NAME="systemname"><KEYVALUE VALUETYPE="string">localhost.localdomain</KEYVALUE></KEYBINDING>
+ </INSTANCENAME>
+ <INSTANCE CLASSNAME="CIM_ListenerDestinationCIMXML">
+ <PROPERTY NAME="Destination" TYPE="string"><VALUE>file:///tmp/SFCB_Listener.txt</VALUE></PROPERTY>
+ <PROPERTY NAME="SystemCreationClassName" TYPE="string"><VALUE>CIM_ComputerSystem</VALUE></PROPERTY>
+ <PROPERTY NAME="SystemName" TYPE="string"><VALUE>localhost.localdomain</VALUE></PROPERTY>
+ <PROPERTY NAME="CreationClassName" TYPE="string"><VALUE>CIM_ListenerDestinationCIMXML</VALUE></PROPERTY>
+ <PROPERTY NAME="Name" TYPE="string"><VALUE>Test_Indication_Handler_</VALUE></PROPERTY>
+ </INSTANCE>
+ </VALUE.NAMEDINSTANCE>
+</IPARAMVALUE>
+</IMETHODCALL></SIMPLEREQ>
+</MESSAGE></CIM>
diff --git a/test/xmltest/LD_modify03-enum.lines b/test/xmltest/LD_modify03-enum.lines
new file mode 100644
index 0000000..a758c9e
--- /dev/null
+++ b/test/xmltest/LD_modify03-enum.lines
@@ -0,0 +1,3 @@
+<PROPERTY NAME="Destination" TYPE="string">
+<VALUE>file:///tmp/SFCB_Listener.txt</VALUE>
+</PROPERTY>
diff --git a/test/xmltest/LD_modify03-enum.xml b/test/xmltest/LD_modify03-enum.xml
new file mode 100644
index 0000000..39ceeae
--- /dev/null
+++ b/test/xmltest/LD_modify03-enum.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CIM CIMVERSION="2.0" DTDVERSION="2.0">
+<MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateInstances"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH>
+<IPARAMVALUE NAME="ClassName"><CLASSNAME NAME="cim_listenerdestination"/></IPARAMVALUE>
+</IMETHODCALL></SIMPLEREQ>
+</MESSAGE></CIM>
diff --git a/test/xmltest/Indication11DeleteSubscription.OK b/test/xmltest/LD_modify04-delete.OK
similarity index 100%
copy from test/xmltest/Indication11DeleteSubscription.OK
copy to test/xmltest/LD_modify04-delete.OK
diff --git a/test/TestProviders/tests/IndTest6DeleteHandler.xml b/test/xmltest/LD_modify04-delete.xml
similarity index 87%
copy from test/TestProviders/tests/IndTest6DeleteHandler.xml
copy to test/xmltest/LD_modify04-delete.xml
index 0558efc..63b3e7b 100644
--- a/test/TestProviders/tests/IndTest6DeleteHandler.xml
+++ b/test/xmltest/LD_modify04-delete.xml
@@ -8,7 +8,7 @@
<NAMESPACE NAME="interop"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
- <INSTANCENAME CLASSNAME="CIM_IndicationHandlerCIMXML">
+ <INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
@@ -16,7 +16,7 @@
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
- <KEYVALUE>CIM_IndicationHandlerCIMXML</KEYVALUE>
+ <KEYVALUE>CIM_ListenerDestinationCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>Test_Indication_Handler_</KEYVALUE>
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-07 21:00:26
|
Update of /cvsroot/sblim/sfcb/test/xmltest
In directory vz-cvs-3.sog:/tmp/cvs-serv12163/test/xmltest
Modified Files:
modifyInstance_regprofile.lines
Added Files:
LD_modify01-create.lines LD_modify01-create.xml
LD_modify02-modify.lines LD_modify02-modify.xml
LD_modify03-enum.lines LD_modify03-enum.xml
LD_modify04-delete.OK LD_modify04-delete.xml
Removed Files:
enumerateinstancenames_Namespace.lines
enumerateinstancenames_Namespace.xml
Log Message:
Added tests for 3498932
--- NEW FILE: LD_modify01-create.lines ---
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">CIM_ListenerDestinationCIMXML</KEYVALUE>
</KEYBINDING>
--- NEW FILE: LD_modify02-modify.lines ---
<IMETHODRESPONSE NAME="ModifyInstance">
<IRETURNVALUE>
</IRETURNVALUE>
</IMETHODRESPONSE>
--- NEW FILE: LD_modify04-delete.OK ---
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLERSP>
<IMETHODRESPONSE NAME="DeleteInstance">
<IRETURNVALUE>
</IRETURNVALUE>
</IMETHODRESPONSE>
</SIMPLERSP>
</MESSAGE>
</CIM>
--- enumerateinstancenames_Namespace.xml DELETED ---
--- enumerateinstancenames_Namespace.lines DELETED ---
--- NEW FILE: LD_modify03-enum.xml ---
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateInstances"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="ClassName"><CLASSNAME NAME="cim_listenerdestination"/></IPARAMVALUE>
</IMETHODCALL></SIMPLEREQ>
</MESSAGE></CIM>
--- NEW FILE: LD_modify01-create.xml ---
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="interop"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_ListenerDestinationCIMXML">
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>Test_Indication_Handler_</VALUE>
</PROPERTY>
<PROPERTY NAME="Destination" TYPE="string">
<VALUE>file:///tmp/SFCB_Listener.tx</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
--- NEW FILE: LD_modify02-modify.xml ---
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="ModifyInstance"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="ModifiedInstance">
<VALUE.NAMEDINSTANCE>
<INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML">
<KEYBINDING NAME="creationclassname"><KEYVALUE VALUETYPE="string">CIM_ListenerDestinationCIMXML</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="name"><KEYVALUE VALUETYPE="string">Test_Indication_Handler_</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="systemcreationclassname"><KEYVALUE VALUETYPE="string">CIM_ComputerSystem</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="systemname"><KEYVALUE VALUETYPE="string">localhost.localdomain</KEYVALUE></KEYBINDING>
</INSTANCENAME>
<INSTANCE CLASSNAME="CIM_ListenerDestinationCIMXML">
<PROPERTY NAME="Destination" TYPE="string"><VALUE>file:///tmp/SFCB_Listener.txt</VALUE></PROPERTY>
<PROPERTY NAME="SystemCreationClassName" TYPE="string"><VALUE>CIM_ComputerSystem</VALUE></PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string"><VALUE>localhost.localdomain</VALUE></PROPERTY>
<PROPERTY NAME="CreationClassName" TYPE="string"><VALUE>CIM_ListenerDestinationCIMXML</VALUE></PROPERTY>
<PROPERTY NAME="Name" TYPE="string"><VALUE>Test_Indication_Handler_</VALUE></PROPERTY>
</INSTANCE>
</VALUE.NAMEDINSTANCE>
</IPARAMVALUE>
</IMETHODCALL></SIMPLEREQ>
</MESSAGE></CIM>
--- NEW FILE: LD_modify03-enum.lines ---
<PROPERTY NAME="Destination" TYPE="string">
<VALUE>file:///tmp/SFCB_Listener.txt</VALUE>
</PROPERTY>
--- NEW FILE: LD_modify04-delete.xml ---
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="interop"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE>CIM_ListenerDestinationCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>Test_Indication_Handler_</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
Index: modifyInstance_regprofile.lines
===================================================================
RCS file: /cvsroot/sblim/sfcb/test/xmltest/modifyInstance_regprofile.lines,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- modifyInstance_regprofile.lines 29 Feb 2012 23:12:45 -0000 1.4
+++ modifyInstance_regprofile.lines 7 Mar 2012 21:00:22 -0000 1.5
@@ -1,3 +1,3 @@
<IMETHODRESPONSE NAME="ModifyInstance">
-<ERROR CODE="7" DESCRIPTION="The requested operation is not supported"/>
+<ERROR CODE="6" DESCRIPTION="The requested object could not be found"/>
</IMETHODRESPONSE>
|
|
From: Chris B. <buc...@us...> - 2012-03-07 20:59:45
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv12144
Modified Files:
indCIMXMLHandler.c interopProvider.c ChangeLog NEWS
Log Message:
[ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.656
retrieving revision 1.657
diff -u -d -r1.656 -r1.657
--- NEWS 7 Mar 2012 17:12:39 -0000 1.656
+++ NEWS 7 Mar 2012 20:59:42 -0000 1.657
@@ -13,6 +13,7 @@
- 3488688 Don't spawn logger for clients
- 3493493 Add sfcbsem
- 3495060 Verify filter and handler information during subscription
+- 3498932 Implement ModifyInstance for CIM_ListenerDestination
Bugs fixed:
Index: indCIMXMLHandler.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/indCIMXMLHandler.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- indCIMXMLHandler.c 7 Mar 2012 17:12:39 -0000 1.46
+++ indCIMXMLHandler.c 7 Mar 2012 20:59:42 -0000 1.47
@@ -417,6 +417,9 @@
_SFCB_RETURN(st);
}
+/*
+ * ModifyInstance only for ListenerDestination.Destination
+ */
CMPIStatus IndCIMXMLHandlerModifyInstance(CMPIInstanceMI * mi,
const CMPIContext * ctx,
const CMPIResult * rslt,
@@ -424,9 +427,43 @@
const CMPIInstance * ci,
const char **properties)
{
- CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL };
- _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerSetInstance");
- _SFCB_RETURN(st);
+
+ CMPIStatus st = { CMPI_RC_OK, NULL };
+ CMPIString *cn = CMGetClassName(cop, NULL);
+ const char *cns = cn->ft->getCharPtr(cn,NULL);
+ CMPIArgs *in;
+ CMPIData rv;
+
+ _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerModifyInstance");
+
+ if(isa("root/interop", cns, "cim_listenerdestination")) {
+ _SFCB_TRACE(1,("--- modify %s", cns));
+
+ CMPIData newDest = CMGetProperty(ci, "Destination", &st);
+ fprintf(stderr, "new dest is %s\n", CMGetCharPtr(newDest.value.string));
+
+ if(newDest.state != CMPI_goodValue) {
+ st.rc = CMPI_RC_ERR_FAILED;
+ return st;
+ }
+
+ in=CMNewArgs(_broker,NULL);
+ CMAddArg(in,"handler",&ci,CMPI_instance);
+ 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);
+
+ if (st.rc==CMPI_RC_OK) {
+ st=InternalProviderModifyInstance(NULL,ctx,rslt,cop,ci,properties);
+ }
+ else {
+ rv=CBInvokeMethod(_broker,ctx,sop,"_removeHandler",in,NULL,NULL);
+ }
+
+ }
+
+ _SFCB_RETURN(st);
}
CMPIStatus IndCIMXMLHandlerDeleteInstance(CMPIInstanceMI * mi,
Index: interopProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopProvider.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- interopProvider.c 2 Mar 2012 21:37:59 -0000 1.54
+++ interopProvider.c 7 Mar 2012 20:59:42 -0000 1.55
@@ -330,6 +330,40 @@
_SFCB_EXIT();
}
+/*
+ * Similar to addHandler(), but useCount is maintained
+ * don't need to check for handlerHt because we only get here
+ * if getHandler does not return NULL
+ */
+
+static Handler *updateHandler(
+ CMPIInstance *ci,
+ CMPIObjectPath * op)
+{
+ Handler *ha;
+ char *key;
+
+ _SFCB_ENTER(TRACE_INDPROVIDER, "updateHandler");
+
+ key=normalizeObjectPathCharsDup(op);
+
+ _SFCB_TRACE(1,("--- Handler: %s",key));
+
+ // do we need to check??
+ if ((ha=handlerHt->ft->get(handlerHt,key))==NULL) {
+ _SFCB_TRACE(1,("--- No handler %p",ha));
+ if(key) free(key);
+ _SFCB_RETURN(NULL);
+ }
+
+ CMRelease(ha->hci);
+ ha->hci=CMClone(ci,NULL);
+ ha->hop=CMClone(op,NULL);
+ handlerHt->ft->put(handlerHt,key,ha);
+
+ _SFCB_RETURN(ha);
+}
+
/* ------------------------------------------------------------------------- */
extern int isChild(const char *ns, const char *parent, const char* child);
@@ -1016,8 +1050,9 @@
_SFCB_RETURN(st);
}
-/* ------------------------------------------------------------------------- */
-
+/*
+ * ModifyInstance only for IndicationSubscription.SubscriptionState
+ */
CMPIStatus InteropProviderModifyInstance(
CMPIInstanceMI * mi,
const CMPIContext * ctx,
@@ -1065,7 +1100,29 @@
su->sci=CMClone(ci,NULL);
}
- else setStatus(&st,CMPI_RC_ERR_NOT_SUPPORTED,"Class not supported");
+ else if(isa("root/interop", cns, "cim_listenerdestination")) {
+ char *key = normalizeObjectPathCharsDup(cop);
+ _SFCB_TRACE(1,("--- modify cim_indicationsubscription %s",key));
+ Handler *ha;
+
+ ha = getHandler(key);
+ free(key);
+ if(!ha) {
+ st.rc = CMPI_RC_ERR_NOT_FOUND;
+ return st;
+ }
+ CMPIData newDest = CMGetProperty(ci, "Destination", &st);
+
+ if(newDest.state != CMPI_goodValue) {
+ st.rc = CMPI_RC_ERR_FAILED;
+ return st;
+ }
+ /*replace the instance in the hashtable*/
+ CMRelease(ha->hci);
+ ha->hci=CMClone(ci,NULL);
+
+ }
+ else setStatus(&st,CMPI_RC_ERR_NOT_SUPPORTED,"ModifyInstance for class not supported");
if (st.rc==CMPI_RC_OK) {
ctxLocal = prepareUpcall((CMPIContext *)ctx);
@@ -1287,6 +1344,15 @@
if(key) free(key);
}
+ else if (strcasecmp(methodName, "_updateHandler") == 0) {
+ CMPIInstance *ci=in->ft->getArg(in,"handler",&st).value.inst;
+ CMPIObjectPath *op=in->ft->getArg(in,"key",&st).value.ref;
+ CMPIString *str=CDToString(_broker,op,NULL);
+ CMPIString *ns=CMGetNameSpace(op,NULL);
+ _SFCB_TRACE(1,("--- _updateHandler %s %s",(char*)ns->hdl,(char*)str->hdl));
+ updateHandler(ci,op);
+ }
+
else if (strcasecmp(methodName, "_startup") == 0) {
initInterOp(_broker,ctx);
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.733
retrieving revision 1.734
diff -u -d -r1.733 -r1.734
--- ChangeLog 7 Mar 2012 17:12:39 -0000 1.733
+++ ChangeLog 7 Mar 2012 20:59:42 -0000 1.734
@@ -1,3 +1,8 @@
+2012-03-07 Chris Buccella <buc...@li...>
+
+ * interopProvider.c, indCIMXMLHandler.c, test/xmltest/LD_modify*:
+ [ 3498932 ] Implement ModifyInstance for CIM_ListenerDestination
+
2012-03-07 Michael Chase-Salerno <br...@li...>
* indCIMXMLHandler.c:
|
|
From: Michael Chase-S. <mc...@us...> - 2012-03-07 17:12:42
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv28155
Modified Files:
ChangeLog NEWS indCIMXMLHandler.c
Log Message:
[ 3498044 ] RIEnabled conflicts with settable retries
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.655
retrieving revision 1.656
diff -u -d -r1.655 -r1.656
--- NEWS 7 Mar 2012 05:55:42 -0000 1.655
+++ NEWS 7 Mar 2012 17:12:39 -0000 1.656
@@ -46,6 +46,7 @@
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
- 3497950 SFCB Semaphore Handling Improvements
- 3498275 Remove __Namespace
+- 3498044 RIEnabled conflicts with settable retries
Changes in 1.3.13
=================
Index: indCIMXMLHandler.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/indCIMXMLHandler.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- indCIMXMLHandler.c 1 Mar 2012 23:56:43 -0000 1.45
+++ indCIMXMLHandler.c 7 Mar 2012 17:12:39 -0000 1.46
@@ -854,14 +854,18 @@
if (interOpNameSpace(ref,&st)==0) _SFCB_RETURN(st);
if (strcasecmp(methodName, "_deliver") == 0) {
+#ifndef SETTABLERETRY
// On the first indication, check if reliable indications are enabled.
if (RIEnabled == -1) {
+#endif
CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL);
CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
CMPIData isinst=CMGetNext(isenm,NULL);
CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
RIEnabled=mc.value.uint16;
+#ifndef SETTABLERETRY
}
+#endif
CMPIInstance *indo=CMGetArg(in,"indication",NULL).value.inst;
CMPIInstance *ind=CMClone(indo,NULL);
CMPIContext *ctxLocal=NULL;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.732
retrieving revision 1.733
diff -u -d -r1.732 -r1.733
--- ChangeLog 7 Mar 2012 05:55:42 -0000 1.732
+++ ChangeLog 7 Mar 2012 17:12:39 -0000 1.733
@@ -1,3 +1,8 @@
+2012-03-07 Michael Chase-Salerno <br...@li...>
+
+ * indCIMXMLHandler.c:
+ [ 3498044 ] RIEnabled conflicts with settable retries
+
2012-03-07 Chris Buccella <buc...@li...>
* 10_interop.mof, default.reg.in, interopServerProvider.c:
@@ -15,12 +20,12 @@
2012-03-05 Narasimhma Sharoff <nsh...@us...>
- * providerDrv.c, providerMgr.c, sfcBroker.c
+ * providerDrv.c, providerMgr.c, sfcBroker.c:
[ 3497096 ] double free during stopProc
2012-03-05 Narasimhma Sharoff <nsh...@us...>
- * providerDrv.c, providerMgr.c, providerMgr.h, support.c
+ * providerDrv.c, providerMgr.c, providerMgr.h, support.c:
[ 3416060 ] sigsegv in tool_mm_flush()
2012-03-02 Chris Buccella <buc...@li...>
@@ -30,7 +35,7 @@
2012-03-01 Michael Chase-Salerno <br...@li...>
- * indCIMXMLHandler.c, indRetryTest.sh
+ * indCIMXMLHandler.c, indRetryTest.sh:
[ 3484083] Exclude SFCBIndicationID
2012-03-01 Chris Buccella <buc...@li...>
@@ -40,7 +45,7 @@
2012-03-01 Narasimha Sharoff <nsh...@us...>
- * brokerUpc.c
+ * brokerUpc.c:
[ 3483200 ] duplicate indication deliveries
2012-02-29 Chris Buccella <buc...@li...>
@@ -59,7 +64,7 @@
2012-02-29 Narasimha Sharoff <nsh...@us...>
- * indCIMXMLHandler.c, interopProvider.c
+ * indCIMXMLHandler.c, interopProvider.c:
[ 3495060 ] verify filter and handler information during subscription
2012-02-29 Dave Heller <hel...@us...>
@@ -79,7 +84,7 @@
2012-02-24 Chris Buccella <buc...@li...>
- * Makefile.am, sfcbsem.c
+ * Makefile.am, sfcbsem.c:
[ 3493493 ] Add sfcbsem
(code by Viktor Mihajlovski)
|
|
From: Chris B. <buc...@us...> - 2012-03-07 06:30:47
|
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 f2188259d09fa722fc9d2ae1cfd9c3ca77e04f56 (commit)
from ad10ca9897578a66864905652cb02645894086c7 (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 f2188259d09fa722fc9d2ae1cfd9c3ca77e04f56
Author: buccella <buc...@li...>
Date: Wed Mar 7 01:31:28 2012 -0500
[ 3498275 ] Remove __Namespace
-----------------------------------------------------------------------
Summary of changes:
diff --git a/test/xmltest/enumerateinstancenames_Namespace.lines b/test/xmltest/enumerateinstancenames_Namespace.lines
deleted file mode 100644
index 3555ac1..0000000
--- a/test/xmltest/enumerateinstancenames_Namespace.lines
+++ /dev/null
@@ -1,4 +0,0 @@
-<IMETHODRESPONSE NAME="EnumerateInstanceNames">
-<IRETURNVALUE>
-</IRETURNVALUE>
-</IMETHODRESPONSE>
diff --git a/test/xmltest/enumerateinstancenames_Namespace.xml b/test/xmltest/enumerateinstancenames_Namespace.xml
deleted file mode 100644
index 02d8ce3..0000000
--- a/test/xmltest/enumerateinstancenames_Namespace.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<CIM CIMVERSION="2.0" DTDVERSION="2.0">
-<MESSAGE ID="4713" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateInstanceNames"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH>
-<IPARAMVALUE NAME="ClassName"><CLASSNAME NAME="__Namespace"/></IPARAMVALUE>
-</IMETHODCALL></SIMPLEREQ>
-</MESSAGE></CIM>
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-07 06:30:13
|
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 ad10ca9897578a66864905652cb02645894086c7 (commit)
from 3ed344550a9d63787266bfbf8e1a942fbdb828de (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 ad10ca9897578a66864905652cb02645894086c7
Author: buccella <buc...@li...>
Date: Wed Mar 7 01:30:45 2012 -0500
[ 3498275 ] Remove __Namespace
-----------------------------------------------------------------------
Summary of changes:
diff --git a/10_interop.mof b/10_interop.mof
index a726caa..06d209c 100644
--- a/10_interop.mof
+++ b/10_interop.mof
@@ -44,12 +44,6 @@ class DMY_SubProfileRequiresProfile : CIM_SubProfileRequiresProfile
{
};
-class __Namespace
-{
- [key]
- string Name;
-};
-
class DMY_ListenerDestinationCIMXML : CIM_ListenerDestinationCIMXML
{
};
diff --git a/ChangeLog b/ChangeLog
index c6154ed..f3d203a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-07 Chris Buccella <buc...@li...>
+
+ * 10_interop.mof, default.reg.in, interopServerProvider.c:
+ [ 3498275 ] Remove __Namespace
+
2012-03-01 Michael Chase-Salerno <br...@li...>
* indCIMXMLHandler.c:
diff --git a/NEWS b/NEWS
index f394344..961d1f7 100644
--- a/NEWS
+++ b/NEWS
@@ -108,6 +108,7 @@ Bugs Fixed:
- 3496383 Faster Return from CBDeliverIndication
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
- 3497950 SFCB Semaphore Handling Improvements
+- 3498275 Remove __Namespace
Changes in 1.3.13
=================
diff --git a/default.reg.in b/default.reg.in
index 8d16985..b3c5cc2 100644
--- a/default.reg.in
+++ b/default.reg.in
@@ -90,12 +90,6 @@
type: instance
namespace: root/interop
#
-[__Namespace]
- provider: ServerProvider
- location: sfcInteropServerProvider
- type: instance
- namespace: *
-#
[CIM_ObjectManager]
provider: ServerProvider
location: sfcInteropServerProvider
diff --git a/interopServerProvider.c b/interopServerProvider.c
index ad2a039..8e3893b 100644
--- a/interopServerProvider.c
+++ b/interopServerProvider.c
@@ -105,19 +105,13 @@ getSfcbUuid()
static int
genNameSpaceData(const char *ns, const char *dn, int dbl,
const CMPIResult *rslt, CMPIObjectPath * op,
- CMPIInstance *ci, int nsOpt)
+ CMPIInstance *ci)
{
if (ci) {
- if (nsOpt)
- CMSetProperty(ci, "Name", dn, CMPI_chars);
- else
- CMSetProperty(ci, "Name", ns + dbl + 1, CMPI_chars);
+ CMSetProperty(ci, "Name", ns + dbl + 1, CMPI_chars);
CMReturnInstance(rslt, ci);
} else if (op) {
- if (nsOpt)
- CMAddKey(op, "Name", dn, CMPI_chars);
- else
- CMAddKey(op, "Name", ns + dbl + 1, CMPI_chars);
+ CMAddKey(op, "Name", ns + dbl + 1, CMPI_chars);
CMReturnObjectPath(rslt, op);
}
return 0;
@@ -126,7 +120,7 @@ genNameSpaceData(const char *ns, const char *dn, int dbl,
static void
gatherNameSpacesData(const char *dn, int dbl,
const CMPIResult *rslt,
- CMPIObjectPath * op, CMPIInstance *ci, int nsOpt)
+ CMPIObjectPath * op, CMPIInstance *ci)
{
DIR *dir,
*de_test;
@@ -153,38 +147,20 @@ gatherNameSpacesData(const char *dn, int dbl,
}
closedir(de_test);
- genNameSpaceData(n, de->d_name, dbl, rslt, op, ci, nsOpt);
- if (nsOpt != 1) {
- if (nsOpt == 0)
- gatherNameSpacesData(n, dbl, rslt, op, ci, nsOpt);
- }
+ genNameSpaceData(n,de->d_name,dbl,rslt,op,ci);
+ gatherNameSpacesData(n,dbl,rslt,op,ci);
free(n);
}
closedir(dir);
}
}
-static void
-gatherOldNameSpacesData(const char *dn, int dbl,
- const CMPIResult *rslt,
- CMPIObjectPath * op, CMPIInstance *ci)
-{
-
- char *ns = (char *) CMGetNameSpace(op, NULL)->hdl;
- char *nns = alloca(strlen(dn) + strlen(ns) + 8);
-
- strcpy(nns, dn);
- strcat(nns, "/");
- strcat(nns, ns);
- gatherNameSpacesData(nns, dbl, rslt, op, ci, 1);
-}
-
static CMPIStatus
NameSpaceProviderGetInstance(CMPIInstanceMI * mi,
const CMPIContext *ctx,
const CMPIResult *rslt,
const CMPIObjectPath * cop,
- const char **properties, int nsOpt)
+ const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dirn,
@@ -196,7 +172,6 @@ NameSpaceProviderGetInstance(CMPIInstanceMI * mi,
CMPIString *name;
unsigned short info = 0,
dbl;
- char *ns;
_SFCB_ENTER(TRACE_PROVIDERS, "NameSpaceProviderGetInstance");
@@ -212,39 +187,23 @@ NameSpaceProviderGetInstance(CMPIInstanceMI * mi,
if (dirn[strlen(dirn) - 1] != '/')
strcat(dn, "/");
strcat(dn, "repository/");
- if (nsOpt) {
- ns = CMGetCharPtr(CMGetNameSpace(cop, NULL));
- if (ns) {
- strcat(dn, ns);
- strcat(dn, "/");
- }
- }
dbl = strlen(dn);
strcat(dn, (char *) name->hdl);
if ((dir = opendir(dn)) != NULL) {
- if (nsOpt) {
- op = CMNewObjectPath(_broker, "root/interop", "__Namespace", NULL);
- ci = CMNewInstance(_broker, op, NULL);
- } else {
- op = CMNewObjectPath(_broker, "root/interop", "CIM_Namespace",
- NULL);
- ci = CMNewInstance(_broker, op, NULL);
-
- CMSetProperty(ci, "CreationClassName", "CIM_Namespace",
- CMPI_chars);
- CMSetProperty(ci, "ObjectManagerCreationClassName",
- "CIM_ObjectManager", CMPI_chars);
- CMSetProperty(ci, "ObjectManagerName", getSfcbUuid(), CMPI_chars);
- CMSetProperty(ci, "SystemCreationClassName", "CIM_ComputerSystem",
- CMPI_chars);
- hostName[0] = 0;
- gethostname(hostName, 511);
- CMSetProperty(ci, "SystemName", hostName, CMPI_chars);
- CMSetProperty(ci, "ClassInfo", &info, CMPI_uint16);
- }
- CMSetProperty(ci, "Name", dn + dbl, CMPI_chars);
- CMReturnInstance(rslt, ci);
+ op=CMNewObjectPath(_broker,"root/interop","CIM_Namespace",NULL);
+ ci=CMNewInstance(_broker,op,NULL);
+
+ CMSetProperty(ci,"CreationClassName","CIM_Namespace",CMPI_chars);
+ CMSetProperty(ci,"ObjectManagerCreationClassName","CIM_ObjectManager",CMPI_chars);
+ CMSetProperty(ci,"ObjectManagerName",getSfcbUuid(),CMPI_chars);
+ CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ hostName[0]=0;
+ gethostname(hostName,511);
+ CMSetProperty(ci,"SystemName",hostName,CMPI_chars);
+ CMSetProperty(ci,"ClassInfo",&info,CMPI_uint16);
+ CMSetProperty(ci,"Name",dn+dbl,CMPI_chars);
+ CMReturnInstance(rslt,ci);
closedir(dir);
} else
st.rc = CMPI_RC_ERR_NOT_FOUND;
@@ -259,7 +218,7 @@ NameSpaceProviderEnumInstances(CMPIInstanceMI * mi,
const CMPIContext *ctx,
const CMPIResult *rslt,
const CMPIObjectPath * ref,
- const char **properties, int nsOpt)
+ const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dir,
@@ -281,19 +240,6 @@ NameSpaceProviderEnumInstances(CMPIInstanceMI * mi,
strcat(dn, "/");
strcat(dn, "repository");
- if (nsOpt) {
- op = CMNewObjectPath(_broker, "root/interop", "__Namespace", &st);
- if (op) {
- ci = CMNewInstance(_broker, op, &st);
- if (ci) {
- op = CMGetObjectPath(ci, NULL);
- CMSetNameSpaceFromObjectPath(op, ref);
- gatherOldNameSpacesData(dn, strlen(dn), rslt, op, ci);
- }
- }
- _SFCB_RETURN(st);
- }
-
op = CMNewObjectPath(_broker, "root/interop", "CIM_Namespace", NULL);
ci = CMNewInstance(_broker, op, NULL);
@@ -308,7 +254,7 @@ NameSpaceProviderEnumInstances(CMPIInstanceMI * mi,
CMSetProperty(ci, "SystemName", hostName, CMPI_chars);
CMSetProperty(ci, "ClassInfo", &info, CMPI_uint16);
- gatherNameSpacesData(dn, strlen(dn), rslt, NULL, ci, 0);
+ gatherNameSpacesData(dn, strlen(dn), rslt, NULL, ci);
_SFCB_RETURN(st);
}
@@ -317,7 +263,7 @@ static CMPIStatus
NameSpaceProviderEnumInstanceNames(CMPIInstanceMI * mi,
const CMPIContext *ctx,
const CMPIResult *rslt,
- const CMPIObjectPath * ref, int nsOpt)
+ const CMPIObjectPath * ref)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dir,
@@ -337,13 +283,6 @@ NameSpaceProviderEnumInstanceNames(CMPIInstanceMI * mi,
strcat(dn, "/");
strcat(dn, "repository");
- if (nsOpt) {
- char *ns = (char *) CMGetNameSpace(ref, NULL)->hdl;
- op = CMNewObjectPath(_broker, ns, "__Namespace", NULL);
- gatherOldNameSpacesData(dn, strlen(dn), rslt, op, NULL);
- _SFCB_RETURN(st);
- }
-
op = CMNewObjectPath(_broker, "root/interop", "CIM_Namespace", NULL);
CMAddKey(op, "CreationClassName", "CIM_Namespace", CMPI_chars);
@@ -356,7 +295,7 @@ NameSpaceProviderEnumInstanceNames(CMPIInstanceMI * mi,
gethostname(hostName, 511);
CMAddKey(op, "SystemName", hostName, CMPI_chars);
- gatherNameSpacesData(dn, strlen(dn), rslt, op, NULL, nsOpt);
+ gatherNameSpacesData(dn, strlen(dn), rslt, op, NULL);
_SFCB_RETURN(st);
}
@@ -785,9 +724,7 @@ ServerProviderGetInstance(CMPIInstanceMI * mi,
CMPIString *cls = CMGetClassName(ref, NULL);
if (strcasecmp((char *) cls->hdl, "cim_namespace") == 0)
- return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties, 0);
- else if (strcasecmp((char *) cls->hdl, "__namespace") == 0)
- return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties, 1);
+ return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties);
if (strcasecmp((char *) cls->hdl, "cim_objectmanager") == 0)
return ServiceProviderGetInstance(mi, ctx, rslt, ref, properties,
"cim_objectmanager");
@@ -815,9 +752,7 @@ ServerProviderEnumInstanceNames(CMPIInstanceMI * mi,
CMPIString *cls = CMGetClassName(ref, NULL);
if (strcasecmp((char *) cls->hdl, "cim_namespace") == 0)
- return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref, 0);
- if (strcasecmp((char *) cls->hdl, "__namespace") == 0)
- return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref, 1);
+ return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref);
if (strcasecmp((char *) cls->hdl, "cim_objectmanager") == 0)
return ServiceProviderEnumInstanceNames(mi, ctx, rslt, ref,
"CIM_ObjectManager",
@@ -847,11 +782,7 @@ ServerProviderEnumInstances(CMPIInstanceMI * mi,
CMPIString *cls = CMGetClassName(ref, NULL);
if (strcasecmp((char *) cls->hdl, "cim_namespace") == 0)
- return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties,
- 0);
- if (strcasecmp((char *) cls->hdl, "__namespace") == 0)
- return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties,
- 1);
+ return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties);
if (strcasecmp((char *) cls->hdl, "cim_objectmanager") == 0)
return ObjectManagerProviderEnumInstances(mi, ctx, rslt, ref,
properties);
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-07 05:55:44
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv14057
Modified Files:
ChangeLog NEWS 10_interop.mof interopServerProvider.c
default.reg.in
Log Message:
[ 3498275 ] Remove __Namespace
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.654
retrieving revision 1.655
diff -u -d -r1.654 -r1.655
--- NEWS 7 Mar 2012 00:52:36 -0000 1.654
+++ NEWS 7 Mar 2012 05:55:42 -0000 1.655
@@ -45,6 +45,7 @@
- 3497096 double free during stopProc
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
- 3497950 SFCB Semaphore Handling Improvements
+- 3498275 Remove __Namespace
Changes in 1.3.13
=================
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.731
retrieving revision 1.732
diff -u -d -r1.731 -r1.732
--- ChangeLog 7 Mar 2012 00:52:36 -0000 1.731
+++ ChangeLog 7 Mar 2012 05:55:42 -0000 1.732
@@ -1,3 +1,8 @@
+2012-03-07 Chris Buccella <buc...@li...>
+
+ * 10_interop.mof, default.reg.in, interopServerProvider.c:
+ [ 3498275 ] Remove __Namespace
+
2012-03-06 Chris Buccella <buc...@li...>
* providerDrv.c, providerMgr.c:
Index: 10_interop.mof
===================================================================
RCS file: /cvsroot/sblim/sfcb/10_interop.mof,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- 10_interop.mof 14 May 2010 20:20:33 -0000 1.9
+++ 10_interop.mof 7 Mar 2012 05:55:42 -0000 1.10
@@ -43,12 +43,6 @@
{
};
-class __Namespace
-{
- [key]
- string Name;
-};
-
class DMY_ListenerDestinationCIMXML : CIM_ListenerDestinationCIMXML
{
};
Index: default.reg.in
===================================================================
RCS file: /cvsroot/sblim/sfcb/default.reg.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- default.reg.in 3 Feb 2012 16:45:57 -0000 1.16
+++ default.reg.in 7 Mar 2012 05:55:42 -0000 1.17
@@ -89,12 +89,6 @@
type: instance
namespace: root/interop
#
-[__Namespace]
- provider: ServerProvider
- location: sfcInteropServerProvider
- type: instance
- namespace: *
-#
[CIM_ObjectManager]
provider: ServerProvider
location: sfcInteropServerProvider
Index: interopServerProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopServerProvider.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- interopServerProvider.c 28 Feb 2012 22:03:36 -0000 1.35
+++ interopServerProvider.c 7 Mar 2012 05:55:42 -0000 1.36
@@ -96,15 +96,13 @@
static int genNameSpaceData(const char *ns, const char *dn, int dbl,
const CMPIResult * rslt, CMPIObjectPath *op,
- CMPIInstance *ci,int nsOpt)
+ CMPIInstance *ci)
{
if (ci) {
- if (nsOpt) CMSetProperty(ci,"Name",dn,CMPI_chars);
- else CMSetProperty(ci,"Name",ns+dbl+1,CMPI_chars);
+ CMSetProperty(ci,"Name",ns+dbl+1,CMPI_chars);
CMReturnInstance(rslt,ci);
} else if (op) {
- if (nsOpt) CMAddKey(op,"Name",dn,CMPI_chars);
- else CMAddKey(op,"Name",ns+dbl+1,CMPI_chars);
+ CMAddKey(op,"Name",ns+dbl+1,CMPI_chars);
CMReturnObjectPath(rslt,op);
}
return 0;
@@ -113,7 +111,7 @@
static void gatherNameSpacesData(const char *dn, int dbl,
const CMPIResult * rslt,
- CMPIObjectPath *op, CMPIInstance *ci, int nsOpt)
+ CMPIObjectPath *op, CMPIInstance *ci)
{
DIR *dir, *de_test;
struct dirent *de;
@@ -137,38 +135,19 @@
}
closedir(de_test);
- genNameSpaceData(n,de->d_name,dbl,rslt,op,ci,nsOpt);
- if (nsOpt!=1) {
- if (nsOpt==0) gatherNameSpacesData(n,dbl,rslt,op,ci,nsOpt);
- }
+ genNameSpaceData(n,de->d_name,dbl,rslt,op,ci);
+ gatherNameSpacesData(n,dbl,rslt,op,ci);
free(n);
}
closedir(dir);
}
}
-
-static void gatherOldNameSpacesData(const char *dn, int dbl,
- const CMPIResult * rslt,
- CMPIObjectPath *op,
- CMPIInstance *ci)
-{
-
- char *ns = (char*)CMGetNameSpace(op,NULL)->hdl;
- char *nns=alloca(strlen(dn)+strlen(ns)+8);
-
- strcpy(nns,dn);
- strcat(nns,"/");
- strcat(nns,ns);
- gatherNameSpacesData(nns,dbl,rslt,op,ci,1);
-}
-
static CMPIStatus NameSpaceProviderGetInstance(CMPIInstanceMI * mi,
const CMPIContext * ctx,
const CMPIResult * rslt,
const CMPIObjectPath * cop,
- const char **properties,
- int nsOpt)
+ const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dirn,*dn,hostName[512];
@@ -177,7 +156,6 @@
CMPIInstance *ci;
CMPIString *name;
unsigned short info=0,dbl;
- char *ns;
_SFCB_ENTER(TRACE_PROVIDERS, "NameSpaceProviderGetInstance");
@@ -192,36 +170,24 @@
strcpy(dn,dirn);
if (dirn[strlen(dirn)-1]!='/') strcat(dn,"/");
strcat(dn,"repository/");
- if (nsOpt) {
- ns = CMGetCharPtr(CMGetNameSpace(cop,NULL));
- if (ns) {
- strcat(dn,ns);
- strcat(dn,"/");
- }
- }
dbl=strlen(dn);
strcat(dn,(char*)name->hdl);
if ((dir=opendir(dn))!=NULL) {
- if (nsOpt) {
- op=CMNewObjectPath(_broker,"root/interop","__Namespace",NULL);
- ci=CMNewInstance(_broker,op,NULL);
- } else {
- op=CMNewObjectPath(_broker,"root/interop","CIM_Namespace",NULL);
- ci=CMNewInstance(_broker,op,NULL);
-
- CMSetProperty(ci,"CreationClassName","CIM_Namespace",CMPI_chars);
- CMSetProperty(ci,"ObjectManagerCreationClassName","CIM_ObjectManager",CMPI_chars);
- CMSetProperty(ci,"ObjectManagerName",getSfcbUuid(),CMPI_chars);
- CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
- hostName[0]=0;
- gethostname(hostName,511);
- CMSetProperty(ci,"SystemName",hostName,CMPI_chars);
- CMSetProperty(ci,"ClassInfo",&info,CMPI_uint16);
- }
- CMSetProperty(ci,"Name",dn+dbl,CMPI_chars);
- CMReturnInstance(rslt,ci);
- closedir(dir);
+ op=CMNewObjectPath(_broker,"root/interop","CIM_Namespace",NULL);
+ ci=CMNewInstance(_broker,op,NULL);
+
+ CMSetProperty(ci,"CreationClassName","CIM_Namespace",CMPI_chars);
+ CMSetProperty(ci,"ObjectManagerCreationClassName","CIM_ObjectManager",CMPI_chars);
+ CMSetProperty(ci,"ObjectManagerName",getSfcbUuid(),CMPI_chars);
+ CMSetProperty(ci,"SystemCreationClassName","CIM_ComputerSystem",CMPI_chars);
+ hostName[0]=0;
+ gethostname(hostName,511);
+ CMSetProperty(ci,"SystemName",hostName,CMPI_chars);
+ CMSetProperty(ci,"ClassInfo",&info,CMPI_uint16);
+ CMSetProperty(ci,"Name",dn+dbl,CMPI_chars);
+ CMReturnInstance(rslt,ci);
+ closedir(dir);
}
else st.rc=CMPI_RC_ERR_NOT_FOUND;
}
@@ -234,8 +200,7 @@
const CMPIContext * ctx,
const CMPIResult * rslt,
const CMPIObjectPath * ref,
- const char **properties,
- int nsOpt)
+ const char **properties)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dir,*dn,hostName[512];
@@ -244,7 +209,6 @@
unsigned short info=0;
_SFCB_ENTER(TRACE_PROVIDERS, "NameSpaceProviderEnumInstances");
-
if (getControlChars("registrationDir",&dir)) {
dir = "/var/lib/sfcb/registration";
}
@@ -254,19 +218,6 @@
if (dir[strlen(dir)-1]!='/') strcat(dn,"/");
strcat(dn,"repository");
- if (nsOpt) {
- op=CMNewObjectPath(_broker,"root/interop","__Namespace",&st);
- if (op) {
- ci=CMNewInstance(_broker,op,&st);
- if (ci) {
- op=CMGetObjectPath(ci,NULL);
- CMSetNameSpaceFromObjectPath(op,ref);
- gatherOldNameSpacesData(dn,strlen(dn),rslt,op,ci);
- }
- }
- _SFCB_RETURN(st);
- }
-
op=CMNewObjectPath(_broker,"root/interop","CIM_Namespace",NULL);
ci=CMNewInstance(_broker,op,NULL);
@@ -279,7 +230,7 @@
CMSetProperty(ci,"SystemName",hostName,CMPI_chars);
CMSetProperty(ci,"ClassInfo",&info,CMPI_uint16);
- gatherNameSpacesData(dn,strlen(dn),rslt,NULL,ci,0);
+ gatherNameSpacesData(dn,strlen(dn),rslt,NULL,ci);
_SFCB_RETURN(st);
}
@@ -287,8 +238,7 @@
static CMPIStatus NameSpaceProviderEnumInstanceNames(CMPIInstanceMI * mi,
const CMPIContext * ctx,
const CMPIResult * rslt,
- const CMPIObjectPath * ref,
- int nsOpt)
+ const CMPIObjectPath * ref)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
char *dir,*dn,hostName[512];
@@ -305,13 +255,6 @@
if (dir[strlen(dir)-1]!='/') strcat(dn,"/");
strcat(dn,"repository");
- if (nsOpt) {
- char *ns=(char*)CMGetNameSpace(ref,NULL)->hdl;
- op=CMNewObjectPath(_broker,ns,"__Namespace",NULL);
- gatherOldNameSpacesData(dn,strlen(dn),rslt,op,NULL);
- _SFCB_RETURN(st);
- }
-
op=CMNewObjectPath(_broker,"root/interop","CIM_Namespace",NULL);
CMAddKey(op,"CreationClassName","CIM_Namespace",CMPI_chars);
@@ -322,7 +265,7 @@
gethostname(hostName,511);
CMAddKey(op,"SystemName",hostName,CMPI_chars);
- gatherNameSpacesData(dn,strlen(dn),rslt,op,NULL,nsOpt);
+ gatherNameSpacesData(dn,strlen(dn),rslt,op,NULL);
_SFCB_RETURN(st);
}
@@ -713,9 +656,7 @@
CMPIString *cls=CMGetClassName(ref,NULL);
if (strcasecmp((char*)cls->hdl,"cim_namespace")==0)
- return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties, 0);
- else if (strcasecmp((char*)cls->hdl,"__namespace")==0)
- return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties, 1);
+ return NameSpaceProviderGetInstance(mi, ctx, rslt, ref, properties);
if (strcasecmp((char*)cls->hdl,"cim_objectmanager")==0)
return ServiceProviderGetInstance(mi, ctx, rslt, ref, properties,
"cim_objectmanager");
@@ -739,9 +680,7 @@
CMPIString *cls=CMGetClassName(ref,NULL);
if (strcasecmp((char*)cls->hdl,"cim_namespace")==0)
- return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref,0);
- if (strcasecmp((char*)cls->hdl,"__namespace")==0)
- return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref,1);
+ return NameSpaceProviderEnumInstanceNames(mi, ctx, rslt, ref);
if (strcasecmp((char*)cls->hdl,"cim_objectmanager")==0)
return ServiceProviderEnumInstanceNames(mi, ctx, rslt, ref,
"CIM_ObjectManager", "CIM_ComputerSystem");
@@ -765,9 +704,7 @@
CMPIString *cls=CMGetClassName(ref,NULL);
if (strcasecmp((char*)cls->hdl,"cim_namespace")==0)
- return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties, 0);
- if (strcasecmp((char*)cls->hdl,"__namespace")==0)
- return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties, 1);
+ return NameSpaceProviderEnumInstances(mi, ctx, rslt, ref, properties);
if (strcasecmp((char*)cls->hdl,"cim_objectmanager")==0)
return ObjectManagerProviderEnumInstances(mi, ctx, rslt, ref, properties);
if (strcasecmp((char*)cls->hdl,"cim_objectmanagercommunicationMechanism")==0)
|
|
From: Chris B. <buc...@us...> - 2012-03-07 00:52:38
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv21832
Modified Files:
providerDrv.c providerMgr.c ChangeLog NEWS
Log Message:
[ 3497950 ] SFCB Semaphore Handling Improvements
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.653
retrieving revision 1.654
diff -u -d -r1.653 -r1.654
--- NEWS 6 Mar 2012 17:33:55 -0000 1.653
+++ NEWS 7 Mar 2012 00:52:36 -0000 1.654
@@ -44,6 +44,7 @@
- 3416060 sigsegv in tool_mm_flush()
- 3497096 double free during stopProc
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
+- 3497950 SFCB Semaphore Handling Improvements
Changes in 1.3.13
=================
Index: providerMgr.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- providerMgr.c 6 Mar 2012 17:33:55 -0000 1.79
+++ providerMgr.c 7 Mar 2012 00:52:36 -0000 1.80
@@ -1004,13 +1004,25 @@
int i = 0;
_SFCB_ENTER(TRACE_PROVIDERMGR, "closeProviderContext");
for(i = 0; i < ctx->pCount; i++) {
- semAcquire(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId));
- if(semGetValue(sfcbSem, PROV_INUSE(ctx->pAs[i].ids.procId)) != 0) {
- semAcquire(sfcbSem,PROV_INUSE(ctx->pAs[i].ids.procId));
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if(semGetValue(sfcbSem, PROV_INUSE(ctx->pAs[i].ids.procId)) > 0) {
+ if (semAcquireUnDo(sfcbSem,PROV_INUSE(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error decreasing inuse semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
} else {
fprintf(stderr, "--- closeProviderContext not touching sem %d; already zero\n", PROV_INUSE(ctx->pAs[i].ids.procId));
}
- semRelease(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId));
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
}
if (ctx->pAs) free(ctx->pAs);
}
@@ -1023,15 +1035,30 @@
_SFCB_ENTER(TRACE_PROVIDERMGR, "setInuseSem");
if (sfcbSem < 0) { //Semaphore Not initialized.
semKey=ftok(SFCB_BINARY,'S');
- sfcbSem=semget(semKey,1, 0600);
+ if ((sfcbSem=semget(semKey,1, 0600)) < 0) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error getting semaphore set, reason: %s\n",
+ strerror(errno));
+ _SFCB_ABORT();
+ }
}
ids.ids=id;
- semAcquire(sfcbSem,PROV_GUARD(ids.procId));
- //semAcquire(sfcbSem,PROV_INUSE(ids.procId));
- //semReleaseUnDo(sfcbSem,PROV_INUSE(ids.procId));
- semRelease(sfcbSem,PROV_GUARD(ids.procId));
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_INUSE(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error increasing inuse semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
_SFCB_EXIT();
}
Index: providerDrv.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- providerDrv.c 6 Mar 2012 17:33:55 -0000 1.108
+++ providerDrv.c 7 Mar 2012 00:52:36 -0000 1.109
@@ -156,6 +156,9 @@
ProviderInfo *activProvs = NULL;
+static void increaseInUseSem(int id);
+static void decreaseInUseSem(int id);
+
unsigned long provSampleInterval=10;
unsigned long provTimeoutInterval=25;
unsigned provAutoGroup=0;
@@ -290,6 +293,52 @@
return count;
}
+static void increaseInUseSem(int id)
+{
+ _SFCB_ENTER(TRACE_PROVIDERDRV, "increaseInUseSem");
+
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_INUSE(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error increasing inuse semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_EXIT();
+}
+
+static void decreaseInUseSem(int id)
+{
+ _SFCB_ENTER(TRACE_PROVIDERDRV, "decreaseInUseSem");
+
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semGetValue(sfcbSem,PROV_INUSE(id)) > 0) {
+ if (semAcquireUnDo(sfcbSem,PROV_INUSE(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error decreasing inuse semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_EXIT();
+}
+
typedef struct _provLibAndTypes {
void* lib;
#define INST 1
@@ -474,8 +523,12 @@
if (pInfo) {
proc=curProvProc;
if (proc) {
- semAcquireUnDo(sfcbSem,PROV_GUARD(proc->id));
- if ((val=semGetValue(sfcbSem,PROV_INUSE(proc->id)))==0) {
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if ((val=semGetValue(sfcbSem,PROV_INUSE(proc->id)))==0) {
if ((now-proc->lastActivity)>provTimeoutInterval) {
ctx = native_new_CMPIContext(MEM_TRACKED,NULL);
noBreak=0;
@@ -542,7 +595,11 @@
}
}
}
- semRelease(sfcbSem,PROV_GUARD(proc->id));
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
}
}
}
@@ -692,19 +749,35 @@
for (i = 0; i < provProcMax; i++) {
if ((provProc+i) && provProc[i].pid &&
provProc[i].group && strcmp(provProc[i].group,info->group)==0) {
- semAcquire(sfcbSem,PROV_GUARD(provProc[i].id));
- semRelease(sfcbSem,PROV_INUSE(provProc[i].id));
- semRelease(sfcbSem,PROV_GUARD(provProc[i].id));
- info->pid=provProc[i].pid;
- info->providerSockets=provProc[i].providerSockets;
- _SFCB_TRACE(1,("--- Process %d shared by %s and %s",provProc[i].pid,info->providerName,
- provProc[i].firstProv->providerName));
- if (provProc[i].firstProv) info->next=provProc[i].firstProv;
- else info->next = NULL;
- provProc[i].firstProv=info;
- info->proc=provProc+i;
- if (info->unload<provProc[i].unload) provProc[i].unload=info->unload;
- _SFCB_RETURN(provProc[i].pid);
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ /* double checking pattern required to prevent race ! */
+ if ((provProc+i) && provProc[i].pid &&
+ provProc[i].group && strcmp(provProc[i].group,info->group)==0) {
+ info->pid=provProc[i].pid;
+ info->providerSockets=provProc[i].providerSockets;
+ _SFCB_TRACE(1,("--- Process %d shared by %s and %s",provProc[i].pid,info->providerName,
+ provProc[i].firstProv->providerName));
+ if (provProc[i].firstProv) info->next=provProc[i].firstProv;
+ else info->next = NULL;
+ provProc[i].firstProv=info;
+ info->proc=provProc+i;
+ if (info->unload<provProc[i].unload) provProc[i].unload=info->unload;
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_RETURN(provProc[i].pid);
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
}
}
}
@@ -761,13 +834,41 @@
providerProcess=1;
info->proc=*proc;
info->pid=currentProc;
-
- semSetValue(sfcbSem,PROV_GUARD((*proc)->id),0);
- semSetValue(sfcbSem,PROV_INUSE((*proc)->id),0);
- semSetValue(sfcbSem,PROV_ALIVE((*proc)->id),0);
- semReleaseUnDo(sfcbSem,PROV_ALIVE((*proc)->id));
- semReleaseUnDo(sfcbSem,PROV_INUSE((*proc)->id));
- semRelease(sfcbSem,PROV_GUARD((*proc)->id));
+
+ /* The guard semaphore may never increase beyond 1, unless it is relased more often than
+ acquired. Therefore it is cleaner to acquire it than to set it to 0 unconditionally,
+ which can lead to a race, but we will also check the value to be sure.
+ */
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semGetValue(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error, guard semaphore for %d is not zero\n",
+ (*proc)->id);
+ _SFCB_ABORT();
+ }
+ if (semSetValue(sfcbSem,PROV_INUSE((*proc)->id),0)) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting inuse semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semSetValue(sfcbSem,PROV_ALIVE((*proc)->id),0)) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting alive semaphore for %d, step 1, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_ALIVE((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting alive semaphore for %d, step 2, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
processProviderInvocationRequests(info->providerName);
_SFCB_RETURN(0);
@@ -797,17 +898,21 @@
if (info->pid ) {
proc=info->proc;
- semAcquire(sfcbSem,PROV_GUARD(proc->id));
- if ((val=semGetValue(sfcbSem,PROV_ALIVE(proc->id)))) {
- semRelease(sfcbSem,PROV_INUSE(proc->id));
- semRelease(sfcbSem,PROV_GUARD(proc->id));
- _SFCB_TRACE(1, ("--- Provider %s still loaded",info->providerName));
- _SFCB_RETURN(CMPI_RC_OK)
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if ((val=semGetValue(sfcbSem,PROV_ALIVE(proc->id))) > 0) {
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_TRACE(1, ("--- Provider %s still loaded",info->providerName));
+ _SFCB_RETURN(CMPI_RC_OK);
}
- semRelease(sfcbSem,PROV_GUARD(proc->id));
- _SFCB_TRACE(1, ("--- Provider has been unloaded prevously, will reload"));
-
info->pid=0;
for (pInfo=proc->firstProv; pInfo; pInfo=pInfo->next) {
pInfo->pid=0;
@@ -815,6 +920,14 @@
proc->firstProv=NULL;
proc->pid=0;
proc->group=NULL;
+
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_TRACE(1, ("--- Provider has been unloaded prevously, will reload"));
+
}
_SFCB_TRACE(1, ("--- Forking provider for %s", info->providerName));
@@ -2252,8 +2365,9 @@
_SFCB_TRACE(1, ("--- Back from provider rc: %d", rci.rc));
if (rci.rc==CMPI_RC_OK) {
- resp = (BinResponseHdr *) calloc(1,sizeof(BinResponseHdr));
- resp->rc=1;
+ increaseInUseSem(info->provIds.procId);
+ resp = (BinResponseHdr *) calloc(1,sizeof(BinResponseHdr));
+ resp->rc=1;
}
}
@@ -2319,8 +2433,9 @@
}
TIMING_STOP(hdr,info)
if (rci.rc==CMPI_RC_OK) {
- resp->rc=1;
- _SFCB_RETURN(resp);
+ decreaseInUseSem(info->provIds.procId);
+ resp->rc=1;
+ _SFCB_RETURN(resp);
}
if (resp) free(resp);
@@ -2366,8 +2481,8 @@
}
if (rci.rc==CMPI_RC_OK) {
- resp = (BinResponseHdr *) calloc(1,sizeof(BinResponseHdr));
- resp->rc=1;
+ resp = (BinResponseHdr *) calloc(1,sizeof(BinResponseHdr));
+ resp->rc=1;
}
if (rci.rc!=CMPI_RC_OK) {
resp = errorResp(&rci);
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.730
retrieving revision 1.731
diff -u -d -r1.730 -r1.731
--- ChangeLog 6 Mar 2012 17:33:55 -0000 1.730
+++ ChangeLog 7 Mar 2012 00:52:36 -0000 1.731
@@ -1,6 +1,10 @@
2012-03-06 Chris Buccella <buc...@li...>
* providerDrv.c, providerMgr.c:
+ [ 3497950 ] SFCB Semaphore Handling Improvements
+ (patch by Viktor Mihajlovski)
+
+ * providerDrv.c, providerMgr.c:
[ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
(patch by Viktor Mihajlovski)
|
|
From: Michael Chase-S. <mc...@us...> - 2012-03-06 23:04:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 3ed344550a9d63787266bfbf8e1a942fbdb828de (commit)
via eb37fafe658b597f2d9bf2d183a7a760f7ac5fe7 (commit)
via 2fb79cfb4116761b6f51ea714971f4ec8566b5e0 (commit)
from 0d2442510d80a84be391c1ccdfccd540c3296c13 (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 3ed344550a9d63787266bfbf8e1a942fbdb828de
Author: Michael Chase-Salerno <br...@li...>
Date: Tue Mar 6 18:04:09 2012 -0500
[ 3498044 ] RIEnabled conflicts with settable retries
commit eb37fafe658b597f2d9bf2d183a7a760f7ac5fe7
Merge: 2fb79cf 0d24425
Author: Michael Chase-Salerno <br...@li...>
Date: Tue Mar 6 18:02:21 2012 -0500
Merge branch 'master' of ssh://sblim.git.sourceforge.net/gitroot/sblim/sfcb
commit 2fb79cfb4116761b6f51ea714971f4ec8566b5e0
Author: Michael Chase-Salerno <br...@li...>
Date: Tue Mar 6 18:01:01 2012 -0500
3498044 RIEnabled conflicts with settable retries
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 63fa2d8..c6154ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-01 Michael Chase-Salerno <br...@li...>
+
+ * indCIMXMLHandler.c:
+ [ 3498044 ] RIEnabled conflicts with settable retries
+
2012-03-06 Chris Buccella <buc...@li...>
* providerDrv.c, providerMgr.c:
@@ -20,7 +25,7 @@
2012-03-01 Michael Chase-Salerno <br...@li...>
- * indCIMXMLHandler.c, indRetryTest.sh
+ * indCIMXMLHandler.c, indRetryTest.sh:
[ 3484083] Exclude SFCBIndicationID
2012-03-01 Chris Buccella <buc...@li...>
diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c
index 5dfeb0b..053f1bb 100644
--- a/indCIMXMLHandler.c
+++ b/indCIMXMLHandler.c
@@ -957,14 +957,18 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi,
if (strcasecmp(methodName, "_deliver") == 0) {
+#ifndef SETTABLERETRY
// On the first indication, check if reliable indications are enabled.
if (RIEnabled == -1) {
+#endif
CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL);
CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
CMPIData isinst=CMGetNext(isenm,NULL);
CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
RIEnabled=mc.value.uint16;
+#ifndef SETTABLERETRY
}
+#endif
CMPIInstance *indo=CMGetArg(in,"indication",NULL).value.inst;
CMPIInstance *ind=CMClone(indo,NULL);
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-06 22:52:39
|
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 0d2442510d80a84be391c1ccdfccd540c3296c13 (commit)
from c7aea3d3eeda8b9d80fea5f14b0e00e18fdd73db (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 0d2442510d80a84be391c1ccdfccd540c3296c13
Author: buccella <buc...@li...>
Date: Tue Mar 6 17:53:13 2012 -0500
[ 3497950 ] SFCB Semaphore Handling Improvements
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index afdb7c0..63fa2d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
2012-03-06 Chris Buccella <buc...@li...>
* providerDrv.c, providerMgr.c:
+ [ 3497950 ] SFCB Semaphore Handling Improvements
+ (patch by Viktor Mihajlovski)
+
+ * providerDrv.c, providerMgr.c:
[ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
(patch by Viktor Mihajlovski)
diff --git a/NEWS b/NEWS
index 26ff00c..f394344 100644
--- a/NEWS
+++ b/NEWS
@@ -107,6 +107,7 @@ Bugs Fixed:
- 3496061 IndicationSubscription May Be Undeletable
- 3496383 Faster Return from CBDeliverIndication
- 3497765 Better Error Handling in sfcb Provider Manager and Driver
+- 3497950 SFCB Semaphore Handling Improvements
Changes in 1.3.13
=================
diff --git a/providerDrv.c b/providerDrv.c
index d0b202b..f7f1e2e 100644
--- a/providerDrv.c
+++ b/providerDrv.c
@@ -161,6 +161,9 @@ static int idleThreadStartHandled = 0;
ProviderInfo *activProvs = NULL;
+static void increaseInUseSem(int id);
+static void decreaseInUseSem(int id);
+
unsigned long provSampleInterval = 10;
unsigned long provTimeoutInterval = 25;
unsigned provAutoGroup = 0;
@@ -372,6 +375,52 @@ stopNextProc()
return count;
}
+ static void increaseInUseSem(int id)
+ {
+ _SFCB_ENTER(TRACE_PROVIDERDRV, "increaseInUseSem");
+
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_INUSE(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error increasing inuse semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_EXIT();
+ }
+
+ static void decreaseInUseSem(int id)
+ {
+ _SFCB_ENTER(TRACE_PROVIDERDRV, "decreaseInUseSem");
+
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semGetValue(sfcbSem,PROV_INUSE(id)) > 0) {
+ if (semAcquireUnDo(sfcbSem,PROV_INUSE(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error decreasing inuse semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_EXIT();
+ }
+
typedef struct _provLibAndTypes {
void* lib;
#define INST 1
@@ -565,8 +614,12 @@ providerIdleThread()
if (pInfo) {
proc = curProvProc;
if (proc) {
- semAcquireUnDo(sfcbSem, PROV_GUARD(proc->id));
- if ((val = semGetValue(sfcbSem, PROV_INUSE(proc->id))) == 0) {
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if ((val=semGetValue(sfcbSem,PROV_INUSE(proc->id)))==0) {
/* providerTimeoutInterval reached? */
if ((now - proc->lastActivity) > provTimeoutInterval) {
ctx = native_new_CMPIContext(MEM_TRACKED, NULL);
@@ -654,7 +707,11 @@ providerIdleThread()
}
}
}
- semRelease(sfcbSem, PROV_GUARD(proc->id));
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
}
}
}
@@ -824,24 +881,35 @@ getProcess(ProviderInfo * info, ProviderProcess ** proc)
if ((provProc + i) && provProc[i].pid &&
provProc[i].group
&& strcmp(provProc[i].group, info->group) == 0) {
- semAcquire(sfcbSem, PROV_GUARD(provProc[i].id));
- semRelease(sfcbSem, PROV_INUSE(provProc[i].id));
- semRelease(sfcbSem, PROV_GUARD(provProc[i].id));
- info->pid = provProc[i].pid;
- info->providerSockets = provProc[i].providerSockets;
- _SFCB_TRACE(1,
- ("--- Process %d shared by %s and %s", provProc[i].pid,
- info->providerName,
- provProc[i].firstProv->providerName));
- if (provProc[i].firstProv)
- info->next = provProc[i].firstProv;
- else
- info->next = NULL;
- provProc[i].firstProv = info;
- info->proc = provProc + i;
- if (info->unload < provProc[i].unload)
- provProc[i].unload = info->unload;
- _SFCB_RETURN(provProc[i].pid);
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ /* double checking pattern required to prevent race ! */
+ if ((provProc+i) && provProc[i].pid &&
+ provProc[i].group && strcmp(provProc[i].group,info->group)==0) {
+ info->pid=provProc[i].pid;
+ info->providerSockets=provProc[i].providerSockets;
+ _SFCB_TRACE(1,("--- Process %d shared by %s and %s",provProc[i].pid,info->providerName,
+ provProc[i].firstProv->providerName));
+ if (provProc[i].firstProv) info->next=provProc[i].firstProv;
+ else info->next = NULL;
+ provProc[i].firstProv=info;
+ info->proc=provProc+i;
+ if (info->unload<provProc[i].unload) provProc[i].unload=info->unload;
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_RETURN(provProc[i].pid);
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(provProc[i].id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ provProc[i].id, strerror(errno));
+ _SFCB_ABORT();
+ }
}
}
}
@@ -902,12 +970,40 @@ getProcess(ProviderInfo * info, ProviderProcess ** proc)
info->proc = *proc;
info->pid = currentProc;
- semSetValue(sfcbSem, PROV_GUARD((*proc)->id), 0);
- semSetValue(sfcbSem, PROV_INUSE((*proc)->id), 0);
- semSetValue(sfcbSem, PROV_ALIVE((*proc)->id), 0);
- semReleaseUnDo(sfcbSem, PROV_ALIVE((*proc)->id));
- semReleaseUnDo(sfcbSem, PROV_INUSE((*proc)->id));
- semRelease(sfcbSem, PROV_GUARD((*proc)->id));
+ /* The guard semaphore may never increase beyond 1, unless it is relased more often than
+ acquired. Therefore it is cleaner to acquire it than to set it to 0 unconditionally,
+ which can lead to a race, but we will also check the value to be sure.
+ */
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semGetValue(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error, guard semaphore for %d is not zero\n",
+ (*proc)->id);
+ _SFCB_ABORT();
+ }
+ if (semSetValue(sfcbSem,PROV_INUSE((*proc)->id),0)) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting inuse semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semSetValue(sfcbSem,PROV_ALIVE((*proc)->id),0)) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting alive semaphore for %d, step 1, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_ALIVE((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error resetting alive semaphore for %d, step 2, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD((*proc)->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ (*proc)->id, strerror(errno));
+ _SFCB_ABORT();
+ }
processProviderInvocationRequests(info->providerName);
_SFCB_RETURN(0);
@@ -939,17 +1035,20 @@ forkProvider(ProviderInfo * info, char **msg)
if (info->pid) {
proc = info->proc;
- semAcquire(sfcbSem, PROV_GUARD(proc->id));
- if ((val = semGetValue(sfcbSem, PROV_ALIVE(proc->id)))) {
- semRelease(sfcbSem, PROV_INUSE(proc->id));
- semRelease(sfcbSem, PROV_GUARD(proc->id));
- _SFCB_TRACE(1, ("--- Provider %s still loaded", info->providerName));
- _SFCB_RETURN(CMPI_RC_OK)
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if ((val=semGetValue(sfcbSem,PROV_ALIVE(proc->id))) > 0) {
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_TRACE(1, ("--- Provider %s still loaded",info->providerName));
+ _SFCB_RETURN(CMPI_RC_OK);
}
-
- semRelease(sfcbSem, PROV_GUARD(proc->id));
- _SFCB_TRACE(1,
- ("--- Provider has been unloaded prevously, will reload"));
info->pid = 0;
for (pInfo = proc->firstProv; pInfo; pInfo = pInfo->next) {
@@ -958,6 +1057,13 @@ forkProvider(ProviderInfo * info, char **msg)
proc->firstProv = NULL;
proc->pid = 0;
proc->group = NULL;
+
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(proc->id))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ proc->id, strerror(errno));
+ _SFCB_ABORT();
+ }
+ _SFCB_TRACE(1, ("--- Provider has been unloaded prevously, will reload"));
}
_SFCB_TRACE(1, ("--- Forking provider for %s", info->providerName));
@@ -2635,6 +2741,7 @@ activateFilter(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
_SFCB_TRACE(1, ("--- Back from provider rc: %d", rci.rc));
if (rci.rc == CMPI_RC_OK) {
+ increaseInUseSem(info->provIds.procId);
resp = (BinResponseHdr *) calloc(1, sizeof(BinResponseHdr));
resp->rc = 1;
}
@@ -2716,7 +2823,8 @@ deactivateFilter(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
"", path, 1);
}
TIMING_STOP(hdr, info)
- if (rci.rc == CMPI_RC_OK) {
+ if (rci.rc == CMPI_RC_OK) {
+ decreaseInUseSem(info->provIds.procId);
resp->rc = 1;
_SFCB_RETURN(resp);
}
diff --git a/providerMgr.c b/providerMgr.c
index ff29cc0..a075af2 100644
--- a/providerMgr.c
+++ b/providerMgr.c
@@ -1052,15 +1052,27 @@ closeProviderContext(BinRequestContext * ctx)
int i = 0;
_SFCB_ENTER(TRACE_PROVIDERMGR, "closeProviderContext");
for (i = 0; i < ctx->pCount; i++) {
- semAcquire(sfcbSem, PROV_GUARD(ctx->pAs[i].ids.procId));
- if (semGetValue(sfcbSem, PROV_INUSE(ctx->pAs[i].ids.procId)) != 0) {
- semAcquire(sfcbSem, PROV_INUSE(ctx->pAs[i].ids.procId));
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if(semGetValue(sfcbSem, PROV_INUSE(ctx->pAs[i].ids.procId)) > 0) {
+ if (semAcquireUnDo(sfcbSem,PROV_INUSE(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error decreasing inuse semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
} else {
fprintf(stderr,
"--- closeProviderContext not touching sem %d; already zero\n",
PROV_INUSE(ctx->pAs[i].ids.procId));
}
- semRelease(sfcbSem, PROV_GUARD(ctx->pAs[i].ids.procId));
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(ctx->pAs[i].ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ ctx->pAs[i].ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
}
if (ctx->pAs)
free(ctx->pAs);
@@ -1075,15 +1087,30 @@ setInuseSem(void *id)
_SFCB_ENTER(TRACE_PROVIDERMGR, "setInuseSem");
if (sfcbSem < 0) { // Semaphore Not initialized.
semKey = ftok(SFCB_BINARY, 'S');
- sfcbSem = semget(semKey, 1, 0600);
+ if ((sfcbSem=semget(semKey,1, 0600)) < 0) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error getting semaphore set, reason: %s\n",
+ strerror(errno));
+ _SFCB_ABORT();
+ }
}
ids.ids = id;
- semAcquire(sfcbSem, PROV_GUARD(ids.procId));
- // semAcquire(sfcbSem,PROV_INUSE(ids.procId));
- // semReleaseUnDo(sfcbSem,PROV_INUSE(ids.procId));
- semRelease(sfcbSem, PROV_GUARD(ids.procId));
+ if (semAcquireUnDo(sfcbSem,PROV_GUARD(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error acquiring semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_INUSE(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error increasing inuse semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
+ if (semReleaseUnDo(sfcbSem,PROV_GUARD(ids.procId))) {
+ mlogf(M_ERROR,M_SHOW,"-#- Fatal error releasing semaphore for %d, reason: %s\n",
+ ids.procId, strerror(errno));
+ _SFCB_ABORT();
+ }
_SFCB_EXIT();
}
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-06 20:21:33
|
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 c7aea3d3eeda8b9d80fea5f14b0e00e18fdd73db (commit)
via 9397bdf60022646c8eca8eb2533f6d340b97b75f (commit)
from cfbfd79f009a11a272c4edd1e281743bd597044a (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 c7aea3d3eeda8b9d80fea5f14b0e00e18fdd73db
Merge: 9397bdf cfbfd79
Author: buccella <buc...@li...>
Date: Tue Mar 6 15:22:10 2012 -0500
merge Changelog and NEWS
commit 9397bdf60022646c8eca8eb2533f6d340b97b75f
Author: buccella <buc...@li...>
Date: Tue Mar 6 15:20:04 2012 -0500
[ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 39189b2..afdb7c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-06 Chris Buccella <buc...@li...>
+
+ * providerDrv.c, providerMgr.c:
+ [ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
+ (patch by Viktor Mihajlovski)
+
2012-03-06 Dave Heller <hel...@us...>
* extra/sfcb-ps:
diff --git a/NEWS b/NEWS
index d64b625..26ff00c 100644
--- a/NEWS
+++ b/NEWS
@@ -106,6 +106,7 @@ Bugs Fixed:
- 3495801 Correction to 3495343
- 3496061 IndicationSubscription May Be Undeletable
- 3496383 Faster Return from CBDeliverIndication
+- 3497765 Better Error Handling in sfcb Provider Manager and Driver
Changes in 1.3.13
=================
diff --git a/providerDrv.c b/providerDrv.c
index 038f16e..d0b202b 100644
--- a/providerDrv.c
+++ b/providerDrv.c
@@ -3163,6 +3163,7 @@ processProviderInvocationRequestsThread(void *prms)
requestor = 0,
initRc = 0;
char *errstr = NULL;
+ char msg[1024];
_SFCB_ENTER(TRACE_PROVIDERDRV,
"processProviderInvocationRequestsThread");
@@ -3180,14 +3181,30 @@ processProviderInvocationRequestsThread(void *prms)
if (req->operation != OPS_LoadProvider) {
if (req->provId == NULL) {
- mlogf(M_ERROR, M_SHOW,
- "-#- no provider id specified for request --- terminating process.\n");
+ mlogf(M_ERROR,M_SHOW,"-#- no provider id specified for request --- terminating process (%d).\n", currentProc);
+ snprintf(msg,1023, "*** Provider id not specified (%d), exiting",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
exit(-1);
}
/* Update lastActivity time for the process and for
* the specific provider being requested. */
time(&curProvProc->lastActivity);
+
+ if (activProvs == NULL) {
+ /* only load provider allowed, exiting should allow for recovery via reload */
+ mlogf(M_ERROR,M_SHOW,"-#- potential race condition in provider reload --- terminating process (%d).\n", currentProc);
+ snprintf(msg,1023, "*** Provider not yet loaded (%d), exiting",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
+ exit(-1);
+ }
+
for (pInfo = activProvs; pInfo; pInfo = pInfo->next) {
if (pInfo->provIds.ids == req->provId) {
pInfo->lastActivity = curProvProc->lastActivity;
@@ -3195,9 +3212,17 @@ processProviderInvocationRequestsThread(void *prms)
}
}
if (pInfo == NULL) {
- mlogf(M_ERROR, M_SHOW,
- "-#- Serious provider id / provider process mismatch --- terminating process.\n");
- exit(-1);
+ /* probably a race, however this provider is still alive, keep it running */
+ mlogf(M_ERROR,M_SHOW,"-#- misdirected provider request (%d) --- skipping request, keep process (%d).\n", req->operation, currentProc);
+ if (req->operation == OPS_InvokeMethod) {
+ fprintf(stderr,"method: %s",(char*)((InvokeMethodReq*)req)->method.data);
+ }
+ snprintf(msg,1023, "*** Misdirected provider request (%d)",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
+ _SFCB_RETURN(NULL);
}
if (pInfo->library == NULL) {
diff --git a/providerMgr.c b/providerMgr.c
index f75a212..ff29cc0 100644
--- a/providerMgr.c
+++ b/providerMgr.c
@@ -717,11 +717,10 @@ assocProviderList(int *requestor, OperationHdr * req)
*/
mlogf(M_ERROR, M_SHOW,
"--- forkProvider failed for defaultProvider\n");
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- * NULL, req->options);
- */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
} else {
spSendCtlResult(requestor, &sfcbSockets.send, MSG_X_PROVIDER_NOT_FOUND,
@@ -796,15 +795,15 @@ static void
classProvider(int *requestor, OperationHdr * req)
{
int rc;
+ int dmy;
_SFCB_ENTER(TRACE_PROVIDERMGR, "classProvider");
rc = forkProvider(classProvInfoPtr, NULL);
if (rc != CMPI_RC_OK) {
mlogf(M_ERROR, M_SHOW, "--- forkProvider failed in classProvider\n");
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0, NULL,
- * req->options);
- */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
_SFCB_TRACE(1, ("--- result %d-%lu to with %d-%lu",
@@ -822,15 +821,15 @@ static void
qualiProvider(int *requestor, OperationHdr * req)
{
int rc;
+ int dmy;
_SFCB_ENTER(TRACE_PROVIDERMGR, "qualiProvider");
rc = forkProvider(qualiProvInfoPtr, NULL);
if (rc != CMPI_RC_OK) {
mlogf(M_ERROR, M_SHOW, "--- forkProvider failed in qualiProvider\n");
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0, NULL,
- * req->options);
- */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
_SFCB_TRACE(1, ("--- result %d-%lu to with %d-%lu",
*requestor, getInode(*requestor),
@@ -903,11 +902,8 @@ _methProvider(BinRequestContext * ctx, OperationHdr * req)
if (rc != CMPI_RC_OK) {
mlogf(M_ERROR, M_SHOW,
"--- forkProvider failed in _methProvider (%s)\n", className);
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- * NULL, req->options);
- */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
ctx->provA.ids = getProvIds(classProvInfoPtr);
ctx->provA.socket = classProvInfoPtr->providerSockets.send;
@@ -918,11 +914,8 @@ _methProvider(BinRequestContext * ctx, OperationHdr * req)
if (rc != CMPI_RC_OK) {
mlogf(M_ERROR, M_SHOW,
"--- forkProvider failed in _methProvider (%s)\n", className);
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- * NULL, req->options);
- */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
ctx->provA.ids = getProvIds(interOpProvInfoPtr);
ctx->provA.socket = interOpProvInfoPtr->providerSockets.send;
@@ -936,10 +929,6 @@ _methProvider(BinRequestContext * ctx, OperationHdr * req)
_SFCB_RETURN(MSG_X_PROVIDER);
} else {
mlogf(M_ERROR, M_SHOW, "--- _methProvider NOT FOUND\n");
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- * NULL, req->options);
- */
_SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
}
@@ -1335,9 +1324,11 @@ intInvokeProvider(BinRequestContext * ctx, ComSockets sockets)
if (resp)
free(resp);
resp = NULL;
- // spRecvResult(&resultSockets.receive, &fromS, (void**) &resp,
- // &size);
- spRecvResult(&sockets.receive, &fromS, (void **) &resp, &size);
+
+ if (spRecvResult(&sockets.receive, &fromS, (void**) &resp, &size) < 0) {
+ size = 0; /* force failure handling */
+ }
+
/*
* nothing received -- construct a failure response
*/
@@ -1365,9 +1356,10 @@ intInvokeProvider(BinRequestContext * ctx, ComSockets sockets)
}
else if ((ctx->noResp & 1) == 0) {
- // spRecvResult(&resultSockets.receive, &fromS, (void **) &resp,
- // &size);
- spRecvResult(&sockets.receive, &fromS, (void **) &resp, &size);
+
+ if (spRecvResult(&sockets.receive, &fromS, (void **) &resp, &size) < 0) {
+ size = 0; /* force failure case */
+ }
/*
* nothing received -- construct a failure response
@@ -1522,7 +1514,7 @@ getConstClass(const char *ns, const char *cn)
irc = getProviderContext(&binCtx);
- if (irc) {
+ if (irc == MSG_X_PROVIDER) {
_SFCB_TRACE(1, ("--- Invoking Provider"));
resp = invokeProvider(&binCtx);
resp->rc--;
@@ -1532,8 +1524,11 @@ getConstClass(const char *ns, const char *cn)
memAdd(ccl, &x);
} else
ccl = NULL;
- } else
- ccl = NULL;
+ } else {
+ mlogf(M_ERROR,M_SHOW,"-- no provider context getConstClass(%s:%s)\n",
+ ns, cn);
+ ccl = NULL; /* sufficient error indication ? */
+ }
unlockUpCall(Broker);
@@ -1571,11 +1566,8 @@ _getConstClass(const char *ns, const char *cn, CMPIStatus *st)
if (irc != CMPI_RC_OK) {
mlogf(M_ERROR, M_SHOW,
"--- forkProvider failed in _getConstClass(%s:%s)\n", ns, cn);
- /*
- * spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0, NULL,
- * req->options);
- */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(NULL);
}
memset(&binCtx, 0, sizeof(BinRequestContext));
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Dave H. <hel...@us...> - 2012-03-06 18:25:21
|
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 cfbfd79f009a11a272c4edd1e281743bd597044a (commit)
from 9c1c5431b1d58f1a29c184565b6557e0b00c4000 (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 cfbfd79f009a11a272c4edd1e281743bd597044a
Author: Dave Heller <hel...@us...>
Date: Tue Mar 6 13:05:01 2012 -0500
[ 3497831 ] Updates to sfcb-ps test script
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 40a8adc..39189b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-06 Dave Heller <hel...@us...>
+
+ * extra/sfcb-ps:
+ [ 3497831 ] Updates to sfcb-ps test script
+
2012-03-02 Chris Buccella <buc...@li...>
* interopProvider.c:
diff --git a/NEWS b/NEWS
index 8b5fb28..d64b625 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Everything in 1.3.13 and 1.3.14, plus:
New features:
- 3441679 Add a feature to validate CMPI types
+- 3497831 Updates to sfcb-ps test script
Bugs fixed:
- 3495804 Cleanup: httpProcId still defined, wrong define in cimXmlGen
diff --git a/extra/sfcb-ps b/extra/sfcb-ps
index 16fcec8..ba15f95 100755
--- a/extra/sfcb-ps
+++ b/extra/sfcb-ps
@@ -13,12 +13,12 @@
#
# Author: Mark Lanzo <ma...@us...>
#
-# Description: Scan running SFCB processes,
+# Description: Scan running SFCB processes,
# and figure out which ones are which, as best we can.
#
# This script is designed to run in embedded environments
# This means that a very limited subset of Unix commands and shell features
-# are used, because we stick to things known to be available in a reduced
+# are used, because we stick to things known to be available in a reduced
# shell environment. This does limit the capability somewhat.
#
##############################################################################
@@ -46,7 +46,7 @@ $N - Attempt to identify SFCB co-processes.
those processes.
Caution: Determination is not always 100% accurate. In particular,
- the Main process is determined by seeing if the process is also the
+ the Main process is determined by seeing if the process is also the
process group leader (its PID equals its PGID) - a condition which
is true if SFCB was started as a daemon (normal mode) but which may
not apply if SFCB was started in the foreground (developer mode).
@@ -58,9 +58,14 @@ Options:
-raw Scan for sfcbd processes and print process ID info, but don't
otherwise attempt to classify the processes.
- -main Specify the main sfcb process ID when not running in daemon
+ -main Specify the main sfcb process ID when not running in daemon
mode. Experimental.
+ -useproc Use /proc fs to gather as much data as possible, rather than
+ relying on userspace commnads or options that may not be
+ avaliable in a small footprint environment.
+
+ -maps Print memory maps for any Unknown processes
HELP
exit 0
@@ -75,6 +80,16 @@ check_arg ()
MAIN_PID=unknown
RAW_PS=
+PRINT_MAPS=
+
+# If ps options are not supported, run in -useproc mode. First check for error
+# rc from ps, then double check the header line for the the requested option.
+if ! ps -e >/dev/null 2>&1 || [ -z "$(ps -e -o pgid|head -n1|grep -i pgid)" ]
+then
+ USE_PROC=true
+else
+ USE_PROC=
+fi
while [ $# -gt 0 ] ; do
case "$1" in
@@ -90,6 +105,12 @@ while [ $# -gt 0 ] ; do
-raw)
RAW_PS=true ;;
+ -useproc)
+ USE_PROC=true ;;
+
+ -maps)
+ PRINT_MAPS=true ;;
+
-*)
die "Invalid option '$1'"
;;
@@ -101,14 +122,30 @@ while [ $# -gt 0 ] ; do
shift
done
+if [ -n "$USE_PROC" ] ; then
+ # For busybox ps
+ PS_INFO=$(ps | grep '[s]fcbd')
+else
+ # Get everything from (standard) ps command
+ PS_INFO=$(ps -e -o pid,ppid,pgid,stat,cmd | grep '[s]fcbd')
+fi
+
if [ -n "$RAW_PS" ] ; then
printf "%5s %5s %5s %-4s %s\n" PID PPID PGID STAT CMD
- ps -e -o pid,ppid,pgid,stat,cmd | grep 'sfcbd'
+
+ if [ -n "$USE_PROC" ] ; then
+ echo "$PS_INFO" | while read pid user vsz stat cmd ; do
+ # We cannot get ppid & pgid from busybox ps so get them
+ # from /proc instead
+ read pid comm state ppid pgid therest < /proc/$pid/stat
+ printf "%5s %5s %5s %-4s %s\n" $pid $ppid $pgid $stat "$cmd"
+ done
+ else
+ echo "$PS_INFO"
+ fi
exit 0
fi
-PS_INFO=$(ps -e -o pid,ppid,pgid,stat,cmd | grep 'sfcbd')
-
if [ -z "$PS_INFO" ] ; then
echo "No SFCB Processes found."
exit 0
@@ -116,8 +153,35 @@ fi
printf "%5s %5s %5s %-6s %s\n" PID PPID PGID STATE ROLE
+# Really, in the case of -useproc we are expecting busybox ps, where the 2nd &
+# 3rd fields will not be ppid & pgid. But it does not matter because we update
+# with the correct values from /proc.
echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
- # If we launched as a daemon, then the top level process is the process
+
+ if [ -n "$USE_PROC" ] ; then
+
+ if [ ! -e "/proc/$pid/stat" ] ; then
+ role="process already gone."
+ printf "%5d %5s %5s %-6s %s\n" "$pid" "-" "-" "$stat" "$role"
+ break
+ fi
+ # Get ppid, pgid from /proc
+ read pid comm state ppid pgid therest < /proc/$pid/stat
+
+ # Workaround lack of lsof support in some environments.
+ # Find inode of socket listening on http or https ports
+ # Determine if this pid has the socket open by checking for the
+ # socket inode in the fd list.
+ SOCKET_TEST="`cat /proc/net/tcp* | grep ":176[45]" | \
+ grep -o '\:\([0-9,A-F]\{8\} \)\{2\}\( *[0-9]*\)\{3\}' | \
+ grep -o ' [0-9]*$' | \
+ while read inode; do ls -l /proc/$pid/fd/ | grep $inode; done`"
+ else
+ # Use standard lsof for socket test
+ SOCKET_TEST="`lsof -n -w -a -i :5988 -i :5989 -p $pid`"
+ fi
+
+ # If we launched as a daemon, then the top level process is the process
# group leader, so it is easy to identify.
#
# If not launched as a daemon, we have to be told how to recognize
@@ -134,7 +198,7 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
# Again, this requires that we be told who the master process is,
# if we weren't launched as a daemon.
- elif [ -n "`lsof -n -w -a -i :5988 -i :5989 -p $pid`" ] ; then
+ elif [ -n "$SOCKET_TEST" ] ; then
if [ "$ppid" = "$pgid" -o \
"$ppid" = "$MAIN_PID" ] ; then
role="Http Daemon"
@@ -143,17 +207,17 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
fi
# SFCB opens up a huge number of sockets (like 100+!) before launching any
- # of its child processes, -except- that it launches it logger process
+ # of its child processes, -except- that it launches it logger process
# prior to opening the sockets. So the logger has a more normal count
# of processes. Here, we make the guess that if it has less than 8
- # files open, it is the logger process (in fact it probably has about 4).
+ # files open, it is the logger process (in fact it probably has about 4).
# Heuristics like this are bad, but I don't know any other way to reliably
# identify the logger process.
else
open_fd=$(ls /proc/$pid/fd 2> /dev/null | wc -w)
- # If we get 0 from above, the process must have gone away, so
+ # If we get 0 from above, the process must have gone away, so
# don't bother reporting it. It was probably an HTTP request
# handler.
@@ -169,7 +233,7 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
fi
# Beyond this point, we can identify provider processes, but only by
- # scanning the shared libraries they have loaded and looking for
+ # scanning the shared libraries they have loaded and looking for
# specific shared libraries which carry that provider's code. Which
# means knowing a priori the names of those specific libraries.
#
@@ -181,7 +245,7 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
if [ -z "$role" ] ; then
- # Cache contents of /proc/$pid/maps for efficiency, and also
+ # Cache contents of /proc/$pid/maps for efficiency, and also
# in case the process vanishes while we are poking around.
MAP=`cat /proc/$pid/maps 2>/dev/null`
@@ -201,6 +265,8 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
role="SFCB Internal Provider"
elif echo "$MAP" | grep -q 'sfcInteropServerProvider' ; then
role="SFCB Interop Server Provider"
+ elif echo "$MAP" | grep -q 'Provider.so' ; then
+ role=$(echo "$MAP" | grep -o '[^/]*Provider' | head -n1)
else
# Most likely it is another provider, but it could also
# be Main if we couldn't figure that out on our own.
@@ -210,6 +276,10 @@ echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do
if [ -n "$role" ] ; then
printf "%5d %5d %5d %-6s %s\n" "$pid" "$ppid" "$pgid" "$stat" "$role"
+ # Output may aid in manually identifying the process.
+ if [ "$role" = "Unknown" -a -n "$PRINT_MAPS" ]; then
+ cat /proc/$pid/maps
+ fi
fi
done
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|
|
From: Chris B. <buc...@us...> - 2012-03-06 17:33:57
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv7671
Modified Files:
providerDrv.c providerMgr.c ChangeLog NEWS
Log Message:
[ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.652
retrieving revision 1.653
diff -u -d -r1.652 -r1.653
--- NEWS 5 Mar 2012 19:13:01 -0000 1.652
+++ NEWS 6 Mar 2012 17:33:55 -0000 1.653
@@ -43,6 +43,7 @@
- 3496383 Faster Return from CBDeliverIndication
- 3416060 sigsegv in tool_mm_flush()
- 3497096 double free during stopProc
+- 3497765 Better Error Handling in sfcb Provider Manager and Driver
Changes in 1.3.13
=================
Index: providerMgr.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- providerMgr.c 5 Mar 2012 19:11:54 -0000 1.78
+++ providerMgr.c 6 Mar 2012 17:33:55 -0000 1.79
@@ -666,9 +666,10 @@
{
/* Oops, even creation of the default provider failed */
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed for defaultProvider\n");
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
}
else {
@@ -742,14 +743,16 @@
static void classProvider(int *requestor, OperationHdr * req)
{
int rc;
+ int dmy;
_SFCB_ENTER(TRACE_PROVIDERMGR, "classProvider");
rc = forkProvider(classProvInfoPtr, req, NULL);
if (rc != CMPI_RC_OK)
{
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed in classProvider\n");
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
_SFCB_TRACE(1,("--- result %d-%lu to with %d-%lu",
@@ -765,14 +768,16 @@
static void qualiProvider(int *requestor, OperationHdr * req)
{
int rc;
+ int dmy;
_SFCB_ENTER(TRACE_PROVIDERMGR, "qualiProvider");
rc = forkProvider(qualiProvInfoPtr, req, NULL);
if (rc != CMPI_RC_OK)
{
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed in qualiProvider\n");
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
+ NULL, req->options);
+ // _SFCB_ABORT();
+ _SFCB_EXIT();
}
_SFCB_TRACE(1,("--- result %d-%lu to with %d-%lu",
*requestor,getInode(*requestor),
@@ -842,9 +847,8 @@
if (rc != CMPI_RC_OK)
{
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed in _methProvider (%s)\n", className);
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
ctx->provA.ids = getProvIds(classProvInfoPtr);
ctx->provA.socket = classProvInfoPtr->providerSockets.send;
@@ -856,9 +860,8 @@
if (rc != CMPI_RC_OK)
{
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed in _methProvider (%s)\n", className);
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
ctx->provA.ids = getProvIds(interOpProvInfoPtr);
ctx->provA.socket = interOpProvInfoPtr->providerSockets.send;
@@ -874,8 +877,6 @@
}
else {
mlogf(M_ERROR,M_SHOW,"--- _methProvider NOT FOUND\n");
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
_SFCB_RETURN(MSG_X_PROVIDER_NOT_FOUND);
}
}
@@ -1237,7 +1238,9 @@
if (resp) free(resp);
resp=NULL;
// spRecvResult(&resultSockets.receive, &fromS, (void**) &resp, &size);
- spRecvResult(&sockets.receive, &fromS, (void**) &resp, &size);
+ if (spRecvResult(&sockets.receive, &fromS, (void**) &resp, &size) < 0) {
+ size = 0; /* force failure handling */
+ }
/* nothing received -- construct a failure response */
if (resp == NULL || size == 0) {
resp = calloc(sizeof(BinResponseHdr),1);
@@ -1262,7 +1265,9 @@
else if ((ctx->noResp & 1)==0) {
// spRecvResult(&resultSockets.receive, &fromS, (void **) &resp, &size);
- spRecvResult(&sockets.receive, &fromS, (void **) &resp, &size);
+ if (spRecvResult(&sockets.receive, &fromS, (void **) &resp, &size) < 0) {
+ size = 0; /* force failure case */
+ }
/* nothing received -- construct a failure response */
if (resp == NULL || size == 0) {
@@ -1417,7 +1422,7 @@
irc = getProviderContext(&binCtx, &req);
- if (irc) {
+ if (irc == MSG_X_PROVIDER) {
_SFCB_TRACE(1, ("--- Invoking Provider"));
resp = invokeProvider(&binCtx);
resp->rc--;
@@ -1428,7 +1433,11 @@
}
else ccl=NULL;
}
- else ccl = NULL;
+ else {
+ mlogf(M_ERROR,M_SHOW,"-- no provider context getConstClass(%s:%s)\n",
+ ns, cn);
+ ccl = NULL; /* sufficient error indication ? */
+ }
unlockUpCall(Broker);
@@ -1464,9 +1473,8 @@
if (irc != CMPI_RC_OK)
{
mlogf(M_ERROR,M_SHOW,"--- forkProvider failed in _getConstClass(%s:%s)\n", ns, cn);
- /* spSendCtlResult(requestor, &dmy, MSG_X_PROVIDER_NOT_FOUND, 0,
- NULL, req->options); */
- _SFCB_ABORT();
+ // _SFCB_ABORT();
+ _SFCB_RETURN(NULL);
}
memset(&binCtx,0,sizeof(BinRequestContext));
Index: providerDrv.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- providerDrv.c 5 Mar 2012 19:11:36 -0000 1.107
+++ providerDrv.c 6 Mar 2012 17:33:55 -0000 1.108
@@ -2744,6 +2744,7 @@
BinRequestHdr *req = parms->req;
int i,requestor=0,initRc=0;
char* errstr = NULL;
+ char msg[1024];
_SFCB_ENTER(TRACE_PROVIDERDRV, "processProviderInvocationRequestsThread");
@@ -2755,11 +2756,26 @@
if (req->operation != OPS_LoadProvider) {
if (req->provId == NULL) {
- mlogf(M_ERROR,M_SHOW,"-#- no provider id specified for request --- terminating process.\n");
+ mlogf(M_ERROR,M_SHOW,"-#- no provider id specified for request --- terminating process (%d).\n", currentProc);
+ snprintf(msg,1023, "*** Provider id not specified (%d), exiting",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
exit(-1);
}
time(&curProvProc->lastActivity);
+ if (activProvs == NULL) {
+ /* only load provider allowed, exiting should allow for recovery via reload */
+ mlogf(M_ERROR,M_SHOW,"-#- potential race condition in provider reload --- terminating process (%d).\n", currentProc);
+ snprintf(msg,1023, "*** Provider not yet loaded (%d), exiting",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
+ exit(-1);
+ }
for (pInfo = activProvs; pInfo; pInfo = pInfo->next) {
if (pInfo->provIds.ids == req->provId) {
pInfo->lastActivity=curProvProc->lastActivity;
@@ -2767,8 +2783,17 @@
}
}
if (pInfo==NULL) {
- mlogf(M_ERROR,M_SHOW,"-#- Serious provider id / provider process mismatch --- terminating process.\n");
- exit(-1);
+ /* probably a race, however this provider is still alive, keep it running */
+ mlogf(M_ERROR,M_SHOW,"-#- misdirected provider request (%d) --- skipping request, keep process (%d).\n", req->operation, currentProc);
+ if (req->operation == OPS_InvokeMethod) {
+ fprintf(stderr,"method: %s",(char*)((InvokeMethodReq*)req)->method.data);
+ }
+ snprintf(msg,1023, "*** Misdirected provider request (%d)",
+ currentProc);
+ resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg);
+ sendResponse(abs(parms->requestor), resp);
+ free(resp);
+ _SFCB_RETURN(NULL);
}
if (pInfo->library==NULL) {
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.729
retrieving revision 1.730
diff -u -d -r1.729 -r1.730
--- ChangeLog 5 Mar 2012 19:12:45 -0000 1.729
+++ ChangeLog 6 Mar 2012 17:33:55 -0000 1.730
@@ -1,3 +1,9 @@
+2012-03-06 Chris Buccella <buc...@li...>
+
+ * providerDrv.c, providerMgr.c:
+ [ 3497765 ] Better Error Handling in sfcb Provider Manager and Driver
+ (patch by Viktor Mihajlovski)
+
2012-03-05 Narasimhma Sharoff <nsh...@us...>
* providerDrv.c, providerMgr.c, sfcBroker.c
|
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 19:13:03
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv21824 Modified Files: NEWS Log Message: [3497096] double free during stopProc Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.651 retrieving revision 1.652 diff -u -d -r1.651 -r1.652 --- NEWS 5 Mar 2012 18:15:12 -0000 1.651 +++ NEWS 5 Mar 2012 19:13:01 -0000 1.652 @@ -42,6 +42,7 @@ - 3484083 Exclude SFCBIndicationID - 3496383 Faster Return from CBDeliverIndication - 3416060 sigsegv in tool_mm_flush() +- 3497096 double free during stopProc Changes in 1.3.13 ================= |
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 19:12:47
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv21782 Modified Files: ChangeLog Log Message: [3497096] double free during stopProc Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.728 retrieving revision 1.729 diff -u -d -r1.728 -r1.729 --- ChangeLog 5 Mar 2012 18:14:56 -0000 1.728 +++ ChangeLog 5 Mar 2012 19:12:45 -0000 1.729 @@ -1,5 +1,10 @@ 2012-03-05 Narasimhma Sharoff <nsh...@us...> + * providerDrv.c, providerMgr.c, sfcBroker.c + [ 3497096 ] double free during stopProc + +2012-03-05 Narasimhma Sharoff <nsh...@us...> + * providerDrv.c, providerMgr.c, providerMgr.h, support.c [ 3416060 ] sigsegv in tool_mm_flush() |
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 19:12:11
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv21729
Modified Files:
sfcBroker.c
Log Message:
[3497096] double free during stopProc
Index: sfcBroker.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- sfcBroker.c 23 Feb 2012 21:25:25 -0000 1.61
+++ sfcBroker.c 5 Mar 2012 19:12:09 -0000 1.62
@@ -157,6 +157,10 @@
return 0;
}
+/* 3497096 :77022 */
+extern pthread_mutex_t syncMtx; /* syncronize provider state */
+extern int prov_rdy_state; /* -1 indicates not ready */
+
static pthread_mutex_t sdMtx=PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t sdCnd=PTHREAD_COND_INITIALIZER;
static int stopping=0;
@@ -165,17 +169,42 @@
static void stopBroker(void *p)
{
struct timespec waitTime;
- int rc,sa=0,sp=0;
-
- stopping=1;
-
+ int rc,sa=0,sp=0, count = 0;
+
+ /* SF 3497096 bugzilla 77022 */
+ /* stopping is set to prevent other threads calling this routine */
+ pthread_mutex_lock(&syncMtx);
+ if (stopping) {
+ printf("Stopping sfcb is in progress. Please wait...\n");
+ pthread_mutex_unlock(&syncMtx);
+ return;
+ }
+ else {
+ stopping=1;
+ pthread_mutex_unlock(&syncMtx);
+ }
+
+ /* Look for providers ready status. A 5 seconds wait is performed to
+ * avoid a hang here in the event of provider looping, crashing etc
+ */
+ for (;;) {
+ pthread_mutex_lock(&syncMtx);
+ if (prov_rdy_state == -1) {
+ if (count >= 5) break; /* lock will be released later */
+ pthread_mutex_unlock(&syncMtx);
+ sleep(1);
+ count++;
+ }
+ else break; /* lock will be released later */
+ }
+
stopLocalConnectServer();
for(;;) {
if (adaptersStopped==0) {
pthread_mutex_lock(&sdMtx);
- waitTime.tv_sec=time(NULL)+5;
+ waitTime.tv_sec=time(NULL)+1; //5
waitTime.tv_nsec=0;
if (sa==0) fprintf(stderr,"--- Stopping adapters\n");
sa++;
@@ -191,7 +220,7 @@
if (adaptersStopped) {
pthread_mutex_lock(&sdMtx);
- waitTime.tv_sec=time(NULL)+5;
+ waitTime.tv_sec=time(NULL)+1; //5
waitTime.tv_nsec=0;
if (sp==0) fprintf(stderr,"--- Stopping providers\n");
sp++;
@@ -209,9 +238,11 @@
uninitProvProcCtl();
uninitSocketPairs();
sunsetControl();
-// uninitGarbageCollector();
+ uninitGarbageCollector();
closeLogging();
free((void *)sfcBrokerStart);
+
+ pthread_mutex_unlock(&syncMtx);
if (restartBroker) {
char *emsg=strerror(errno);
|
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 19:11:56
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv21691
Modified Files:
providerMgr.c
Log Message:
[3497096] double free during stopProc
Index: providerMgr.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- providerMgr.c 5 Mar 2012 18:13:43 -0000 1.77
+++ providerMgr.c 5 Mar 2012 19:11:54 -0000 1.78
@@ -124,6 +124,9 @@
free(req);
}
+int prov_rdy_state = -1; /* 3497096 :77022 - stopBroker() reads this value */
+pthread_mutex_t syncMtx=PTHREAD_MUTEX_INITIALIZER; /* shared with stopBroker */
+
/* -------------
* ---
* Instance Provider support
@@ -966,10 +969,18 @@
_SFCB_TRACE(1,("--- Mgr request for %s-%s (%d) from %d", req->nameSpace.data,
req->className.data,req->type,requestor));
+ pthread_mutex_lock(&syncMtx); /* 77022 */
+ prov_rdy_state = -1;
+ pthread_mutex_unlock(&syncMtx);
+
sigprocmask(SIG_SETMASK, &mask, &old_mask);
hdlr = mHandlers[req->type];
hdlr.handler(&requestor, req);
sigprocmask(SIG_SETMASK, &old_mask, NULL);
+
+ pthread_mutex_lock(&syncMtx); /* 77022 */
+ prov_rdy_state = 1;
+ pthread_mutex_unlock(&syncMtx);
_SFCB_TRACE(1,("--- Mgr request for %s-%s DONE", req->nameSpace.data,
req->className.data));
|
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 19:11:39
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv21639
Modified Files:
providerDrv.c
Log Message:
[3497096] double free during stopProc
Index: providerDrv.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- providerDrv.c 5 Mar 2012 18:13:27 -0000 1.106
+++ providerDrv.c 5 Mar 2012 19:11:36 -0000 1.107
@@ -367,11 +367,11 @@
mlogf(M_INFO,M_SHOW,"--- stopped %s %d\n",processName,getpid());
ctx->ft->release(ctx);
- uninit_sfcBroker();
- uninitProvProcCtl();
- uninitSocketPairs();
- sunsetControl();
- uninitGarbageCollector();
+ //uninit_sfcBroker(); /* 3497096 */
+ //uninitProvProcCtl();
+ //uninitSocketPairs();
+ //sunsetControl();
+ //uninitGarbageCollector();
exit(0);
}
|
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 18:15:14
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv14263 Modified Files: NEWS Log Message: [3416060] sigsegv in tool_mm_flush() Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.650 retrieving revision 1.651 diff -u -d -r1.650 -r1.651 --- NEWS 2 Mar 2012 21:37:59 -0000 1.650 +++ NEWS 5 Mar 2012 18:15:12 -0000 1.651 @@ -41,6 +41,7 @@ - 3496061 IndicationSubscription May Be Undeletable - 3484083 Exclude SFCBIndicationID - 3496383 Faster Return from CBDeliverIndication +- 3416060 sigsegv in tool_mm_flush() Changes in 1.3.13 ================= |
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 18:14:58
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv14234 Modified Files: ChangeLog Log Message: [3416060] sigsegv in tool_mm_flush() Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.727 retrieving revision 1.728 diff -u -d -r1.727 -r1.728 --- ChangeLog 2 Mar 2012 21:37:59 -0000 1.727 +++ ChangeLog 5 Mar 2012 18:14:56 -0000 1.728 @@ -1,3 +1,8 @@ +2012-03-05 Narasimhma Sharoff <nsh...@us...> + + * providerDrv.c, providerMgr.c, providerMgr.h, support.c + [ 3416060 ] sigsegv in tool_mm_flush() + 2012-03-02 Chris Buccella <buc...@li...> * interopProvider.c: @@ -13,7 +18,7 @@ * interopProvider.c: [ 3496061 ] IndicationSubscription May Be Undeletable -2012-02-29 Narasimha Sharoff <nsh...@us...> +2012-03-01 Narasimha Sharoff <nsh...@us...> * brokerUpc.c [ 3483200 ] duplicate indication deliveries |
|
From: Narasimha S. <nsh...@us...> - 2012-03-05 18:14:28
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv14180
Modified Files:
support.c
Log Message:
[3416060] sigsegv in tool_mm_flush()
Index: support.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/support.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- support.c 23 Sep 2011 20:19:31 -0000 1.38
+++ support.c 5 Mar 2012 18:14:26 -0000 1.39
@@ -714,7 +714,10 @@
int uninit_sfcBroker()
{
- if (pReg) pReg->ft->release(pReg);
+ if (pReg) {
+ pReg->ft->release(pReg);
+ pReg = NULL;
+ }
return 0;
}
|