BUG#: 7069
authorthilo.boehm <thilo.boehm>
Thu, 8 Nov 2007 09:04:30 +0000 (09:04 +0000)
committerthilo.boehm <thilo.boehm>
Thu, 8 Nov 2007 09:04:30 +0000 (09:04 +0000)
TITLE: z/OS The auditlogging of CIM Server must be done to SMF

DESCRIPTION: Add z/OS SMF auditlogging.

src/Pegasus/Common/AuditLogger.cpp
src/Pegasus/Common/AuditLogger.h
src/Pegasus/Common/AuditLoggerToLog.cpp [new file with mode: 0644]
src/Pegasus/Common/AuditLoggerToSMF.cpp [new file with mode: 0644]
src/Pegasus/Common/Audit_zOS_SMF.cpp [new file with mode: 0644]
src/Pegasus/Common/Audit_zOS_SMF.h [new file with mode: 0644]
src/Pegasus/Common/Audit_zOS_SMFStructures.h [new file with mode: 0644]
src/Pegasus/Common/Makefile
src/Pegasus/Common/tests/AuditLogger/AuditLogger.cpp
src/Pegasus/Common/tests/AuditLogger/masterOutput_zOS [new file with mode: 0644]
src/Pegasus/msg/Server/pegasusServer_en.txt

index f9f747144fd610085a348141a192fea2e8dfcd15..ad026f8ddda5b82b0beae1e2cf32552d3b6fe511 100644 (file)
 //
 //%/////////////////////////////////////////////////////////////////////////////
 
-#include <Pegasus/Common/Config.h>
-#include <Pegasus/Common/Constants.h>
-#include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/AuditLogger.h>
 
-#ifdef PEGASUS_OS_DARWIN
-# include <crt_externs.h>
-#endif
-
-#ifndef PEGASUS_OS_TYPE_WINDOWS
-# include <unistd.h>
-#endif
-
-#ifdef PEGASUS_OS_VMS
-# include <unixlib.h>
-#endif
-
-#include <stdlib.h>
-
-#ifdef PEGASUS_ENABLE_AUDIT_LOGGER
-
-PEGASUS_USING_STD;
-
-PEGASUS_NAMESPACE_BEGIN
-
-static const String providerModuleStatus [] = {
-    "Unknown", "Other", "OK", "Degraded",
-    "Stressed", "Predictive Failure", "Error", "Non-Recoverable Error",
-    "Starting", "Stopping", "Stopped", "In Service", "No Contact",
-    "Lost Communication"};
-
-Boolean AuditLogger::_auditLogFlag = false;
-
-AuditLogger::PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T
-    AuditLogger::_auditLogInitializeCallback = 0;
-
-AuditLogger::PEGASUS_AUDITLOG_CALLBACK_T AuditLogger::_writeAuditMessageToFile =
-    AuditLogger::_writeAuditMessage;
-
-void AuditLogger::logCurrentConfig(
-    const Array<String> & propertyNames,
-    const Array<String> & propertyValues)
-{
-    for (Uint32 i = 0; i < propertyNames.size(); i++)
-    {
-        String propertyStr = propertyNames[i] + "=" + propertyValues[i];
-
-        MessageLoaderParms msgParms("Common.AuditLogger.CURRENT_CONFIG",
-            "cimserver configuration $0", propertyStr);
-
-        _writeAuditMessageToFile(TYPE_CONFIGURATION,
-            SUBTYPE_CURRENT_CONFIGURATION,
-            EVENT_START_UP, Logger::INFORMATION, msgParms);
-    }
-}
-
-void AuditLogger::logCurrentRegProvider(
-    const Array < CIMInstance > & instances)
-{
-    String moduleName;
-    Array<Uint16> moduleStatus;
-    String statusValue;
-    Uint32 pos;
-
-    // get all the registered provider module names and status
-    for (Uint32 i = 0; i <instances.size(); i++)
-    {
-        instances[i].getProperty(instances[i].findProperty(
-            _PROPERTY_PROVIDERMODULE_NAME)).getValue().get(moduleName);
-
-        pos = instances[i].findProperty(_PROPERTY_OPERATIONALSTATUS);
-
-        if (pos == PEG_NOT_FOUND)
-        {
-            moduleStatus.append(0);
-        }
-        else
-        {
-            CIMValue theValue = instances[i].getProperty(pos).getValue();
-
-            if (theValue.isNull())
-            {
-                moduleStatus.append(0);
-            }
-            else
-            {
-                theValue.get(moduleStatus);
-            }
-        }
-
-        statusValue = _getModuleStatusValue(moduleStatus);
-
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.CURRENT_PROVIDER_REGISTRATION",
-            "Provider module \"$0\" has status \"$1\".",
-            moduleName, statusValue);
-
-        _writeAuditMessageToFile(TYPE_CONFIGURATION,
-            SUBTYPE_CURRENT_PROVIDER_REGISTRATION,
-            EVENT_START_UP, Logger::INFORMATION, msgParms);
-    }
-}
-
-void AuditLogger::logCurrentEnvironmentVar()
-{
-#ifdef PEGASUS_OS_DARWIN
-    char** envp = *_NSGetEnviron();
+#if defined(PEGASUS_OS_ZOS)
+// SMF is a z/OS operating system specific facility.
+// It is not recommended to port it to other platforms.
+# include "AuditLoggerToSMF.cpp"
 #else
-    char** envp = environ;
+# include "AuditLoggerToLog.cpp"
 #endif
 
-    Uint32 i = 0;
-
-    while (envp[i])
-    {
-        MessageLoaderParms msgParms("Common.AuditLogger.CURRENT_ENV",
-           "cimserver environment variable: $0", envp[i]);
-
-        _writeAuditMessageToFile(TYPE_CONFIGURATION,
-            SUBTYPE_CURRENT_ENVIRONMENT_VARIABLES,
-            EVENT_START_UP, Logger::INFORMATION, msgParms);
-
-        i++;
-    }
-}
-
-void AuditLogger::logSetConfigProperty(
-    const String & userName,
-    const String & propertyName,
-    const String & prePropertyValue,
-    const String & newPropertyValue,
-    Boolean isPlanned)
-{
-    if (isPlanned)
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.SET_PLANNED_CONFIG_PROPERTY",
-            "The planned value of property \"$0\" is modified from "
-                "value \"$1\" to value \"$2\" by user \"$3\".",
-            propertyName, prePropertyValue, newPropertyValue, userName);
-
-        _writeAuditMessageToFile(TYPE_CONFIGURATION,
-            SUBTYPE_CONFIGURATION_CHANGE,
-            EVENT_UPDATE, Logger::INFORMATION, msgParms);
-    }
-    else
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.SET_CURRENT_CONFIG_PROPERTY",
-            "The current value of property \"$0\" is modified from "
-                "value \"$1\" to value \"$2\" by user \"$3\".",
-            propertyName, prePropertyValue, newPropertyValue, userName);
-
-        _writeAuditMessageToFile(TYPE_CONFIGURATION,
-            SUBTYPE_CONFIGURATION_CHANGE,
-            EVENT_UPDATE, Logger::INFORMATION, msgParms);
-    }
-}
-
-void AuditLogger::logUpdateClassOperation(
-    const char* cimMethodName,
-    AuditEvent eventType,
-    const String& userName,
-    const String& ipAddr,
-    const CIMNamespaceName& nameSpace,
-    const CIMName& className,
-    CIMStatusCode statusCode)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.OPERATION_UPDATE_CLASS",
-        "A CIM $0 operation on class \"$1\" in namespace \"$2\" by user "
-            "\"$3\" connected from system \"$4\" resulted in status \"$5\".",
-        cimMethodName,
-        className.getString(),
-        nameSpace.getString(),
-        userName,
-        ipAddr,
-        cimStatusCodeToString(statusCode));
-
-    _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_SCHEMA_OPERATION,
-        eventType, Logger::INFORMATION, msgParms);
-}
-
-void AuditLogger::logUpdateQualifierOperation(
-    const char* cimMethodName,
-    AuditEvent eventType,
-    const String& userName,
-    const String& ipAddr,
-    const CIMNamespaceName& nameSpace,
-    const CIMName& className,
-    CIMStatusCode statusCode)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.OPERATION_UPDATE_QUALIFIER",
-        "A CIM $0 operation on qualifier \"$1\" in namespace \"$2\" by user "
-            "\"$3\" connected from system \"$4\" resulted in status \"$5\".",
-        cimMethodName,
-        className.getString(),
-        nameSpace.getString(),
-        userName,
-        ipAddr,
-        cimStatusCodeToString(statusCode));
-
-    _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_SCHEMA_OPERATION,
-        eventType, Logger::INFORMATION, msgParms);
-}
-
-void AuditLogger::logUpdateInstanceOperation(
-    const char* cimMethodName,
-    AuditEvent eventType,
-    const String& userName,
-    const String& ipAddr,
-    const CIMNamespaceName& nameSpace,
-    const CIMObjectPath& instanceName,
-    const String& moduleName,
-    const String& providerName,
-    CIMStatusCode statusCode)
-{
-    if (providerName != String::EMPTY)
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.OPERATION_UPDATE_INSTANCE_WITH_PROVIDER",
-            "A CIM $0 operation on instance \"$1\" in namespace \"$2\" by "
-                "user \"$3\" connected from system \"$4\" resulted in "
-                "status \"$5\".  "
-                "The provider for this operation is \"$6\" in module \"$7\".",
-            cimMethodName,
-            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
-                instanceName.getKeyBindings()).toString(),
-            nameSpace.getString(),
-            userName,
-            ipAddr,
-            cimStatusCodeToString(statusCode),
-            providerName,
-            moduleName);
-
-        _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
-            eventType, Logger::INFORMATION, msgParms);
-    }
-    else
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.OPERATION_UPDATE_INSTANCE",
-            "A CIM $0 operation on instance \"$1\" in namespace \"$2\" by "
-                "user \"$3\" connected from system \"$4\" resulted in "
-                "status \"$5\".  ",
-            cimMethodName,
-            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
-                instanceName.getKeyBindings()).toString(),
-            nameSpace.getString(),
-            userName,
-            ipAddr,
-            cimStatusCodeToString(statusCode));
-
-        _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
-            eventType, Logger::INFORMATION, msgParms);
-    }
-}
-
-void AuditLogger::logInvokeMethodOperation(
-    const String& userName,
-    const String& ipAddr,
-    const CIMNamespaceName& nameSpace,
-    const CIMObjectPath& objectName,
-    const CIMName& methodName,
-    const String& moduleName,
-    const String& providerName,
-    CIMStatusCode statusCode)
-{
-    if (providerName != String::EMPTY)
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.OPERATION_INVOKE_METHOD_WITH_PROVIDER",
-            "A CIM InvokeMethod operation on method \"$0\" of object \"$1\" "
-                "in namespace \"$2\" by user \"$3\" connected from system "
-                "\"$4\" resulted in status \"$5\".  The provider for this "
-                "operation is \"$6\" in module \"$7\".",
-            methodName.getString(),
-            CIMObjectPath("", CIMNamespaceName(), objectName.getClassName(),
-                objectName.getKeyBindings()).toString(),
-            nameSpace.getString(),
-            userName,
-            ipAddr,
-            cimStatusCodeToString(statusCode),
-            providerName,
-            moduleName);
-
-        _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
-            EVENT_INVOKE, Logger::INFORMATION, msgParms);
-    }
-    else
-    {
-        MessageLoaderParms msgParms(
-            "Common.AuditLogger.OPERATION_INVOKE_METHOD",
-            "A CIM InvokeMethod operation on method \"$0\" of object \"$1\" "
-                "in namespace \"$2\" by user \"$3\" connected from system "
-                "\"$4\" resulted in status \"$5\".",
-            methodName.getString(),
-            CIMObjectPath("", CIMNamespaceName(), objectName.getClassName(),
-                objectName.getKeyBindings()).toString(),
-            nameSpace.getString(),
-            userName,
-            ipAddr,
-            cimStatusCodeToString(statusCode));
-
-        _writeAuditMessageToFile(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
-            EVENT_INVOKE, Logger::INFORMATION, msgParms);
-    }
-}
-
-void AuditLogger::logUpdateProvModuleStatus(
-    const String & moduleName,
-    const Array<Uint16> currentModuleStatus,
-    const Array<Uint16> newModuleStatus)
-{
-    String currentModuleStatusValue =
-        _getModuleStatusValue(currentModuleStatus);
-
-    String newModuleStatusValue = _getModuleStatusValue(newModuleStatus);
-
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.UPDATE_PROVIDER_MODULE_STATUS",
-        "The operational status of module \"$0\" has changed from \"$1\""
-        " to \"$2\".",
-        moduleName, currentModuleStatusValue, newModuleStatusValue);
-
-    _writeAuditMessageToFile(TYPE_CONFIGURATION,
-        SUBTYPE_PROVIDER_MODULE_STATUS_CHANGE,
-        EVENT_UPDATE, Logger::INFORMATION, msgParms);
-}
-
-void AuditLogger::logLocalAuthentication(
-    const String& userName,
-    Boolean successful)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.LOCAL_AUTHENTICATION",
-        "Local authentication attempt: "
-        "successful = $0, user = $1. ",
-        CIMValue(successful).toString(),
-        userName);
-
-    _writeAuditMessageToFile(
-        TYPE_AUTHENTICATION,
-        SUBTYPE_LOCAL_AUTHENTICATION,
-        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
-        successful ? Logger::INFORMATION : Logger::WARNING,
-        msgParms);
-}
-
-void AuditLogger::logBasicAuthentication(
-    const String& userName,
-    const String& ipAddr,
-    Boolean successful)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.BASIC_AUTHENTICATION",
-        "Basic authentication attempt: "
-        "successful = $0, user = $1, IP address = $2.",
-        CIMValue(successful).toString(),
-        userName,
-        ipAddr);
-
-    _writeAuditMessageToFile( TYPE_AUTHENTICATION,
-        SUBTYPE_BASIC_AUTHENTICATION,
-        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
-        successful ? Logger::INFORMATION: Logger::WARNING,
-        msgParms);
-}
-
-void AuditLogger::logCertificateBasedAuthentication(
-    const String& issuerName,
-    const String& subjectName,
-    const String& serialNumber,
-    const String& ipAddr,
-    Boolean successful)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.CERTIFICATE_BASED_AUTHENTICATION",
-        "Certificate based authentication attempt: "
-            "successful = $0, issuer = $1, subject = $2, serialNumber = $3, "
-            "IP address = $4.",
-        CIMValue(successful).toString(),
-        issuerName,
-        subjectName,
-        serialNumber,
-        ipAddr);
-
-    _writeAuditMessageToFile(TYPE_AUTHENTICATION,
-        SUBTYPE_CERTIFICATE_BASED_AUTHENTICATION,
-        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
-        successful ? Logger::INFORMATION: Logger::WARNING,
-        msgParms);
-}
-
-void AuditLogger::logCertificateBasedUserValidation(
-    const String& userName,
-    const String& issuerName,
-    const String& subjectName,
-    const String& serialNumber,
-    const String& ipAddr,
-    Boolean successful)
-{
-    MessageLoaderParms msgParms(
-        "Common.AuditLogger.CERTIFICATE_BASED_USER_VALIDATION",
-        "Certificate based user validation attempt: "
-            "successful = $0, userName = $1, issuer = $2, subject = $3, "
-            "serialNumber = $4, IP address = $5.",
-        CIMValue(successful).toString(),
-        userName,
-        issuerName,
-        subjectName,
-        serialNumber,
-        ipAddr);
-
-    _writeAuditMessageToFile( TYPE_AUTHORIZATION,
-        SUBTYPE_CERTIFICATE_BASED_USER_VALIDATION,
-        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
-        successful ? Logger::INFORMATION: Logger::WARNING,
-        msgParms);
-}
-
-void AuditLogger::setInitializeCallback(
-    PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T auditLogInitializeCallback)
-{
-    _auditLogInitializeCallback = auditLogInitializeCallback;
-}
-
-void AuditLogger::setEnabled(Boolean enabled)
-{
-    // Only write the enable/disable messages if we are set up to handle them
-    if (_auditLogInitializeCallback != 0)
-    {
-        if (enabled)
-        {
-            if (!_auditLogFlag)
-            {
-                _auditLogInitializeCallback();
-
-                MessageLoaderParms msgParms(
-                    "Common.AuditLogger.ENABLE_AUDIT_LOG",
-                    "Audit logging is enabled.");
-
-                _writeAuditMessageToFile(TYPE_CONFIGURATION,
-                    SUBTYPE_CONFIGURATION_CHANGE,
-                    EVENT_UPDATE, Logger::INFORMATION, msgParms);
-            }
-        }
-        else
-        {
-            if (_auditLogFlag)
-            {
-                MessageLoaderParms msgParms(
-                    "Common.AuditLogger.DISABLE_AUDIT_LOG",
-                    "Audit logging is disabled.");
-
-                _writeAuditMessageToFile(TYPE_CONFIGURATION,
-                    SUBTYPE_CONFIGURATION_CHANGE,
-                    EVENT_UPDATE, Logger::INFORMATION, msgParms);
-            }
-        }
-    }
-
-    _auditLogFlag = enabled;
-}
-
-void AuditLogger::writeAuditLogToFileCallback(
-    PEGASUS_AUDITLOG_CALLBACK_T writeAuditLogToFileCallback)
-{
-    _writeAuditMessageToFile = writeAuditLogToFileCallback;
-}
-
-void AuditLogger::_writeAuditMessage(
-    AuditType auditType,
-    AuditSubType auditSubType,
-    AuditEvent auditEvent,
-    Uint32 logLevel,
-    MessageLoaderParms & msgParms)
-{
-    String localizedMsg = MessageLoader::getMessage(msgParms);
-
-    String identifier = "cimserver audit";
-
-    Logger::put(Logger::AUDIT_LOG, identifier, logLevel, localizedMsg);
-}
-
-String AuditLogger::_getModuleStatusValue(
-    const Array<Uint16>  moduleStatus)
-{
-    String moduleStatusValue, statusValue;
-    Uint32 moduleStatusSize = moduleStatus.size();
-
-    for (Uint32 j=0; j < moduleStatusSize; j++)
-    {
-        statusValue = providerModuleStatus[moduleStatus[j]];
-        moduleStatusValue.append(statusValue);
-
-        if (j < moduleStatusSize - 1)
-        {
-            moduleStatusValue.append(",");
-        }
-    }
-
-    return moduleStatusValue;
-}
-
-PEGASUS_NAMESPACE_END
-
-#endif
index 53f031dc935262962c5f8ffdea2c441547839816..e9b335272f7b41a78b59b4db095149e37731e3a7 100644 (file)
@@ -282,8 +282,13 @@ public:
 
     typedef void (*PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T)();
 
+#ifdef PEGASUS_OS_ZOS
+    typedef void (*PEGASUS_AUDITLOG_CALLBACK_T) 
+        (int subtype, char* record );
+#else
     typedef void (*PEGASUS_AUDITLOG_CALLBACK_T) (AuditType,
         AuditSubType, AuditEvent, Uint32, MessageLoaderParms &);
+#endif
 
     /**
         Registers an audit log initialize callback
@@ -305,11 +310,11 @@ public:
     static Boolean isEnabled();
 
     /**
-        Registers writing audit messages to a file callback
+        Registers audit messages callback
         @param writeAuditMessageCallback - The callback function to write
                                            audit message
     */
-    static void writeAuditLogToFileCallback(
+    static void setAuditLogWriterCallback(
         PEGASUS_AUDITLOG_CALLBACK_T writeAuditMessageCallback);
 
 private:
@@ -324,7 +329,29 @@ private:
     /**
         The function to write audit messages
     */
-    static PEGASUS_AUDITLOG_CALLBACK_T _writeAuditMessageToFile;
+    static PEGASUS_AUDITLOG_CALLBACK_T _writeAuditMessage;
+
+#ifdef PEGASUS_OS_ZOS
+
+    static inline void _writeAuthenticationRecord( 
+        unsigned short authMode,
+        String userID,
+        Boolean isAuthenticated,
+        String clientIP );
+
+    static inline void _writeCIMOperationRecord(
+        unsigned short cimOpType,
+        String userID,
+        unsigned short cimStatusCode,
+        String clientIP,
+        String operName,
+        String objPath,
+        String nameSpace,
+        String provName,
+        String provModName
+        );
+
+#else
 
     /** Default function to write a auditMessage to a file
         @param AuditType - Type of audit record (Authentication etc)
@@ -337,7 +364,7 @@ private:
         "WARNING"
         @param msgParms - The message loader parameters
     */
-    static void _writeAuditMessage(
+    static void _writeAuditMessageToLog(
         AuditType auditType,
         AuditSubType auditSubType,
         AuditEvent auditEvent,
@@ -350,6 +377,8 @@ private:
     */
     static String _getModuleStatusValue(const Array<Uint16>  moduleStatus);
 
+#endif
+
 };
 
 inline Boolean AuditLogger::isEnabled()
diff --git a/src/Pegasus/Common/AuditLoggerToLog.cpp b/src/Pegasus/Common/AuditLoggerToLog.cpp
new file mode 100644 (file)
index 0000000..ca86fc6
--- /dev/null
@@ -0,0 +1,542 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#include <Pegasus/Common/Config.h>
+#include <Pegasus/Common/Constants.h>
+#include <Pegasus/Common/Logger.h>
+#include <Pegasus/Common/AuditLogger.h>
+
+#ifdef PEGASUS_OS_DARWIN
+# include <crt_externs.h>
+#endif
+
+#ifndef PEGASUS_OS_TYPE_WINDOWS
+# include <unistd.h>
+#endif
+
+#ifdef PEGASUS_OS_VMS
+# include <unixlib.h>
+#endif
+
+#include <stdlib.h>
+
+#ifdef PEGASUS_ENABLE_AUDIT_LOGGER
+
+PEGASUS_USING_STD;
+
+PEGASUS_NAMESPACE_BEGIN
+
+static const String providerModuleStatus [] = {
+    "Unknown", "Other", "OK", "Degraded",
+    "Stressed", "Predictive Failure", "Error", "Non-Recoverable Error",
+    "Starting", "Stopping", "Stopped", "In Service", "No Contact",
+    "Lost Communication"};
+
+Boolean AuditLogger::_auditLogFlag = false;
+
+AuditLogger::PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T
+    AuditLogger::_auditLogInitializeCallback = 0;
+
+AuditLogger::PEGASUS_AUDITLOG_CALLBACK_T AuditLogger::_writeAuditMessage =
+    AuditLogger::_writeAuditMessageToLog;
+
+void AuditLogger::logCurrentConfig(
+    const Array<String> & propertyNames,
+    const Array<String> & propertyValues)
+{
+    for (Uint32 i = 0; i < propertyNames.size(); i++)
+    {
+        String propertyStr = propertyNames[i] + "=" + propertyValues[i];
+
+        MessageLoaderParms msgParms("Common.AuditLogger.CURRENT_CONFIG",
+            "cimserver configuration $0", propertyStr);
+
+        _writeAuditMessage(TYPE_CONFIGURATION,
+            SUBTYPE_CURRENT_CONFIGURATION,
+            EVENT_START_UP, Logger::INFORMATION, msgParms);
+    }
+}
+
+void AuditLogger::logCurrentRegProvider(
+    const Array < CIMInstance > & instances)
+{
+    String moduleName;
+    Array<Uint16> moduleStatus;
+    String statusValue;
+    Uint32 pos;
+
+    // get all the registered provider module names and status
+    for (Uint32 i = 0; i <instances.size(); i++)
+    {
+        instances[i].getProperty(instances[i].findProperty(
+            _PROPERTY_PROVIDERMODULE_NAME)).getValue().get(moduleName);
+
+        pos = instances[i].findProperty(_PROPERTY_OPERATIONALSTATUS);
+
+        if (pos == PEG_NOT_FOUND)
+        {
+            moduleStatus.append(0);
+        }
+        else
+        {
+            CIMValue theValue = instances[i].getProperty(pos).getValue();
+
+            if (theValue.isNull())
+            {
+                moduleStatus.append(0);
+            }
+            else
+            {
+                theValue.get(moduleStatus);
+            }
+        }
+
+        statusValue = _getModuleStatusValue(moduleStatus);
+
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.CURRENT_PROVIDER_REGISTRATION",
+            "Provider module \"$0\" has status \"$1\".",
+            moduleName, statusValue);
+
+        _writeAuditMessage(TYPE_CONFIGURATION,
+            SUBTYPE_CURRENT_PROVIDER_REGISTRATION,
+            EVENT_START_UP, Logger::INFORMATION, msgParms);
+    }
+}
+
+void AuditLogger::logCurrentEnvironmentVar()
+{
+#ifdef PEGASUS_OS_DARWIN
+    char** envp = *_NSGetEnviron();
+#else
+    char** envp = environ;
+#endif
+
+    Uint32 i = 0;
+
+    while (envp[i])
+    {
+        MessageLoaderParms msgParms("Common.AuditLogger.CURRENT_ENV",
+           "cimserver environment variable: $0", envp[i]);
+
+        _writeAuditMessage(TYPE_CONFIGURATION,
+            SUBTYPE_CURRENT_ENVIRONMENT_VARIABLES,
+            EVENT_START_UP, Logger::INFORMATION, msgParms);
+
+        i++;
+    }
+}
+
+void AuditLogger::logSetConfigProperty(
+    const String & userName,
+    const String & propertyName,
+    const String & prePropertyValue,
+    const String & newPropertyValue,
+    Boolean isPlanned)
+{
+    if (isPlanned)
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.SET_PLANNED_CONFIG_PROPERTY",
+            "The planned value of property \"$0\" is modified from "
+                "value \"$1\" to value \"$2\" by user \"$3\".",
+            propertyName, prePropertyValue, newPropertyValue, userName);
+
+        _writeAuditMessage(TYPE_CONFIGURATION,
+            SUBTYPE_CONFIGURATION_CHANGE,
+            EVENT_UPDATE, Logger::INFORMATION, msgParms);
+    }
+    else
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.SET_CURRENT_CONFIG_PROPERTY",
+            "The current value of property \"$0\" is modified from "
+                "value \"$1\" to value \"$2\" by user \"$3\".",
+            propertyName, prePropertyValue, newPropertyValue, userName);
+
+        _writeAuditMessage(TYPE_CONFIGURATION,
+            SUBTYPE_CONFIGURATION_CHANGE,
+            EVENT_UPDATE, Logger::INFORMATION, msgParms);
+    }
+}
+
+void AuditLogger::logUpdateClassOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMName& className,
+    CIMStatusCode statusCode)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.OPERATION_UPDATE_CLASS",
+        "A CIM $0 operation on class \"$1\" in namespace \"$2\" by user "
+            "\"$3\" connected from system \"$4\" resulted in status \"$5\".",
+        cimMethodName,
+        className.getString(),
+        nameSpace.getString(),
+        userName,
+        ipAddr,
+        cimStatusCodeToString(statusCode));
+
+    _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_SCHEMA_OPERATION,
+        eventType, Logger::INFORMATION, msgParms);
+}
+
+void AuditLogger::logUpdateQualifierOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMName& className,
+    CIMStatusCode statusCode)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.OPERATION_UPDATE_QUALIFIER",
+        "A CIM $0 operation on qualifier \"$1\" in namespace \"$2\" by user "
+            "\"$3\" connected from system \"$4\" resulted in status \"$5\".",
+        cimMethodName,
+        className.getString(),
+        nameSpace.getString(),
+        userName,
+        ipAddr,
+        cimStatusCodeToString(statusCode));
+
+    _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_SCHEMA_OPERATION,
+        eventType, Logger::INFORMATION, msgParms);
+}
+
+void AuditLogger::logUpdateInstanceOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMObjectPath& instanceName,
+    const String& moduleName,
+    const String& providerName,
+    CIMStatusCode statusCode)
+{
+    if (providerName != String::EMPTY)
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.OPERATION_UPDATE_INSTANCE_WITH_PROVIDER",
+            "A CIM $0 operation on instance \"$1\" in namespace \"$2\" by "
+                "user \"$3\" connected from system \"$4\" resulted in "
+                "status \"$5\".  "
+                "The provider for this operation is \"$6\" in module \"$7\".",
+            cimMethodName,
+            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
+                instanceName.getKeyBindings()).toString(),
+            nameSpace.getString(),
+            userName,
+            ipAddr,
+            cimStatusCodeToString(statusCode),
+            providerName,
+            moduleName);
+
+        _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
+            eventType, Logger::INFORMATION, msgParms);
+    }
+    else
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.OPERATION_UPDATE_INSTANCE",
+            "A CIM $0 operation on instance \"$1\" in namespace \"$2\" by "
+                "user \"$3\" connected from system \"$4\" resulted in "
+                "status \"$5\".  ",
+            cimMethodName,
+            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
+                instanceName.getKeyBindings()).toString(),
+            nameSpace.getString(),
+            userName,
+            ipAddr,
+            cimStatusCodeToString(statusCode));
+
+        _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
+            eventType, Logger::INFORMATION, msgParms);
+    }
+}
+
+void AuditLogger::logInvokeMethodOperation(
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMObjectPath& objectName,
+    const CIMName& methodName,
+    const String& moduleName,
+    const String& providerName,
+    CIMStatusCode statusCode)
+{
+    if (providerName != String::EMPTY)
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.OPERATION_INVOKE_METHOD_WITH_PROVIDER",
+            "A CIM InvokeMethod operation on method \"$0\" of object \"$1\" "
+                "in namespace \"$2\" by user \"$3\" connected from system "
+                "\"$4\" resulted in status \"$5\".  The provider for this "
+                "operation is \"$6\" in module \"$7\".",
+            methodName.getString(),
+            CIMObjectPath("", CIMNamespaceName(), objectName.getClassName(),
+                objectName.getKeyBindings()).toString(),
+            nameSpace.getString(),
+            userName,
+            ipAddr,
+            cimStatusCodeToString(statusCode),
+            providerName,
+            moduleName);
+
+        _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
+            EVENT_INVOKE, Logger::INFORMATION, msgParms);
+    }
+    else
+    {
+        MessageLoaderParms msgParms(
+            "Common.AuditLogger.OPERATION_INVOKE_METHOD",
+            "A CIM InvokeMethod operation on method \"$0\" of object \"$1\" "
+                "in namespace \"$2\" by user \"$3\" connected from system "
+                "\"$4\" resulted in status \"$5\".",
+            methodName.getString(),
+            CIMObjectPath("", CIMNamespaceName(), objectName.getClassName(),
+                objectName.getKeyBindings()).toString(),
+            nameSpace.getString(),
+            userName,
+            ipAddr,
+            cimStatusCodeToString(statusCode));
+
+        _writeAuditMessage(TYPE_CIMOPERATION, SUBTYPE_INSTANCE_OPERATION,
+            EVENT_INVOKE, Logger::INFORMATION, msgParms);
+    }
+}
+
+void AuditLogger::logUpdateProvModuleStatus(
+    const String & moduleName,
+    const Array<Uint16> currentModuleStatus,
+    const Array<Uint16> newModuleStatus)
+{
+    String currentModuleStatusValue =
+        _getModuleStatusValue(currentModuleStatus);
+
+    String newModuleStatusValue = _getModuleStatusValue(newModuleStatus);
+
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.UPDATE_PROVIDER_MODULE_STATUS",
+        "The operational status of module \"$0\" has changed from \"$1\""
+        " to \"$2\".",
+        moduleName, currentModuleStatusValue, newModuleStatusValue);
+
+    _writeAuditMessage(TYPE_CONFIGURATION,
+        SUBTYPE_PROVIDER_MODULE_STATUS_CHANGE,
+        EVENT_UPDATE, Logger::INFORMATION, msgParms);
+}
+
+void AuditLogger::logLocalAuthentication(
+    const String& userName,
+    Boolean successful)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.LOCAL_AUTHENTICATION",
+        "Local authentication attempt: "
+        "successful = $0, user = $1. ",
+        CIMValue(successful).toString(),
+        userName);
+
+    _writeAuditMessage(
+        TYPE_AUTHENTICATION,
+        SUBTYPE_LOCAL_AUTHENTICATION,
+        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
+        successful ? Logger::INFORMATION : Logger::WARNING,
+        msgParms);
+}
+
+void AuditLogger::logBasicAuthentication(
+    const String& userName,
+    const String& ipAddr,
+    Boolean successful)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.BASIC_AUTHENTICATION",
+        "Basic authentication attempt: "
+        "successful = $0, user = $1, IP address = $2.",
+        CIMValue(successful).toString(),
+        userName,
+        ipAddr);
+
+    _writeAuditMessage( TYPE_AUTHENTICATION,
+        SUBTYPE_BASIC_AUTHENTICATION,
+        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
+        successful ? Logger::INFORMATION: Logger::WARNING,
+        msgParms);
+}
+
+void AuditLogger::logCertificateBasedAuthentication(
+    const String& issuerName,
+    const String& subjectName,
+    const String& serialNumber,
+    const String& ipAddr,
+    Boolean successful)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.CERTIFICATE_BASED_AUTHENTICATION",
+        "Certificate based authentication attempt: "
+            "successful = $0, issuer = $1, subject = $2, serialNumber = $3, "
+            "IP address = $4.",
+        CIMValue(successful).toString(),
+        issuerName,
+        subjectName,
+        serialNumber,
+        ipAddr);
+
+    _writeAuditMessage(TYPE_AUTHENTICATION,
+        SUBTYPE_CERTIFICATE_BASED_AUTHENTICATION,
+        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
+        successful ? Logger::INFORMATION: Logger::WARNING,
+        msgParms);
+}
+
+void AuditLogger::logCertificateBasedUserValidation(
+    const String& userName,
+    const String& issuerName,
+    const String& subjectName,
+    const String& serialNumber,
+    const String& ipAddr,
+    Boolean successful)
+{
+    MessageLoaderParms msgParms(
+        "Common.AuditLogger.CERTIFICATE_BASED_USER_VALIDATION",
+        "Certificate based user validation attempt: "
+            "successful = $0, userName = $1, issuer = $2, subject = $3, "
+            "serialNumber = $4, IP address = $5.",
+        CIMValue(successful).toString(),
+        userName,
+        issuerName,
+        subjectName,
+        serialNumber,
+        ipAddr);
+
+    _writeAuditMessage( TYPE_AUTHORIZATION,
+        SUBTYPE_CERTIFICATE_BASED_USER_VALIDATION,
+        successful ? EVENT_AUTH_SUCCESS : EVENT_AUTH_FAILURE,
+        successful ? Logger::INFORMATION: Logger::WARNING,
+        msgParms);
+}
+
+void AuditLogger::setInitializeCallback(
+    PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T auditLogInitializeCallback)
+{
+    _auditLogInitializeCallback = auditLogInitializeCallback;
+}
+
+void AuditLogger::setEnabled(Boolean enabled)
+{
+    // Only write the enable/disable messages if we are set up to handle them
+    if (_auditLogInitializeCallback != 0)
+    {
+        if (enabled)
+        {
+            if (!_auditLogFlag)
+            {
+                _auditLogInitializeCallback();
+
+                MessageLoaderParms msgParms(
+                    "Common.AuditLogger.ENABLE_AUDIT_LOG",
+                    "Audit logging is enabled.");
+
+                _writeAuditMessage(TYPE_CONFIGURATION,
+                    SUBTYPE_CONFIGURATION_CHANGE,
+                    EVENT_UPDATE, Logger::INFORMATION, msgParms);
+            }
+        }
+        else
+        {
+            if (_auditLogFlag)
+            {
+                MessageLoaderParms msgParms(
+                    "Common.AuditLogger.DISABLE_AUDIT_LOG",
+                    "Audit logging is disabled.");
+
+                _writeAuditMessage(TYPE_CONFIGURATION,
+                    SUBTYPE_CONFIGURATION_CHANGE,
+                    EVENT_UPDATE, Logger::INFORMATION, msgParms);
+            }
+        }
+    }
+
+    _auditLogFlag = enabled;
+}
+
+void AuditLogger::setAuditLogWriterCallback(
+    PEGASUS_AUDITLOG_CALLBACK_T writeAuditLogCallback)
+{
+    _writeAuditMessage = writeAuditLogCallback;
+}
+
+void AuditLogger::_writeAuditMessageToLog(
+    AuditType auditType,
+    AuditSubType auditSubType,
+    AuditEvent auditEvent,
+    Uint32 logLevel,
+    MessageLoaderParms & msgParms)
+{
+    String localizedMsg = MessageLoader::getMessage(msgParms);
+
+    String identifier = "cimserver audit";
+
+    Logger::put(Logger::AUDIT_LOG, identifier, logLevel, localizedMsg);
+}
+
+String AuditLogger::_getModuleStatusValue(
+    const Array<Uint16>  moduleStatus)
+{
+    String moduleStatusValue, statusValue;
+    Uint32 moduleStatusSize = moduleStatus.size();
+
+    for (Uint32 j=0; j < moduleStatusSize; j++)
+    {
+        statusValue = providerModuleStatus[moduleStatus[j]];
+        moduleStatusValue.append(statusValue);
+
+        if (j < moduleStatusSize - 1)
+        {
+            moduleStatusValue.append(",");
+        }
+    }
+
+    return moduleStatusValue;
+}
+
+PEGASUS_NAMESPACE_END
+
+#endif
diff --git a/src/Pegasus/Common/AuditLoggerToSMF.cpp b/src/Pegasus/Common/AuditLoggerToSMF.cpp
new file mode 100644 (file)
index 0000000..8459322
--- /dev/null
@@ -0,0 +1,865 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#include <Pegasus/Common/Config.h>
+#include <Pegasus/Common/Constants.h>
+#include <Pegasus/Common/Logger.h>
+#include <Pegasus/Common/AuditLogger.h>
+#include <Pegasus/Common/Audit_zOS_SMF.h>
+
+#include <stdlib.h>
+
+#ifndef PEGASUS_DISABLE_AUDIT_LOGGER
+
+PEGASUS_USING_STD;
+
+PEGASUS_NAMESPACE_BEGIN
+
+// Initialize the global and static variables:
+// - Audit logging is disabled.
+Boolean AuditLogger::_auditLogFlag = false;
+
+// - The initiation call back is set to zero.
+AuditLogger::PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T
+    AuditLogger::_auditLogInitializeCallback = 0;
+
+// - The interanl writer for audit messages is used
+AuditLogger::PEGASUS_AUDITLOG_CALLBACK_T AuditLogger::_writeAuditMessage =
+    Audit_zOS_SMF::writeRecord ;
+Boolean _isInternalWriterUsed = true;
+
+// - Instantiate the smf helper class.
+Audit_zOS_SMF _smf;
+
+// Definition of the CIM operation types for the 
+// CIM operation SMF record.
+enum _smf_cim_oper_type {
+    CLASS_OPERATION=0,
+    QUALIFER_OPERATION=1,
+    INSTANCE_OPERATION=2,
+    INVOKE_METHOD=3
+} ;
+
+// Definition of the CIM authentication mode for the
+// CIM authentication SMF record.
+enum _smf_cim_auth_mode {
+    LOCAL=0,
+    BASIC=1,
+    ATTLS=2,
+} ;
+
+
+void AuditLogger::setInitializeCallback(
+        PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T auditLogInitializeCallback)
+{
+    _auditLogInitializeCallback = auditLogInitializeCallback;
+}
+
+
+void AuditLogger::setAuditLogWriterCallback(
+    PEGASUS_AUDITLOG_CALLBACK_T writeAuditLogCallback)
+{
+    _writeAuditMessage = writeAuditLogCallback;
+    _isInternalWriterUsed = false;
+}
+
+void AuditLogger::logCurrentConfig(
+    const Array<String> & propertyNames,
+    const Array<String> & propertyValues)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CONFIGURATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        unsigned char * confRecord;
+        unsigned char * cursor;
+        int cursorOffset;
+
+        _smf86_configuration * confSection;
+        int nameLen;
+        int valueLen; 
+
+        // For all properties write a record.
+        for (Uint32 i = 0; i < propertyNames.size(); i++)
+        {
+            // +1 for the 0x00 termination.
+            nameLen = propertyNames[i].size()+1;
+            valueLen =  propertyValues[i].size()+1;
+
+            // Allocate the full record.
+            confRecord = (unsigned char *) calloc(1,
+                sizeof(_smf86_configuration_record) + nameLen + valueLen );
+
+            // Initialize the header and product section.
+            // The length is the total of subtype section + variable parts.
+            _smf.initMyProlog((_smf86_record_prolog *)confRecord, CONFIGURATION,
+                sizeof(_smf86_configuration) + nameLen + valueLen );
+
+            // Set the pointer to the subtype section.
+            confSection = (_smf86_configuration *)
+                (confRecord + sizeof(_smf86_record_prolog));
+
+            // No user Id for logging current configuration.
+            _smf.setEBCDICRecordField(confSection->UserID, "",
+                sizeof(confSection->UserID),false);
+
+            // Configutation is listed
+            confSection->PropChange = 0;
+
+            // The variable values are starting 
+            // at the end of the subtype section.
+            cursor = confRecord + sizeof(_smf86_configuration_record);
+            cursorOffset = sizeof(_smf86_configuration);
+
+           // Set the propety name 
+           confSection->NameOf = cursorOffset;
+           confSection->NameNo = 1;
+           confSection->NameLen = nameLen;
+           _smf.setEBCDICRecordField(cursor,
+               (const char*)propertyNames[i].getCString(),
+               nameLen,true);
+
+           cursor = cursor + nameLen;
+           cursorOffset = cursorOffset + nameLen;
+           
+           // Set the property value.
+           confSection->ValueOf = cursorOffset;
+           confSection->ValueNo = 1;
+           confSection->ValueLen = valueLen;
+           _smf.setEBCDICRecordField(cursor,
+               (const char*)propertyValues[i].getCString(),
+               valueLen,true);
+
+            // New property is set to 0, not used at listing the configuration.
+            confSection->NewValueOf = 0;
+            confSection->NewValueNo = 0;
+            confSection->NewValueLen = 0;
+
+            _writeAuditMessage(CONFIGURATION,(char *)confRecord);
+            free(confRecord);
+        } // End for all properties do.
+    }
+}
+
+void AuditLogger::logCurrentRegProvider(
+    const Array < CIMInstance > & instances)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CONFIGURATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        unsigned char * provStatRecord;
+        unsigned char * cursor;
+        int cursorOffset;
+
+        _smf86_provider_status * provStatSection;
+
+        String moduleName;
+        int moduleNameLen;
+        String statusValue;
+        Uint32 pos;
+
+        // For all current registered providers.
+        for (Uint32 i = 0; i < instances.size(); i++)
+        {
+            // Get the module name.
+            instances[i].getProperty(instances[i].findProperty(
+                _PROPERTY_PROVIDERMODULE_NAME)).getValue().get(moduleName);
+
+            // +1 for the 0x00 termination.
+            moduleNameLen = moduleName.size()+1;
+
+            // Allocate the full record.
+            provStatRecord = (unsigned char *) calloc(1,
+                sizeof(_smf86_provider_status_record) + moduleNameLen );
+
+            // Initialize the header and product section.
+            // The length is the total of subtype section + variable parts.
+            _smf.initMyProlog((_smf86_record_prolog *)provStatRecord, 
+                PROVIDER_STATUS,
+                sizeof(_smf86_provider_status) + moduleNameLen );
+
+            // Set the pointer to the subtype section.
+            provStatSection = (_smf86_provider_status *)
+                (provStatRecord + sizeof(_smf86_record_prolog));
+
+            pos = instances[i].findProperty(_PROPERTY_OPERATIONALSTATUS);
+
+            if (pos == PEG_NOT_FOUND)
+            {
+                provStatSection->CurrStatus = 0;
+            }
+            else
+            {
+                CIMValue theValue = instances[i].getProperty(pos).getValue();
+                if (theValue.isNull())
+                {
+                    provStatSection->CurrStatus = 0;
+                }
+                else
+                {
+                    Array<Uint16> moduleStatus;
+                    // Get the module status
+                    theValue.get(moduleStatus);
+                    // reset the smf record field 
+                    provStatSection->CurrStatus = 0;
+                    for (int j = 0; j < moduleStatus.size();j++)
+                    {
+                        // Accumulate the status of the provider 
+                        // by shifting a bit the value of moduleStatus
+                        // times to the left to get the right bit set.
+                        provStatSection->CurrStatus = 
+                            provStatSection->CurrStatus + 
+                            ( 1 << moduleStatus[j] );
+                    }
+
+                }
+            } // End of status set.
+
+            // The provider does not change its state.
+            provStatSection->IsChanging=0;
+            provStatSection->NewStatus=0;
+
+            // The variable values are starting 
+            // at the end of the subtype section.
+            cursor = provStatRecord + sizeof(_smf86_provider_status_record);
+            cursorOffset = sizeof(_smf86_provider_status);
+
+            // Set the provider module name.
+            provStatSection->ProvNameOf = cursorOffset;
+            provStatSection->ProvNameNo = 1;
+            provStatSection->ProvNameLen = moduleNameLen;
+            _smf.setEBCDICRecordField(cursor,
+                (const char*)moduleName.getCString(),
+                moduleNameLen,true);
+
+            _writeAuditMessage(PROVIDER_STATUS,(char *)provStatRecord);
+            free(provStatRecord);
+
+        } // For all current registered providers.
+    }
+}
+
+void AuditLogger::logCurrentEnvironmentVar()
+{
+    // This logging is currently not done within z/OS
+}
+
+void AuditLogger::logSetConfigProperty(
+    const String & userName,
+    const String & propertyName,
+    const String & prePropertyValue,
+    const String & newPropertyValue,
+    Boolean isPlanned)
+{
+    // check if SMF is gathering this type of records.
+
+    if (_smf.isRecording(CONFIGURATION) ||
+        (! _isInternalWriterUsed) )
+    {
+        unsigned char * confRecord;
+        unsigned char * cursor;
+        int cursorOffset;
+
+        _smf86_configuration * confSection;
+
+        // +1 for the 0x00 termination
+        int nameLen = propertyName.size()+1;
+        int valueLen =  prePropertyValue.size()+1;
+        int newValueLen =  newPropertyValue.size()+1;
+
+        // allocate the full record.
+        confRecord = (unsigned char *) calloc(1,
+                          sizeof(_smf86_configuration_record) 
+                          + nameLen + valueLen + newValueLen );
+
+        // Initialize the header and product section.
+        // The length is the total of subtype section + variable parts.
+        _smf.initMyProlog((_smf86_record_prolog *)confRecord,
+            CONFIGURATION,sizeof(_smf86_configuration) +
+            nameLen + valueLen + newValueLen );
+
+
+        // Set the pointer to the subtype section.
+        confSection = (_smf86_configuration *)
+                         (confRecord + sizeof(_smf86_record_prolog));
+
+       // Set the user id.
+        _smf.setEBCDICRecordField(confSection->UserID,
+                                  (const char*)userName.getCString(),
+                                  sizeof(confSection->UserID),false);
+
+        if (isPlanned)
+        {
+            // It is a planed configuration change.
+            confSection->PropChange = 2;
+        } 
+        else
+        {
+            // It is a current configuration change.
+            confSection->PropChange = 1;
+        }
+
+
+        // The variable values are starting 
+        // at the end of the subtype section.
+        cursor = confRecord + sizeof(_smf86_configuration_record);
+        cursorOffset = sizeof(_smf86_configuration);
+
+        // set the propety name 
+        confSection->NameOf = cursorOffset;
+        confSection->NameNo = 1;
+        confSection->NameLen = nameLen;
+        _smf.setEBCDICRecordField(cursor,
+            (const char*)propertyName.getCString(),
+            nameLen,true);
+
+        cursor = cursor + nameLen;
+        cursorOffset = cursorOffset + nameLen;
+
+        // set the property value
+        confSection->ValueOf = cursorOffset;
+        confSection->ValueNo = 1;
+        confSection->ValueLen = valueLen;
+        _smf.setEBCDICRecordField(cursor,
+            (const char*)prePropertyValue.getCString(),
+            valueLen,true);
+
+        cursor = cursor + valueLen;
+        cursorOffset = cursorOffset + valueLen;
+
+        // set the new property value
+        confSection->NewValueOf = cursorOffset;
+        confSection->NewValueNo = 1;
+        confSection->NewValueLen = newValueLen;
+        _smf.setEBCDICRecordField(cursor,
+            (const char*)newPropertyValue.getCString(),
+            newValueLen,true);
+
+        _writeAuditMessage(CONFIGURATION,(char *)confRecord);
+        free(confRecord);
+    }
+}
+
+void AuditLogger::logUpdateClassOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMName& className,
+    CIMStatusCode statusCode)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CIM_OPERATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        _writeCIMOperationRecord(
+            CLASS_OPERATION, userName, statusCode,
+            ipAddr, cimMethodName, className.getString(),
+            nameSpace.getString(), String::EMPTY, String::EMPTY );
+    }
+}
+
+void AuditLogger::logUpdateQualifierOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMName& className,
+    CIMStatusCode statusCode)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CIM_OPERATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        _writeCIMOperationRecord(
+            QUALIFER_OPERATION, userName, statusCode,
+            ipAddr, cimMethodName, className.getString(),
+            nameSpace.getString(), String::EMPTY, String::EMPTY );
+    }
+}
+
+void AuditLogger::logUpdateInstanceOperation(
+    const char* cimMethodName,
+    AuditEvent eventType,
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMObjectPath& instanceName,
+    const String& moduleName,
+    const String& providerName,
+    CIMStatusCode statusCode)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CIM_OPERATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        String cimInstanceName = 
+            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
+            instanceName.getKeyBindings()).toString();
+
+        _writeCIMOperationRecord(
+            INSTANCE_OPERATION, userName, statusCode,
+            ipAddr, cimMethodName, cimInstanceName,
+            nameSpace.getString(), providerName, moduleName );
+    }
+}
+
+void AuditLogger::logInvokeMethodOperation(
+    const String& userName,
+    const String& ipAddr,
+    const CIMNamespaceName& nameSpace,
+    const CIMObjectPath& objectName,
+    const CIMName& methodName,
+    const String& moduleName,
+    const String& providerName,
+    CIMStatusCode statusCode)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CIM_OPERATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        String cimObjectName = 
+            CIMObjectPath("", CIMNamespaceName(), objectName.getClassName(),
+            objectName.getKeyBindings()).toString();
+
+        _writeCIMOperationRecord(
+            INVOKE_METHOD, userName, statusCode,
+            ipAddr, methodName.getString(), cimObjectName,
+            nameSpace.getString(), providerName,moduleName );
+    }
+}
+
+void AuditLogger::logUpdateProvModuleStatus(
+    const String & moduleName,
+    const Array<Uint16> currentModuleStatus,
+    const Array<Uint16> newModuleStatus)
+{
+        // check if SMF is gathering this type of records.
+    if (_smf.isRecording(CONFIGURATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        unsigned char * provStatRecord;
+        unsigned char * cursor;
+        int cursorOffset;
+
+        _smf86_provider_status * provStatSection;
+
+        // +1 for the 0x00 termination.
+        int moduleNameLen = moduleName.size()+1;;
+        String statusValue;
+        Uint32 pos;
+
+        // Allocate the full record.
+        provStatRecord = (unsigned char *) calloc(1,
+            sizeof(_smf86_provider_status_record) + moduleNameLen );
+
+        // Initialize the header and product section.
+        // The length is the total of subtype section + variable parts.
+        _smf.initMyProlog((_smf86_record_prolog *)provStatRecord, 
+            PROVIDER_STATUS,
+            sizeof(_smf86_provider_status) + moduleNameLen );
+
+        // Set the pointer to the subtype section.
+        provStatSection = (_smf86_provider_status *)
+            (provStatRecord + sizeof(_smf86_record_prolog));
+
+        provStatSection->CurrStatus = 0;
+
+        if (currentModuleStatus.size() > 0)
+        {
+            for (int j = 0; j < currentModuleStatus.size();j++)
+            {
+                // Accumulate the status of the provider 
+                // by shifting a bit the value of moduleStatus
+                // times to the left to get the right bit set.
+                provStatSection->CurrStatus = 
+                    provStatSection->CurrStatus + 
+                    ( 1 << currentModuleStatus[j] );
+            }
+            
+        }
+
+        // The provider does change.
+        provStatSection->IsChanging=1;
+
+        provStatSection->NewStatus=0;
+
+        if (newModuleStatus.size() > 0)
+        {
+            // Accumulate the new status of the provider 
+            // by shifting a bit the value of moduleStatus
+            // times to the left to get the right bit set.
+            for (int j = 0; j < newModuleStatus.size();j++)
+            {
+                provStatSection->NewStatus = 
+                    provStatSection->NewStatus + ( 1 << newModuleStatus[j] );
+            }
+
+        }
+
+        // The variable values are starting 
+        // at the end of the subtype section.
+        cursor = provStatRecord + sizeof(_smf86_provider_status_record);
+        cursorOffset =  sizeof(_smf86_provider_status);
+
+        // Set the provider module name.
+        provStatSection->ProvNameOf =cursorOffset;
+        provStatSection->ProvNameNo = 1;
+        provStatSection->ProvNameLen = moduleNameLen;
+        _smf.setEBCDICRecordField(cursor,
+            (const char*)moduleName.getCString(),
+            moduleNameLen,true);
+
+        _writeAuditMessage(PROVIDER_STATUS,(char *)provStatRecord);
+        free(provStatRecord);
+    }
+
+}
+
+void AuditLogger::logLocalAuthentication(
+    const String& userName,
+    Boolean successful)
+{         
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(AUTHENTICATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        _writeAuthenticationRecord(LOCAL,userName,successful,
+            "localhost");
+    }
+}
+
+void AuditLogger::logBasicAuthentication(
+    const String& userName,
+    const String& ipAddr,
+    Boolean successful)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(AUTHENTICATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        _writeAuthenticationRecord(BASIC,userName,successful,
+            ipAddr);
+    }
+}
+
+void AuditLogger::logCertificateBasedAuthentication(
+    const String& issuerName,
+    const String& subjectName,
+    const String& serialNumber,
+    const String& ipAddr,
+    Boolean successful)
+{
+    // This fuction is unimplemented within z/OS.
+    // AT-TLS is doing this kind of logging.
+}
+
+void AuditLogger::logCertificateBasedUserValidation(
+    const String& userName,
+    const String& issuerName,
+    const String& subjectName,
+    const String& serialNumber,
+    const String& ipAddr,
+    Boolean successful)
+{
+    // check if SMF is gathering this type of records.
+    if (_smf.isRecording(AUTHENTICATION) ||
+        (! _isInternalWriterUsed) )
+    {   
+        _writeAuthenticationRecord(ATTLS,userName,successful,
+            ipAddr);
+    }
+
+}
+
+
+void AuditLogger::setEnabled(Boolean enable)
+{
+    if (enable)
+    {
+        if (!_auditLogFlag)
+        {
+            Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, 
+                Logger::INFORMATION,
+                "Common.AuditLogger.ENABLE_AUDIT_LOG",
+                "Audit logging is enabled.");
+
+            // only call the audit intiialzation call back if set.
+            if (_auditLogInitializeCallback != 0)
+            {
+                _auditLogInitializeCallback();
+            }
+        }
+    }
+    else
+    {
+        if (_auditLogFlag)
+        {
+            Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, 
+                Logger::INFORMATION,
+                "Common.AuditLogger.DISABLE_AUDIT_LOG",
+                "Audit logging is disabled.");
+        }
+    }
+
+    _auditLogFlag = enable;
+
+}
+
+inline void AuditLogger::_writeCIMOperationRecord(
+    unsigned short cimOpType,
+    String userID,
+    unsigned short cimStatusCode,
+    String clientIP,
+    String operName,
+    String objPath,
+    String nameSpace,
+    String provName,
+    String provModName
+    )
+{
+    unsigned char * cimOperRecord;
+    unsigned char * cursor;
+    int cursorOffset;
+
+    _smf86_cim_operation * cimOperSection;
+
+    int operNameLen = operName.size();
+    int objPathLen = objPath.size();
+    int nameSpaceLen = nameSpace.size();
+    int provNameLen = provName.size();
+    int provModNameLen = provModName.size();
+
+    // if a string is not empty, + 1 for the trailing 0x00
+    if( operNameLen > 0 )
+        operNameLen = operNameLen + 1 ;
+
+    if( objPathLen > 0 )
+        objPathLen = objPathLen + 1;
+
+    if( nameSpaceLen > 0 )
+        nameSpaceLen = nameSpaceLen + 1;
+
+    if( provNameLen > 0 )
+        provNameLen = provNameLen + 1;
+
+    if( provModNameLen > 0 )
+        provModNameLen = provModNameLen + 1;
+
+    // Allocate the full record.
+    cimOperRecord = (unsigned char *) calloc(1,
+        sizeof(_smf86_cim_operation_record)+
+        operNameLen + objPathLen + nameSpaceLen + 
+        provNameLen + provModNameLen );
+
+    // Initialize the header and product section.
+    // The length is the total of subtype section + variable parts.
+    _smf.initMyProlog((_smf86_record_prolog *)cimOperRecord, 
+        CIM_OPERATION, sizeof(_smf86_cim_operation)+
+        operNameLen + objPathLen + nameSpaceLen + 
+        provNameLen + provModNameLen );
+
+    // Set the pointer to the subtype section.
+    cimOperSection = (_smf86_cim_operation *) 
+        (cimOperRecord + sizeof(_smf86_record_prolog));
+
+    // Set cim operation type.
+    cimOperSection->CIMOpType = cimOpType;
+
+    // Set cim operation status code
+    cimOperSection->CIMStatusCode = cimStatusCode;
+
+    // Set the user id.
+    _smf.setEBCDICRecordField(cimOperSection->UserID,
+                              (const char*)userID.getCString(),
+                              sizeof(cimOperSection->UserID),false);
+
+    // Set the client IP adress.
+    _smf.setEBCDICRecordField(cimOperSection->ClientIP,
+                              (const char*)clientIP.getCString(),
+                              sizeof(cimOperSection->ClientIP),false);
+
+    
+    // The operation name starts from the end of the static record information.
+    cursor = cimOperRecord + sizeof(_smf86_cim_operation_record);
+    cursorOffset = sizeof(_smf86_cim_operation);
+
+    // Set operation name 
+    if (operNameLen > 0 )
+    {
+        cimOperSection->OperNameOf = cursorOffset;
+        cimOperSection->OperNameLen = operNameLen;
+        cimOperSection->OperNameNo = 1;
+        _smf.setEBCDICRecordField(cursor,(const char*)operName.getCString(),
+                                  operNameLen,true);
+        cursor = cursor + operNameLen;
+        cursorOffset = cursorOffset + operNameLen;
+    } 
+    else
+    {
+        cimOperSection->OperNameOf = 0;
+        cimOperSection->OperNameLen = 0;
+        cimOperSection->OperNameNo = 0;
+    }
+    
+    // Set object path
+    if (objPathLen > 0 )
+    {
+        cimOperSection->ObjPathOf = cursorOffset;
+        cimOperSection->ObjPathLen = objPathLen;
+        cimOperSection->ObjPathNo = 1;
+        _smf.setEBCDICRecordField(cursor,(const char*)objPath.getCString(),
+                                  objPathLen,true);
+        cursor = cursor + objPathLen;
+        cursorOffset = cursorOffset + objPathLen;
+    }
+    else
+    {
+        cimOperSection->ObjPathOf = 0;
+        cimOperSection->ObjPathLen = 0;
+        cimOperSection->ObjPathNo = 0;
+    }
+
+    // Set name space
+    if (nameSpaceLen > 0 )
+    {
+        cimOperSection->NameSpaceOf = cursorOffset;
+        cimOperSection->NameSpaceLen = nameSpaceLen;
+        cimOperSection->NameSpaceNo = 1;
+        _smf.setEBCDICRecordField(cursor,(const char*)nameSpace.getCString(),
+                                  nameSpaceLen,true);
+        cursor = cursor + nameSpaceLen;
+        cursorOffset = cursorOffset + nameSpaceLen;
+    }
+    else
+    {
+        cimOperSection->NameSpaceOf = 0;
+        cimOperSection->NameSpaceLen = 0;
+        cimOperSection->NameSpaceNo = 0;
+    }
+
+    // Set provider name
+    if (provNameLen > 0 )
+    {
+        cimOperSection->ProvNameOf = cursorOffset;
+        cimOperSection->ProvNameLen = provNameLen;
+        cimOperSection->ProvNameNo = 1;
+        _smf.setEBCDICRecordField(cursor,(const char*)provName.getCString(),
+                                  provNameLen,true);
+        cursor = cursor + provNameLen;
+        cursorOffset = cursorOffset + provNameLen;
+    }
+    else
+    {
+        cimOperSection->ProvNameOf = 0;
+        cimOperSection->ProvNameLen = 0;
+        cimOperSection->ProvNameNo = 0;
+    }
+
+    // Set provider module name
+    if (provModNameLen > 0 )
+    {
+        cimOperSection->ProvModNameOf = cursorOffset;
+        cimOperSection->ProvModNameLen = provModNameLen;
+        cimOperSection->ProvModNameNo = 1;
+        _smf.setEBCDICRecordField(cursor,(const char*)provModName.getCString(),
+                                  provModNameLen,true);
+        cursor = cursor + provModNameLen;
+        cursorOffset = cursorOffset + provModNameLen;
+    }
+    else
+    {
+        cimOperSection->ProvModNameOf = 0;
+        cimOperSection->ProvModNameLen = 0;
+        cimOperSection->ProvModNameNo = 0;
+    }
+    
+    _writeAuditMessage(CIM_OPERATION,(char *)cimOperRecord);
+    free(cimOperRecord);
+
+
+}
+
+inline void AuditLogger::_writeAuthenticationRecord(
+    unsigned short authMode,
+    String userID,
+    Boolean isAuthenticated,
+    String clientIP )
+{
+    unsigned char * authenticationRecord;
+    _smf86_authentication * authenticationSection;
+
+    // Allocate the full record.
+    authenticationRecord = (unsigned char *) calloc(1,
+        sizeof(_smf86_auththentication_record));
+
+    // Initialize the header and product section.
+    // The length is the total of subtype section + variable parts.
+    _smf.initMyProlog((_smf86_record_prolog *)authenticationRecord, 
+        AUTHENTICATION, sizeof(_smf86_authentication));
+
+    // Set the pointer to the subtype section.
+    authenticationSection = (_smf86_authentication *)
+                     (authenticationRecord + sizeof(_smf86_record_prolog));
+
+    authenticationSection->AuthMode = authMode;
+
+    // Set the user id.
+    _smf.setEBCDICRecordField(authenticationSection->UserID,
+                              (const char*)userID.getCString(),
+                              sizeof(authenticationSection->UserID),false);
+
+    if(isAuthenticated)
+    {
+        authenticationSection->AuthResult=0;
+    }
+    else
+    {
+        authenticationSection->AuthResult=1;
+    }
+
+    // Set the client IP adress.
+    _smf.setEBCDICRecordField(authenticationSection->ClientIP,
+                              (const char*)clientIP.getCString(),
+                              sizeof(authenticationSection->ClientIP),false);
+
+    _writeAuditMessage(AUTHENTICATION,(char *)authenticationRecord);
+    free(authenticationRecord);
+}
+
+PEGASUS_NAMESPACE_END
+
+#endif
diff --git a/src/Pegasus/Common/Audit_zOS_SMF.cpp b/src/Pegasus/Common/Audit_zOS_SMF.cpp
new file mode 100644 (file)
index 0000000..0df6ab4
--- /dev/null
@@ -0,0 +1,322 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#include <Pegasus/Common/Config.h>
+#include <Pegasus/Common/Constants.h>
+#include <Pegasus/Common/PegasusVersion.h>
+#include <Pegasus/Common/Threads.h>
+#include <Pegasus/Common/AuditLogger.h>
+#include <Pegasus/Common/Tracer.h>
+#include <Pegasus/Common/Audit_zOS_SMF.h>
+
+#include <sys/utsname.h>
+
+PEGASUS_USING_STD;
+
+PEGASUS_NAMESPACE_BEGIN
+
+static const char* CFZ_EBCDIC = "\xC3\xC6\xE9\x40";  // "CFZ " in EBCDIC
+
+
+// Mutex Audit_zOS_SMF::_protectProlog;
+
+Audit_zOS_SMF::Audit_zOS_SMF()
+{
+    if (_recordProlog == NULL)
+    {
+        AutoMutex autoMut(_protectProlog);
+        if (_recordProlog == NULL)
+        {
+            _recordProlog = (_smf86_record_prolog*)calloc(1, 
+                sizeof(_smf86_record_prolog));
+
+            _preInitRecordHeaderSection(&(_recordProlog->header));
+            _preInitRecordProductSection(&(_recordProlog->product));
+
+        }
+    }
+
+}
+
+Audit_zOS_SMF::~Audit_zOS_SMF()
+{
+    if (_recordProlog != NULL)
+    {
+        AutoMutex huddel(_protectProlog);
+        free(_recordProlog);
+        _recordProlog = NULL;
+    }
+}
+
+void Audit_zOS_SMF::initMyProlog( _smf86_record_prolog * myRecProlog,
+                                _smf_record_suptype subtype,
+                                int subTypeSize)
+{
+
+    // copy the common prolog to the current record
+    memcpy(myRecProlog,_recordProlog, sizeof(_smf86_record_prolog));
+
+    // set header subtye specific values.
+
+    // Set total record length
+    myRecProlog->header.SMF86LEN=(sizeof(_smf86_record_prolog) + subTypeSize );
+    // We do no segmentaion in general 
+    myRecProlog->header.SMF86SEG=0;
+    // Set subtype
+    myRecProlog->header.SMF86STY=subtype; 
+    // Set size of subtype section
+    myRecProlog->header.SMF86STL=subTypeSize;
+
+    // Set thread ID
+    setEBCDICRecordField( myRecProlog->product.SMF86THID, 
+                          Threads::id().buffer,
+                          sizeof(myRecProlog->product.SMF86THID),true);
+
+    return;
+}
+
+Boolean Audit_zOS_SMF::isRecording(_smf_record_suptype subtype)
+{
+    if (__smf_record(86,subtype,0,NULL) < 0)
+    {
+        PEG_TRACE((TRC_SERVER,Tracer::LEVEL4,
+                   "SMF recording not enabled: \'%s\' "
+                       "(errno(%d) reason code(0x%08X))",
+                   strerror(errno),errno,__errno2()));
+        return false;
+    }
+
+    return true;
+}
+
+void Audit_zOS_SMF::writeRecord(int subtype, char* record )
+{
+    // the size of the whole record is stored as short in the first bytes 
+    // of the record.
+    if (__smf_record(86,subtype,((_smf86_header *)record)->SMF86LEN,record) < 0)
+    {
+        PEG_TRACE((TRC_SERVER,Tracer::LEVEL4,
+                   "Can not write SMF records: \'%s\' "
+                       "(errno(%d) reason code(0x%08X))",
+                   strerror(errno),errno,__errno2()));
+    }
+    
+    return;
+}
+
+
+void Audit_zOS_SMF::setEBCDICRecordField(
+    unsigned char * field, 
+    const char * value, 
+    int size, bool nullTerminated )
+{
+    int length = strlen(value);
+
+    // if the value size is larger then the filed size
+    // cut the value to the size fitting in the field.
+    if (length > size)
+    {
+        length = size;
+    }
+
+
+    memcpy((char *)field,value,length);
+
+    if (nullTerminated)
+    {
+        field[length] = 0x00;
+        length++;
+    }
+
+    while (length < size)
+    {
+        field[length] = ' ';
+        length++;
+    }
+
+    // convert the ascii field to ebcdic
+    __a2e_l((char *)field,length);
+
+
+}
+
+
+void Audit_zOS_SMF::_preInitRecordHeaderSection( _smf86_header* recordHeader )
+{
+   
+    recordHeader->SMF86FLG=0xFF;         // Set bit mask to 11111111;
+    recordHeader->SMF86RTY=86;           // Set SMF reckord type
+    recordHeader->SMF86TRN=2;            // Both triplets are used
+                                         // set system identifyter
+    memcpy(recordHeader->SMF86SSI,CFZ_EBCDIC,
+           sizeof(CFZ_EBCDIC));
+
+                                         // start of product section
+    recordHeader->SMF86PRO=sizeof(_smf86_header);
+                                         // size of product section
+    recordHeader->SMF86PRL=sizeof(_smf86_product);
+    recordHeader->SMF86PRN=1;            // one product section
+                                         // start of subtype section
+    recordHeader->SMF86STO=sizeof(_smf86_header)+
+        sizeof(_smf86_product);
+    recordHeader->SMF86STN=1;            // one subtype section
+
+}
+
+void Audit_zOS_SMF::_preInitRecordProductSection ( 
+    _smf86_product* recordProductSec )
+{
+    
+    struct utsname uts;
+    char zOS_VRM[sizeof(uts.version) +
+                 sizeof(uts.release) + 2];
+
+    // set to recrod version 1
+    recordProductSec->SMF86PRRVN = 1; 
+
+    // set system identifyter
+    memcpy(recordProductSec->SMF86SSI,CFZ_EBCDIC,
+           sizeof(CFZ_EBCDIC));
+
+    // set pegasus VRM
+    setEBCDICRecordField( recordProductSec->SMF86VRM, 
+                        PEGASUS_PRODUCT_VERSION,
+                        sizeof(recordProductSec->SMF86VRM),false);
+     if (__osname(&uts) > -1 )
+     {
+
+         zOS_VRM[0] = 0;
+         strcat(zOS_VRM,uts.version);
+         strcat(zOS_VRM,".");
+         strcat(zOS_VRM,uts.release);
+
+         // set OS VRM
+         setEBCDICRecordField( recordProductSec->SMF86OSL, 
+                             zOS_VRM,
+                             sizeof(recordProductSec->SMF86OSL),false);
+
+         // set system name
+         setEBCDICRecordField( recordProductSec->SMF86SYN, 
+                             uts.nodename,
+                             sizeof(recordProductSec->SMF86SYN),false);
+     } else
+     {
+         PEG_TRACE((TRC_SERVER,Tracer::LEVEL4,
+             "Can not get OS version and system name: \'%s\' (errno(%d) "
+             "reason code(%08X))",
+              strerror(errno),errno,__errno2()));
+     }
+
+                                 // set sysplex name
+     _setSysplexName( recordProductSec->SMF86SYP);
+
+     recordProductSec->SMF86OPI = System::getPID();
+
+}
+
+
+void Audit_zOS_SMF::_setSysplexName(unsigned char * field)
+{
+    // Get pointer to the CVT control block
+    int * p = (int *)16;
+    int * cvt_ptr = (int *) *(p);
+    // Get pointer to the eCVT control block
+    int * ecvt_ptr = (int *) *(cvt_ptr+35); // 4*35 = 140 Byte
+    // Get pointer to the sysplex name
+    char * ECVTSPLX = (char *)(ecvt_ptr+2); // 4*2 = 8 Byte
+
+    memcpy((char*)field, ECVTSPLX, 8);
+}
+
+void Audit_zOS_SMF::printRecord (int subtype, char* record )
+{
+    char printLine[3][80];
+    int p;
+    int len;
+    char item;
+    int total = ((_smf86_header *)record)->SMF86LEN;
+
+    printf("\n Char/HEX output(%08X)\n\n",System::getPID());
+
+    for (int i = 0; i <= total;i=i+1)
+    {
+        p = i%80;
+
+        if (p == 0 && i > 0 ||
+            i == total )
+        {
+            for (int y = 0; y < 3; y=y+1)
+            {  
+                if (p == 0)
+                {
+                    len = 80;
+                } else
+                {
+                    len = p;
+                }
+
+                for (int x = 0; x < len; x=x+1)
+                {
+                    if (y == 0)
+                    {
+                        printf("%c",printLine[y][x]);
+                    } 
+                    else
+                    {
+                        printf("%1X",printLine[y][x]);
+                    }                   
+                }
+                printf("\n");
+            }
+            printf("\n");
+        }
+
+        item = record[i];
+        __e2a_l(&item,1);
+
+        if (item < 32 || item > 126)
+        {
+            printLine[0][p] = '.';
+        } else
+        {
+            printLine[0][p] = item;
+        }
+
+        printLine[1][p] = record[i]/16;
+        printLine[2][p] = record[i]%16;
+
+
+    }
+}
+
+PEGASUS_NAMESPACE_END
diff --git a/src/Pegasus/Common/Audit_zOS_SMF.h b/src/Pegasus/Common/Audit_zOS_SMF.h
new file mode 100644 (file)
index 0000000..bcf4ede
--- /dev/null
@@ -0,0 +1,167 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#ifndef Audit_zOS_SMF_h
+#define Audit_zOS_SMF_h
+
+
+#include <Pegasus/Common/Audit_zOS_SMFStructures.h>
+#include <Pegasus/Common/Mutex.h>
+
+PEGASUS_USING_STD;
+
+PEGASUS_NAMESPACE_BEGIN
+
+enum _smf_record_suptype {
+    AUTHENTICATION=1,
+    CONFIGURATION=2,
+    PROVIDER_STATUS=3,
+    CIM_OPERATION=4,
+    INDICATION_OPERATION=5
+} ;
+
+class PEGASUS_COMMON_LINKAGE Audit_zOS_SMF
+{
+
+public:
+
+    /** 
+     * Default constructor
+     */
+    Audit_zOS_SMF();
+
+    /**
+     * Default destructor
+     */
+    ~Audit_zOS_SMF();
+
+    /** 
+     * Initialize the SMF record header and product section with values 
+     * constant for all SMF records. It also set the SMF subtype and 
+     * the total size of the subtype section, including the size of the
+     * variable properties, into the header.
+     * 
+     *  @param myRecProlog - Pointer to the start of the record.
+     * 
+     *  @param subtype - The SMF subtype value for the record.
+     * 
+     *  @param subTypeSize - The size of the subtype section including 
+     *                       the size of variable properties.
+     */
+    void initMyProlog( _smf86_record_prolog * myRecProlog,
+                                    _smf_record_suptype subtype,
+                                    int subTypeSize);
+    /**
+     * Check with SMF if this subtype is recorded by SMF.
+     * 
+     * @param subtype - The SMF subtype.
+     * 
+     */
+    Boolean isRecording(_smf_record_suptype subtype);
+
+    /**
+     * Writes a record to SMF
+     * 
+     * @param subtype - The SMF subtype.
+     * 
+     * @param record - Pointer to the record.
+     * 
+     */
+    static void  writeRecord(int subtype, char * record);
+
+    /**
+     * Dumps a record as HEXDump to stdout.
+     * 
+     * @param subtype - The SMF subtype.
+     * 
+     * @param record - Pointer to the record.
+     * 
+     */
+    static void  printRecord(int subtype, char * record);
+
+    /** 
+     *  Set a SMF record field in EBCDIC. If the value is smaller then the 
+     *  filed, then the remaining field is filled with spaces.
+     * 
+     * @param field - Pointer to the start of the field.
+     * 
+     * @param value - The value for the field 0x00 terminated.
+     * 
+     * @param size - The size of the filed. 
+     * 
+     * @param nullTerminated - If true, then the value is copied including
+     *                         the 0x00 termination.
+     * 
+     */
+    void    setEBCDICRecordField( unsigned char * field, const char * value, 
+                int size, bool nullTerminated );
+
+private:
+
+    /**
+     * Pointer to a SMF record prolog ( header + product section ) 
+     * with initialized with constant values for all record subtypes.
+     */
+    _smf86_record_prolog * _recordProlog;
+    Mutex _protectProlog;
+
+    /**
+     * Initialize a SMF header with constant values.
+     * 
+     * @param smfRecord - The header to initialize.
+     * 
+     */
+    void _preInitRecordHeaderSection( _smf86_header* smfRecord );
+
+    /**
+     * Initialize a SMF product section with constant values.
+     * 
+     * @param smfRecord - The product section to initialize.
+     * 
+     */
+    void _preInitRecordProductSection( _smf86_product* smfRecord );
+
+    /** 
+     * Set the Sysplex name.
+     * 
+     * @param field - The field for the sysplex name.
+     * 
+     */
+    void _setSysplexName(unsigned char * field);
+
+};
+
+PEGASUS_NAMESPACE_END
+
+#endif // Audit_zOS_SMF_h
+
diff --git a/src/Pegasus/Common/Audit_zOS_SMFStructures.h b/src/Pegasus/Common/Audit_zOS_SMFStructures.h
new file mode 100644 (file)
index 0000000..93cb4c3
--- /dev/null
@@ -0,0 +1,187 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#ifndef Audit_zOS_SMFStructures_h
+#define Audit_zOS_SMFStructures_h
+
+#pragma pack(packed)
+
+typedef struct {
+    unsigned short    SMF86LEN;      // Record length
+    unsigned short    SMF86SEG;      // Segmentation desc. 
+    unsigned char     SMF86FLG;      // System indicator
+    unsigned char     SMF86RTY;      // Record type 86 (X'56')
+    unsigned int      SMF86TME;      // ms Time record moved to SMF
+    unsigned char     SMF86DTE[4];   // Packed BCD date (0cyyddF) record 
+                                     // moved to SMF
+    unsigned char     SMF86SID[4];   // System ID in EBCDIC
+    unsigned char     SMF86SSI[4];   // SubsystemID 'CFZ' in EBCDIC
+    unsigned short    SMF86STY;      // Record subtype:
+                                     // Subtype Description
+                                     //    1    Authentication
+                                     //    2    Configuration
+                                     //    3    Provider Status
+                                     //    4    CIM Operations
+                                     //    5    Indicaton Operations
+    unsigned short    SMF86TRN;      // Number of tripltes
+    unsigned short    reserverd;     // Reserved
+    unsigned int      SMF86PRO;      // Offset to product section
+    unsigned short    SMF86PRL;      // Length of product section
+    unsigned short    SMF86PRN;      // Number of product sections (=1)
+    unsigned int      SMF86STO;      // Offset to subtype section
+    unsigned short    SMF86STL;      // Length of subtype section
+    unsigned short    SMF86STN;      // Number of subtype sections (=1)
+} _smf86_header;
+
+typedef struct {
+    unsigned int      SMF86PRRVN;    // SMF Record version 
+    unsigned char     SMF86SSI[4];   // SubSytem ID 'CFZ' in EBCDIC
+    unsigned char     SMF86VRM[8];   // CIM software level 'VV.RR.MM' EBCDIC
+    unsigned char     SMF86OSL[8];   // MVS software level 'VV.RR.MM' EBCDIC
+    unsigned char     SMF86SYN[8];   // System name in EBCDIC
+    unsigned char     SMF86SYP[8];   // Sysplex name in EBCDIC
+    unsigned int      SMF86OPI;      // USS process ID
+    unsigned char     SMF86THID[22]; // Thread Id in EBCDIC
+    unsigned char     reserved[2];   // reserved
+} _smf86_product;
+
+typedef struct {
+    unsigned short    AuthMode;      // Authentication mode:
+                                     // AuthMode Description
+                                     //    0     Local
+                                     //    1     Basic
+                                     //    2     AT-TLS
+    unsigned char     UserID[8];     // User Id
+    unsigned short    AuthResult;    // Authentication result:
+                                     // AuthResult Description
+                                     //     0      Successful
+                                     //     1      Failed
+    unsigned char     ClientIP[42];  // Clinet IP adresse X'00' terminated
+    unsigned char     reserved[2];   // reserved
+} _smf86_authentication;
+
+typedef struct {
+    unsigned char     UserID[8];     // User Id
+    unsigned short    PropChange;    // Mode of property change:
+                                     // PropChange Comment
+                                     //     0      List Conf.
+                                     //     1      Current Conf.
+                                     //     2      Planed Conf.
+    unsigned char     reserved[2];   // reserved              
+    unsigned int      NameOf;         // Offset to property name 
+                                     // from section start
+    unsigned short    NameLen;       // Length of property name
+    unsigned short    NameNo;        // Number of property names (=1)
+    unsigned int      ValueOf;       // Offset to property value
+                                     // from section start
+    unsigned short    ValueLen;      // Length of property value
+    unsigned short    ValueNo;       // Number of property values (=1)
+    unsigned int      NewValueOf;    // Offset to property new value
+                                     // from section start
+    unsigned short    NewValueLen;   // Length of property new value
+    unsigned short    NewValueNo;    // Number of property new values (=1)
+} _smf86_configuration;
+
+typedef struct {
+    unsigned int      CurrStatus;    // The current status of prov.
+    unsigned short    IsChanging;    // If set to 1, then the provider is
+                                     // changing his state and NewStatus
+                                     // value is valid.
+    unsigned char     reserved[2];   // reserved
+    unsigned int      NewStatus;     // The new status of prov.
+    unsigned int      ProvNameOf;    // Offset to provider name
+    unsigned short    ProvNameLen;   // Length of provider name
+    unsigned short    ProvNameNo;    // Number of provider name (=1)
+} _smf86_provider_status;
+
+typedef struct {
+    unsigned short    CIMOpType;     // The CIM operation type:
+                                     // CIMOpTyp Comment
+                                     //    0     Class oper.
+                                     //    1     Qualifyer oper.
+                                     //    2     Instance oper.
+                                     //    3     Invoke methode
+    unsigned char     UserID[8];     // User Id
+    unsigned short    CIMStatusCode; // The result status of the oper.
+    unsigned char     ClientIP[42];  // Clinet IP adresse X'00' terminated
+    unsigned char     reserved[2];   // reserved
+    unsigned int      OperNameOf;    // Offset to oper. name
+    unsigned short    OperNameLen;   // Length of oper. name
+    unsigned short    OperNameNo;    // Number of oper. name
+    unsigned int      ObjPathOf;     // Offset to object path
+    unsigned short    ObjPathLen;    // Length of object path
+    unsigned short    ObjPathNo;     // Number of object path
+    unsigned int      NameSpaceOf;   // Offset to name space
+    unsigned short    NameSpaceLen;  // Length of name space
+    unsigned short    NameSpaceNo;   // Number of name space
+    unsigned int      ProvNameOf;    // Offset to prov. name
+    unsigned short    ProvNameLen;   // Length of prov. name
+    unsigned short    ProvNameNo;    // Number of prov. name
+    unsigned int      ProvModNameOf; // Offset to prov. module name
+    unsigned short    ProvModNameLen;// Length of prov. module name
+    unsigned short    ProvModNameNo; // Number of prov. module name
+} _smf86_cim_operation;
+
+typedef struct {
+    _smf86_header           header;
+    _smf86_product          product;
+    _smf86_authentication   authentication;
+} _smf86_auththentication_record;
+
+typedef struct {
+    _smf86_header           header;
+    _smf86_product          product;
+    _smf86_configuration    configuration;
+} _smf86_configuration_record;
+
+typedef struct {
+    _smf86_header           header;
+    _smf86_product          product;
+    _smf86_provider_status  provider_status;
+} _smf86_provider_status_record;
+
+typedef struct {
+    _smf86_header           header;
+    _smf86_product          product;
+    _smf86_cim_operation    cim_operation;
+} _smf86_cim_operation_record;
+
+typedef struct {
+    _smf86_header           header;
+    _smf86_product          product;
+} _smf86_record_prolog;
+
+
+#pragma pack(reset)
+
+#endif // Audit_zOS_SMFStructures_h
index 567bb24e1c84ae55c3832bce61afa01371e330b3..3442100288808787f8ab20f7d853a2378dee525e 100644 (file)
@@ -220,6 +220,7 @@ ifeq ($(PEGASUS_PLATFORM),ZOS_ZSERIES_IBM)
   ifdef PEGASUS_ZOS_SECURITY
     SOURCES += $(SOURCES_SECURITY_ZOS)
   endif
+  SOURCES2 += Audit_zOS_SMF.cpp
 endif
 
 ifeq ($(PEGASUS_PLATFORM),AIX_RS_IBMCXX)
index b2ad039492ccfccba151393ee6dd64044c3f01e5..b2a9a698d6b22748817256d3d3d11c8c2c9f413c 100644 (file)
 #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/AuditLogger.h>
 
+#ifdef PEGASUS_OS_ZOS
+#include <Pegasus/Common/SetFileDescriptorToEBCDICEncoding.h>
+#include <Pegasus/Common/Audit_zOS_SMF.h>
+#endif
+
 PEGASUS_USING_PEGASUS;
 PEGASUS_USING_STD;
 
@@ -49,6 +54,13 @@ typedef void (*PEGASUS_AUDITLOGINITIALIZE_CALLBACK_T)();
 const String TEST_USER("guest");
 const String TEST_IP("127.0.0.1");
 
+#ifdef PEGASUS_OS_ZOS
+const String MASTER_FILE("/src/Pegasus/Common"
+                 "/tests/AuditLogger/masterOutput_zOS");
+#else
+const String MASTER_FILE("/src/Pegasus/Common/tests/AuditLogger/masterOutput");
+#endif
+
 CIMInstance _createModuleInstance(
     const String & name,
     const String & location,
@@ -87,6 +99,92 @@ void testLogCurrentConf()
     AuditLogger::logCurrentConfig(propertyNames, propertyValues);
 }
 
+#ifdef PEGASUS_OS_ZOS
+static void printSMFRecord (int subtype, char* record )
+{
+    char printLine[3][80];
+    int p;
+    int len;
+    char item;
+    int total = ((_smf86_header *)record)->SMF86LEN;
+
+    const char* pegasusHomeDir = getenv ("PEGASUS_HOME");
+
+    if (pegasusHomeDir == NULL)
+    {
+        pegasusHomeDir = "./";
+    }
+
+    String auditTestLogFile (pegasusHomeDir);
+    auditTestLogFile.append("/AuditTest.log");
+
+    FILE * _auditTestLogFileHandle =
+        fopen(auditTestLogFile.getCString(), "a+");
+
+    setEBCDICEncoding(fileno(_auditTestLogFileHandle));
+
+    for (int i = 0; i <= total;i=i+1)
+    {
+        p = i%80;
+
+        if (p == 0 && i > 0 ||
+            i == total )
+        {
+            for (int y = 0; y < 3; y=y+1)
+            {
+                if (p == 0)
+                {
+                    len = 80;
+                } else
+                {
+                    len = p;
+                }
+
+                for (int x = 0; x < len; x=x+1)
+                {
+                    if (y == 0)
+                    {
+                        fprintf(_auditTestLogFileHandle,"%c",printLine[y][x]);
+                    }
+                    else
+                    {
+                        fprintf( _auditTestLogFileHandle,"%1X",printLine[y][x]);
+                    }
+                }
+                fprintf(_auditTestLogFileHandle,"\n");
+            }
+            fprintf(_auditTestLogFileHandle, "\n");
+        }
+
+        // delete CIM software level, MVS software level, 
+        // System and Sysplex name, Process ID, and Thread ID
+        // to be able to comparable with master result
+        if (i > 51 && i < 110 )
+        {
+          record[i] = 0;
+        }
+
+        item = record[i];
+        __e2a_l(&item,1);
+
+        if (item < 32 || item > 126 )
+        {
+            printLine[0][p] = '.';
+        } else
+        {
+            printLine[0][p] = item;
+        }
+
+        printLine[1][p] = record[i]/16;
+        printLine[2][p] = record[i]%16;
+
+    }
+
+    fclose(_auditTestLogFileHandle);
+}
+
+#else
+
 static void writeAuditLogToFile(
     AuditLogger::AuditType auditType, AuditLogger::AuditSubType auditSubType,
     AuditLogger::AuditEvent auditEvent,
@@ -111,6 +209,7 @@ static void writeAuditLogToFile(
    fclose(_auditTestLogFileHandle);
 }
 
+#endif
 void testLogCurrentRegProvider()
 {
     Array<CIMInstance> instances;
@@ -385,7 +484,11 @@ int main(int argc, char** argv)
 {
 #ifdef PEGASUS_ENABLE_AUDIT_LOGGER
 
-    AuditLogger::writeAuditLogToFileCallback(writeAuditLogToFile);
+#ifdef PEGASUS_OS_ZOS
+    AuditLogger::setAuditLogWriterCallback(printSMFRecord);
+#else
+    AuditLogger::setAuditLogWriterCallback(writeAuditLogToFile);
+#endif
 
     const char* pegasusHomeDir = getenv ("PEGASUS_HOME");
 
@@ -394,10 +497,19 @@ int main(int argc, char** argv)
 
     System::removeFile(auditTestLogFile.getCString());
 
+#ifdef PEGASUS_OS_ZOS
+    // set file encoding to EBCDIC, because the z/OS master file is
+    // in EBCDIC and we are running in ASCII.
+    FILE * _auditTestLogFileHandle =
+        fopen(auditTestLogFile.getCString(), "a+");
+    setEBCDICEncoding(fileno(_auditTestLogFileHandle));
+    fclose(_auditTestLogFileHandle);
+#endif 
+
     const char * masterDir = getenv("PEGASUS_ROOT");
 
     String masterFile (masterDir);
-    masterFile.append("/src/Pegasus/Common/tests/AuditLogger/masterOutput");
+    masterFile.append(MASTER_FILE);
 
     try
     {
diff --git a/src/Pegasus/Common/tests/AuditLogger/masterOutput_zOS b/src/Pegasus/Common/tests/AuditLogger/masterOutput_zOS
new file mode 100644 (file)
index 0000000..53fa5ff
--- /dev/null
@@ -0,0 +1,476 @@
+..................CFZ ..........................CFZ ............................
+0B00F5000000000000CCE400000000020400000704000000CCE40000000000000000000000000000
+0500F60000000000003690020200000C040100000501000136900000000000000000000000000000
+
+................................        ............................AuditLogProp
+00000000000000000000000000000000444444440000000201000003000000000000CA88AD98D999
+000000000000000000000000000000000000000000000004020100060F0100000000144933677967
+
+erty1.AuditLogValue1.
+89AAF0CA88AD98E89A8F0
+593810144933675134510
+
+..................CFZ ..........................CFZ ............................
+0B00F5000000000000CCE400000000020400000704000000CCE40000000000000000000000000000
+0500F60000000000003690020200000C040100000501000136900000000000000000000000000000
+
+................................        ............................AuditLogProp
+00000000000000000000000000000000444444440000000201000003000000000000CA88AD98D999
+000000000000000000000000000000000000000000000004020100060F0100000000144933677967
+
+erty2.AuditLogValue2.
+89AAF0CA88AD98E89A8F0
+593820144933675134520
+
+..................CFZ ..........................CFZ ............................
+0B00F5000000000000CCE400000000020400000704000000CCE40000000000000000000000000000
+0500F60000000000003690020200000C040100000501000136900000000000000000000000000000
+
+................................        ............................AuditLogProp
+00000000000000000000000000000000444444440000000201000003000000000000CA88AD98D999
+000000000000000000000000000000000000000000000004020100060F0100000000144933677967
+
+erty3.AuditLogValue3.
+89AAF0CA88AD98E89A8F0
+593830144933675134530
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule0.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000010000000000040801144933677965945946443500
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule1.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000020000000000040801144933677965945946443510
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule2.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000040000000000040801144933677965945946443520
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule3.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000080000000000040801144933677965945946443530
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule4.
+0000000000000000000000000000000000010000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000000000000000040801144933677965945946443540
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule5.
+0000000000000000000000000000000000020000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000000000000000040801144933677965945946443550
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+................................... ................AuditLogProviderModule6.
+0000000000000000000000000000000000040000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000000000000000040801144933677965945946443560
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule7.
+0000000000000000000000000000000000080000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000000000000000040801144933677965945946443570
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule8.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000100000000000040801144933677965945946443580
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0C00F60000000000003690030200000C040100000C01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule9.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98F0
+0000000000000000000000000000000000200000000000040801144933677965945946443590
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0D00F60000000000003690030200000C040100000D01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule10.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98FF0
+00000000000000000000000000000000004000000000000409011449336779659459464435100
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0D00F60000000000003690030200000C040100000D01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule11.
+0000000000000000000000000000000000000000000000010100CA88AD98D99A8889D98A98FF0
+00000000000000000000000000000000008000000000000409011449336779659459464435110
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0D00F60000000000003690030200000C040100000D01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule12.
+0000000000000000000000000000000000100000000000010100CA88AD98D99A8889D98A98FF0
+00000000000000000000000000000000000000000000000409011449336779659459464435120
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0D00F60000000000003690030200000C040100000D01000136900000000000000000000000000000
+
+....................................................AuditLogProviderModule13.
+0000000000000000000000000000000000200000000000010100CA88AD98D99A8889D98A98FF0
+00000000000000000000000000000000000000000000000409011449336779659459464435130
+
+.x................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0700F60000000000003690020200000C040100000701000136900000000000000000000000000000
+
+................................guest   ............................logdir../log
+000000000000000000000000000000008A8AA4440000000200000002000000030000998889046998
+0000000000000000000000000000000074523000020000040701000B0701000205013674990B1367
+
+s./tmp.
+A06A990
+2013470
+
+.x................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0700F60000000000003690020200000C040100000701000136900000000000000000000000000000
+
+................................guest   ............................logdir../log
+000000000000000000000000000000008A8AA4440000000200000002000000030000998889046998
+0000000000000000000000000000000074523000010000040701000B0701000205013674990B1367
+
+s./tmp.
+A06A990
+2013470
+
+..................CFZ ...................'......CFZ ............................
+0E00F5000000000000CCE400000000020400000707000000CCE40000000000000000000000000000
+0D00F60000000000003690040200000C040100000D01000136900000000000000000000000000000
+
+..................................user1   ..127.0.0.1                           
+0000000000000000000000000000000000AA89F44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000004259100001127B0B0B1000000000000000000000000000
+
+      .....-.......%............................CreateClass.class1.root/test.
+444444000006000000060000000700000000000000000000C988A8C98AA0898AAF0999A6A8AA0
+0000000000000C01000C070100030A01000000000000000039513533122033122109663135230
+
+..................CFZ ...................'......CFZ ............................
+0E00F5000000000000CCE400000000020400000707000000CCE40000000000000000000000000000
+0D00F60000000000003690040200000C040100000D01000136900000000000000000000000000000
+
+..................................        ..localhost                           
+000000000000000000000000000000000044444444009988989AA444444444444444444444444444
+00000000000000000000000000000000000000000002363138623000000000000000000000000000
+
+      .....-.......%............................ModifyClass.CIM_MyClass.test.
+444444000006000000060000000700000000000000000000D9888AC98AA0CCD6DAC98AA0A8AA0
+0000000000000C01000C0C01000805010000000000000000464968331220394D4833122035230
+
+.0................CFZ ..........................CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0000F60000000000003690040200000C040100000001000136900000000000000000000000000000
+
+..................................guest   ..1.1.1.1                             
+00000000000000000000000000000000008A8AA44400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000074523000001B1B1B100000000000000000000000000000
+
+      .....-.......%............................DeleteClass.ByeByeClass.a/b/c/d.
+444444000006000000060000000700000000000000000000C898A8C98AA0CA8CA8C98AA086868680
+0000000000000C01000C0C0100080801000000000000000045353533122028528533122011213140
+
+.Y................CFZ ..........................CFZ ............................
+0E00F5000000000000CCE400000000020400000707000000CCE40000000000000000000000000000
+0800F60000000000003690040200000C040100000801000136900000000000000000000000000000
+
+..................................rootabc ..255.0.0.255                         
+0000000000000000000000000000000000999A888400FFF4F4F4FFF4444444444444444444444444
+00000000000000000000000000000000019663123007255B0B0B2550000000000000000000000000
+
+      .....-......._............................SetQualifier.Test.test2.
+444444000006000000060000000700000000000000000000E8ADA89888890E8AA0A8AAF0
+0000000000000D01000D0501000206010000000000000000253841396959035230352320
+
+.2................CFZ ...................b......CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0200F60000000000003690040200000C040100000201000136900000000000000000000000000000
+
+..................................r       ..4.3.2.1                             
+00000000000000000000000000000000009444444400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000190000000064B3B2B100000000000000000000000000000
+
+      .....-....................................DeleteQualifier.Bogus.test1/test
+444444000006010000070000000700000000000000000000C898A8DA89888890C98AA0A8AAF6A8AA
+00000000000000010000060100060C01000000000000000045353584139695902674203523113523
+
+2.
+F0
+20
+
+.0................CFZ ..........................CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0000F60000000000003690040200000C040100000001000136900000000000000000000000000000
+
+..................................user1   ..127.0.0.9                           
+0000000000000000000000000000000000AA89F44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000024259100001127B0B0B9000000000000000000000000000
+
+      .....-.......?............................CreateInstance.class1.root/test.
+444444000006000000060000000700000000000000000000C988A8C9AA89880898AAF0999A6A8AA0
+0000000000000F01000F070100060A01000000000000000039513595231535033122109663135230
+
+..................CFZ ..........................CFZ ............................
+0000F5000000000000CCE400000000020400000709000000CCE40000000000000000000000000000
+1A00F60000000000003690040200000C040100000A01000136900000000000000000000000000000
+
+..................................user1   ..127.0.0.9                           
+0000000000000000000000000000000000AA89F44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000024259100000127B0B0B9000000000000000000000000000
+
+      .....-.......?.......=.......h.......k....CreateInstance.class1.id="v1".ro
+444444000006000000060000000700000008000000090000C988A8C9AA89880898AAF48877AF7099
+0000000000000F01000F0F01000E0A0100080A0100020801395135952315350331221B94EF51F096
+
+ot/test.Provider1.Module1.
+9A6A8AA0D99A8889F0D98A98F0
+63135230796594591046443510
+
+.5................CFZ ...................e......CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0500F60000000000003690040200000C040100000501000136900000000000000000000000000000
+
+..................................        ..localhost                           
+000000000000000000000000000000000044444444009988989AA444444444444444444444444444
+00000000000000000000000000000000020000000005363138623000000000000000000000000000
+
+      .....-.......?............................ModifyInstance.CIM_MyClass.id=1.
+444444000006000000060100000800000000000000000000D9888AC9AA89880CCD6DAC98AA4887F0
+0000000000000F01000F0101000005010000000000000000464968952315350394D4833122B94E10
+
+test.
+A8AA0
+35230
+
+..................CFZ ..........................CFZ ............................
+0000F5000000000000CCE400000000020400000709000000CCE40000000000000000000000000000
+1B00F60000000000003690040200000C040100000B01000136900000000000000000000000000000
+
+..................................        ..localhost                           
+000000000000000000000000000000000044444444009988989AA444444444444444444444444444
+00000000000000000000000000000000020000000005363138623000000000000000000000000000
+
+      .....-.......?...............e.......j....ModifyInstance.CIM_MyClass.id=1.
+444444000006000000060100000800000008000000090000D9888AC9AA89880CCD6DAC98AA4887F0
+0000000000000F01000F01010000050100050C0100010A01464968952315350394D4833122B94E10
+
+test.TheProvider.TheModule.
+A8AA0E88D99A88890E88D98A980
+352303857965945903854644350
+
+..................CFZ ..........................CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0A00F60000000000003690040200000C040100000A01000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000027452300006127B0B0B1000000000000000000000000000
+
+      .....-.......?.......d....................DeleteInstance.THE_Class.a="A",z
+444444000006000000060100000800000000000000000000C898A8C9AA89880ECC6C98AA4877C76A
+0000000000000F01000F0501000406010000000000000000453535952315350385D33122B1EF1FB9
+
+=10.a/b/c.
+7FF0868680
+E100112130
+
+..................CFZ ...................w......CFZ ............................
+0100F5000000000000CCE40000000002040000070A000000CCE40000000000000000000000000000
+1600F60000000000003690040200000C040100000601000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000027452300006127B0B0B1000000000000000000000000000
+
+      .....-.......?.......d...............r....DeleteInstance.THE_Class.a="A",z
+444444000006000000060100000800000008000000090000C898A8C9AA89880ECC6C98AA4877C76A
+0000000000000F01000F050100040601000A0F0100090D01453535952315350385D33122B1EF1FB9
+
+=10.a/b/c.AHappyProvider.AHappyModule.
+7FF0868680CC899AD99A88890CC899AD98A980
+E1001121301817787965945901817784644350
+
+.0................CFZ ..........................CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0000F60000000000003690040200000C040100000001000136900000000000000000000000000000
+
+..................................me      ..1.0.0.0                             
+00000000000000000000000000000000009844444400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000245000000051B0B0B000000000000000000000000000000
+
+      .....-.......%............................SetProperty.Z.x=0.a/b/c/d/e/f/g.
+444444000006000000060000000700000000000000000000E8AD99989AA0E4A7F086868686868680
+0000000000000C01000C060100020E0100000000000000002537967593809B7E0011213141516170
+
+..................CFZ ...................m......CFZ ............................
+0000F5000000000000CCE400000000020400000709000000CCE40000000000000000000000000000
+1400F60000000000003690040200000C040100000401000136900000000000000000000000000000
+
+..................................me      ..1.0.0.0                             
+00000000000000000000000000000000009844444400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000245000000051B0B0B000000000000000000000000000000
+
+      .....-.......%.......................i....SetProperty.Z.x=0.a/b/c/d/e/f/g.
+444444000006000000060000000700000008000000080000E8AD99989AA0E4A7F086868686868680
+0000000000000C01000C060100020E010000090100090B012537967593809B7E0011213141516170
+
+InstProv.InstModule.
+C9AAD99A0C9AAD98A980
+95237965095234644350
+
+.\................CFZ ..........................CFZ ............................
+0E00F5000000000000CCE400000000020400000707000000CCE40000000000000000000000000000
+0000F60000000000003690040200000C040100000001000136900000000000000000000000000000
+
+..................................guest   ..1.1.1.1                             
+00000000000000000000000000000000008A8AA44400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000374523000011B1B1B100000000000000000000000000000
+
+      .....-...............>....................MyMethod.Test.t.
+444444000006000000060000000600000000000000000000DAD8A8980E8AA0A0
+000000000000090100090501000E020100000000000000004845386403523030
+
+.0................CFZ ..........................CFZ ............................
+0F00F5000000000000CCE400000000020400000708000000CCE40000000000000000000000000000
+0000F60000000000003690040200000C040100000001000136900000000000000000000000000000
+
+..................................guest   ..1.1.1.1                             
+00000000000000000000000000000000008A8AA44400F4F4F4F44444444444444444444444444444
+000000000000000000000000000000000374523000011B1B1B100000000000000000000000000000
+
+      .....-...............:.......@.......=....MyMethod.Test.a=1,b=2,c=3.t.p.m.
+444444000006000000060100000700000007000000070000DAD8A8980E8AA487F687F687F0A09090
+000000000000090100090101000A0201000C0201000E02014845386403523B1E1B2E2B3E30307040
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0F00F60000000000003690030200000C040100000F01000136900000000000000000000000000000
+
+....................................................AuditLogUpdateModuleStatus.
+0000000000000000000000000000000000000000000000010100CA88AD98E988A8D98A98EA8AAA0
+0000000000000000000000000000000000400100000400040B01144933674741354644352313420
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0F00F60000000000003690030200000C040100000F01000136900000000000000000000000000000
+
+....................................................AuditLogUpdateModuleStatus.
+0000000000000000000000000000000000000000000000010100CA88AD98E988A8D98A98EA8AAA0
+0000000000000000000000000000000000400100004000040B01144933674741354644352313420
+
+..................CFZ ..........................CFZ ............................
+0900F5000000000000CCE400000000020400000702000000CCE40000000000000000000000000000
+0F00F60000000000003690030200000C040100000F01000136900000000000000000000000000000
+
+....................................................AuditLogUpdateModuleStatus.
+0000000000000000000000000000000000000000000000010100CA88AD98E988A8D98A98EA8AAA0
+0000000000000000000000000000000000600100001400040B01144933674741354644352313420
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..localhost                           
+00000000000000000000000000000000008A8AA444009988989AA444444444444444444444444444
+00000000000000000000000000000000007452300000363138623000000000000000000000000000
+
+      ..
+44444400
+00000000
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..localhost                           
+00000000000000000000000000000000008A8AA444009988989AA444444444444444444444444444
+00000000000000000000000000000000007452300001363138623000000000000000000000000000
+
+      ..
+44444400
+00000000
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000017452300000127B0B0B1000000000000000000000000000
+
+      ..
+44444400
+00000000
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000017452300001127B0B0B1000000000000000000000000000
+
+      ..
+44444400
+00000000
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000027452300000127B0B0B1000000000000000000000000000
+
+      ..
+44444400
+00000000
+
+.y................CFZ ..........................CFZ ............................
+0A00F5000000000000CCE400000000020400000703000000CCE40000000000000000000000000000
+0800F60000000000003690010200000C040100000801000136900000000000000000000000000000
+
+..................................guest   ..127.0.0.1                           
+00000000000000000000000000000000008A8AA44400FFF4F4F4F444444444444444444444444444
+00000000000000000000000000000000027452300001127B0B0B1000000000000000000000000000
+
+      ..
+44444400
+00000000
+
index dec3e6a51fe49258a13d341015f5917b4cb1f739..47ceb6cb53e82c376c8c8202b2576ed2060c5669 100644 (file)
@@ -6355,13 +6355,13 @@ CIM server listening on HTTPS port {0}."}
         /**
         * @note PGS17805:
         */
-        Common.AuditLogger.ENABLE_AUDIT_LOG:string {"PGS17805: Audit logging is enabled.\n"} 
+        Common.AuditLogger.ENABLE_AUDIT_LOG:string {"PGS17805: Audit logging is enabled."} 
 
         /**
         * @note PGS17806:
         *     
         */
-        Common.AuditLogger.DISABLE_AUDIT_LOG:string {"PGS17806: Audit logging is disabled.\n"} 
+        Common.AuditLogger.DISABLE_AUDIT_LOG:string {"PGS17806: Audit logging is disabled."} 
 
         /**
         * @note PGS17807: