|
From: Narasimha S. <nsh...@us...> - 2012-07-05 23:04:49
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv11311
Modified Files:
ChangeLog interopProvider.c NEWS sfcCustomLib.c support.c
Log Message:
[ 3538858 ] custom routine to log indInst objinfo
Signed-off-by: Narasimha Sharoff <nsh...@us...>
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.706
retrieving revision 1.707
diff -u -d -r1.706 -r1.707
--- NEWS 3 Jul 2012 02:11:19 -0000 1.706
+++ NEWS 5 Jul 2012 23:04:47 -0000 1.707
@@ -8,6 +8,7 @@
- 3539557 Memory leak in providerDrv with property list
- 3539555 Memory leak in TestInstanceProvider
- 1901737 Memory leak in internalProvider.c
+- 3538858 custom routine to log indInst objinfo
Changes in 1.3.15
=================
Index: support.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/support.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- support.c 13 Jun 2012 21:21:09 -0000 1.40
+++ support.c 5 Jul 2012 23:04:47 -0000 1.41
@@ -1026,9 +1026,11 @@
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;
@@ -1053,6 +1055,13 @@
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");
@@ -1079,6 +1088,11 @@
return -1;
}
+void sfcbIndAuditLog(char *operation, char *objinfo)
+{
+ if (indAuditLog) return(indAuditLog(operation, objinfo));
+ return;
+}
void unloadHostnameLib()
{
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.790
retrieving revision 1.791
diff -u -d -r1.790 -r1.791
--- ChangeLog 3 Jul 2012 02:11:19 -0000 1.790
+++ ChangeLog 5 Jul 2012 23:04:46 -0000 1.791
@@ -1,3 +1,8 @@
+2012-07-05 Narasimha Sharoff <nsh...@us...>
+
+ * interopProvider.c, sfcCustomLib.c, support.c:
+ [ 3538858 ] custom routine to log indInst objinfo
+
2012-07-02 Chris Buccella <buc...@li...>
* internalProvider.c, providerMgr.c:
Index: interopProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopProvider.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- interopProvider.c 3 Jul 2012 01:57:48 -0000 1.65
+++ interopProvider.c 5 Jul 2012 23:04:47 -0000 1.66
@@ -1130,6 +1130,8 @@
if (st.rc==CMPI_RC_OK) {
ctxLocal = prepareUpcall((CMPIContext *)ctx);
CMReturnObjectPath(rslt, _broker->bft->createInstance(_broker, ctxLocal, copLocal, ciLocal, &st));
+ sfcbIndAuditLog("CreateInstance-> ",
+ CMGetCharPtr(CMObjectPathToString(cop, NULL)));
CMRelease(ctxLocal);
}
@@ -1222,6 +1224,8 @@
if (st.rc==CMPI_RC_OK) {
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);
@@ -1291,6 +1295,8 @@
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);
}
@@ -1455,6 +1461,8 @@
CMPIString *ns=CMGetNameSpace(op,NULL);
_SFCB_TRACE(1,("--- _addHandler %s %s",(char*)ns->hdl,(char*)str->hdl));
addHandler(ci,op);
+ sfcbIndAuditLog("CreateHandler-> ",
+ CMGetCharPtr(CMObjectPathToString(op, NULL)));
}
else if (strcasecmp(methodName, "_removeHandler") == 0) {
@@ -1467,6 +1475,8 @@
} else {
removeHandler(ha,key);
LDcount--;
+ sfcbIndAuditLog("RemoveHandler-> ",
+ CMGetCharPtr(CMObjectPathToString(op, NULL)));
}
}
else {
Index: sfcCustomLib.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcCustomLib.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sfcCustomLib.c 13 Jun 2012 21:21:09 -0000 1.1
+++ sfcCustomLib.c 5 Jul 2012 23:04:47 -0000 1.2
@@ -68,3 +68,27 @@
return 0;
}
+
+/** \brief _sfcbIndAuditLog - log create, delete, and modify calls
+ *
+ * Provides object information for indicaiton 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;
+ char *ts = ctime(&t);
+ fp = fopen("/tmp/indAudit.log", "a+");
+ if (fp != NULL) {
+ fwrite(operation, strlen(action), 1, fp);
+ fwrite(objinfo, strlen(msg), 1, fp);
+ fwrite("\n\n",2,1,fp);
+ fflush(fp);
+ fclose(fp);
+ }
+ */
+ return;
+}
|