version 1.25.24.1, 2007/03/23 21:53:52
|
version 1.25.24.2, 2007/03/30 00:35:02
|
|
|
#include "cimmofClient.h" | #include "cimmofClient.h" |
#include <Pegasus/Common/CIMClass.h> | #include <Pegasus/Common/CIMClass.h> |
#include <Pegasus/Common/CIMQualifierDecl.h> | #include <Pegasus/Common/CIMQualifierDecl.h> |
#include <Pegasus/Common/FileSystem.h> |
|
#include <Pegasus/Common/CIMInstance.h> | #include <Pegasus/Common/CIMInstance.h> |
#include <Pegasus/Common/Pair.h> |
|
#include <Pegasus/Config/ConfigManager.h> |
|
|
|
#if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) |
|
# include "Policy.h" |
|
#endif |
|
| |
PEGASUS_USING_PEGASUS; | PEGASUS_USING_PEGASUS; |
PEGASUS_USING_STD; |
|
| |
static const char __NAMESPACE_NAMESPACE [] = "root"; | static const char __NAMESPACE_NAMESPACE [] = "root"; |
static const char NAMESPACE_CLASS [] = "__NameSpace"; | static const char NAMESPACE_CLASS [] = "__NameSpace"; |
|
|
} | } |
| |
void | void |
cimmofClient::addInstance( |
cimmofClient::addInstance(const CIMNamespaceName &nameSpace, |
const CIMNamespaceName &nameSpace, |
|
CIMInstance &instance) const | CIMInstance &instance) const |
{ | { |
// Check that MOF files encountered so far are in trusted directories. |
|
|
|
#if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) |
|
|
|
CheckTrustedDirs(); |
|
|
|
#endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ |
|
|
|
// Create the instance. |
|
|
|
_client->createInstance(nameSpace, instance); | _client->createInstance(nameSpace, instance); |
|
|
// If the class name is "PG_ProviderModule", then the policy file must |
|
// be updated before asking the CIM server to create the instance. |
|
|
|
#if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) |
|
|
|
String className = instance.getClassName().getString(); |
|
|
|
|
|
if (String::equalNoCase(className, "PG_ProviderModule")) |
|
{ |
|
try |
|
{ |
|
UpdatePolicyFile(instance); |
|
} |
|
catch (Exception& e) |
|
{ |
|
cerr << e.getMessage() << endl; |
|
exit(1); |
|
} |
|
} |
|
|
|
#endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ |
|
} | } |
| |
CIMQualifierDecl | CIMQualifierDecl |