|
From: Narasimha S. <nsh...@us...> - 2012-07-09 17:09:11
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 6f0bb8b21e228e869156c02b26d415ec4863c27d (commit)
from 194139e9b866dbb5d74f5e2eef20c0864d19e238 (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 6f0bb8b21e228e869156c02b26d415ec4863c27d
Author: Narasimha Sharoff <nsh...@us...>
Date: Mon Jul 9 10:08:01 2012 -0700
[ 3538858 ] custom routine to log indInst objinfo
Signed-off-by: Narasimha Sharoff <nsh...@us...>
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index 34ff16c..2bc8ef1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-09 Narasimha Sharoff <nsh...@us...>
+
+ * interopProvider.c, sfcCustomLib.c, support.c:
+ [ 3538858 ] custom routine to log indInst objinfo
+
2012-07-06 Chris Buccella <buc...@li...>
* test/TestProviders/cmpiTestIndicationProvider.c,
diff --git a/NEWS b/NEWS
index 75e373b..bc906d3 100644
--- a/NEWS
+++ b/NEWS
@@ -95,6 +95,9 @@ Everything in 1.3.10, plus:
Changes in 1.3.16
=================
+New Features:
+- 3538858 custom routine to log indInst objinfo
+
Bugs fixed:
- 3539006 Possible indication deadlock
@@ -104,6 +107,9 @@ Bugs fixed:
- 3539563 Memory leak in indCIMXMLHandler when Reliable Inds Enabled
- 3539569 Leaks in interopProvider
+New Features:
+- 3501314 Add dynamic logging and syslog output to sfcb trace
+
Changes in 1.3.15
=================
diff --git a/interopProvider.c b/interopProvider.c
index 00afaa9..548fabc 100644
--- a/interopProvider.c
+++ b/interopProvider.c
@@ -53,6 +53,7 @@ extern void closeProviderContext(BinRequestContext * ctx);
extern void setStatus(CMPIStatus *st, CMPIrc rc, char *msg);
extern int testNameSpace(char *ns, CMPIStatus *st);
extern void memLinkObjectPath(CMPIObjectPath * op);
+extern void sfcbIndAuditLog(char *, char *);
// Counts to enforce limits from cfg file
static int LDcount=0;
@@ -1292,6 +1293,8 @@ InteropProviderCreateInstance(CMPIInstanceMI * mi,
_broker->bft->createInstance(_broker, ctxLocal,
copLocal, ciLocal,
&st));
+ sfcbIndAuditLog("CreateInstance-> ",
+ CMGetCharPtr(CMObjectPathToString(cop, NULL)));
CMRelease(ctxLocal);
}
@@ -1392,6 +1395,8 @@ InteropProviderModifyInstance(CMPIInstanceMI * mi,
ctxLocal = prepareUpcall((CMPIContext *) ctx);
st = _broker->bft->modifyInstance(_broker, ctxLocal, cop, ci,
properties);
+ sfcbIndAuditLog("Subscription:ModifyInstance-> ",
+ CMGetCharPtr(CMObjectPathToString(cop, NULL)));
CMRelease(ctxLocal);
}
_SFCB_RETURN(st);
@@ -1471,6 +1476,8 @@ InteropProviderDeleteInstance(CMPIInstanceMI * mi,
if (st.rc == CMPI_RC_OK) {
ctxLocal = prepareUpcall((CMPIContext *) ctx);
st = _broker->bft->deleteInstance(_broker, ctxLocal, cop);
+ sfcbIndAuditLog("DeleteInstance-> ",
+ CMGetCharPtr(CMObjectPathToString(cop, NULL)));
CMRelease(ctxLocal);
}
@@ -1656,6 +1663,8 @@ InteropProviderInvokeMethod(CMPIMethodMI * mi,
("--- _addHandler %s %s", (char *) ns->hdl,
(char *) str->hdl));
addHandler(ci, op);
+ sfcbIndAuditLog("CreateHandler-> ",
+ CMGetCharPtr(CMObjectPathToString(op, NULL)));
}
else if (strcasecmp(methodName, "_removeHandler") == 0) {
@@ -1668,6 +1677,8 @@ InteropProviderInvokeMethod(CMPIMethodMI * mi,
} else
removeHandler(ha, key);
LDcount--;
+ sfcbIndAuditLog("RemoveHandler-> ",
+ CMGetCharPtr(CMObjectPathToString(op, NULL)));
} else {
setStatus(&st, CMPI_RC_ERR_NOT_FOUND, "Handler object not found");
}
diff --git a/sfcCustomLib.c b/sfcCustomLib.c
index f331461..8bd6ea3 100644
--- a/sfcCustomLib.c
+++ b/sfcCustomLib.c
@@ -68,3 +68,26 @@ extern int _sfcbGetResponseHostname(char *httpHost, char **hostname, unsigned in
return 0;
}
+
+/** \brief _sfcbIndAuditLog - log create, delete, and modify calls
+ *
+ * Provides object information for indication create, delete, and modify
+ * Default action: return
+ * operation - create/delete/modify
+ * objinfo - information on the object
+*/
+extern void _sfcbIndAuditLog(char *operation, char *objinfo)
+{
+ /* example - log to /tmp/indAudit.log
+ FILE *fp;
+ fp = fopen("/tmp/indAudit.log", "a+");
+ if (fp != NULL) {
+ fwrite(operation, strlen(operation), 1, fp);
+ fwrite(objinfo, strlen(objinfo), 1, fp);
+ fwrite("\n\n",1,1,fp);
+ fflush(fp);
+ fclose(fp);
+ }
+ */
+ return;
+}
diff --git a/support.c b/support.c
index 1772bfb..db3d042 100644
--- a/support.c
+++ b/support.c
@@ -1096,9 +1096,11 @@ extern void libraryName(const char *dir, const char *location,
typedef int (*getSfcbHostname)(char *httpHost, char **hostname,
unsigned int len);
typedef int (*getSfcbSlpHostname)(char **hostname);
+typedef void (*sfcbLog)(char *operation, char *objinfo);
static void *hostnameLib;
static getSfcbHostname sfcbHostname;
static getSfcbSlpHostname sfcbSlpHostname;
+static sfcbLog indAuditLog;
int loadHostnameLib()
{
char *ln;
@@ -1123,6 +1125,13 @@ int loadHostnameLib()
dlclose(hostnameLib);
return -1;
}
+ dlerror();
+ indAuditLog = dlsym(hostnameLib, "_sfcbIndAuditLog");
+ if ((err = dlerror()) != NULL) {
+ printf("dlsym failed for _sfcbIndAuditLog: %s\n", err);
+ dlclose(hostnameLib);
+ return -1;
+ }
}
else {
printf("dlopen failed for sfcbCustomLib\n");
@@ -1149,6 +1158,12 @@ int getCustomSlpHostname(char **hn)
return -1;
}
+void sfcbIndAuditLog(char *operation, char *objinfo)
+{
+ if (indAuditLog) return(indAuditLog(operation, objinfo));
+ return;
+}
+
void unloadHostnameLib()
{
if (hostnameLib) dlclose(hostnameLib);
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|