summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2013-02-14 15:57:35 +0100
committerJan Synacek <jsynacek@redhat.com>2013-02-14 16:00:03 +0100
commitd73b07787994cf76d85e7363c35f6f8e00cab028 (patch)
tree8de93d11d9e093b85e2040516efa2d3f4ee4afd2 /src
parentfb270dd0e7ee4d5e71300b67c4794b63b02a0df4 (diff)
downloadopenlmi-providers-d73b07787994cf76d85e7363c35f6f8e00cab028.tar.gz
openlmi-providers-d73b07787994cf76d85e7363c35f6f8e00cab028.tar.xz
openlmi-providers-d73b07787994cf76d85e7363c35f6f8e00cab028.zip
LogicalFile: additional check for root directory in RootDirectory
Diffstat (limited to 'src')
-rw-r--r--src/logicalfile/LMI_RootDirectoryProvider.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/logicalfile/LMI_RootDirectoryProvider.c b/src/logicalfile/LMI_RootDirectoryProvider.c
index 179d146..0399ab1 100644
--- a/src/logicalfile/LMI_RootDirectoryProvider.c
+++ b/src/logicalfile/LMI_RootDirectoryProvider.c
@@ -59,6 +59,10 @@ static CMPIStatus associators(
const char *ns = KNameSpace(cop);
const char *comp_ccname = get_system_creation_class_name();
+ CMPIData pathd;
+ pathd = CMGetKey(cop, "Name", &st);
+ const char *path = KChars(pathd.value.string);
+
/*
* allow only LMI_UnixDirectory and Linux_ComputerSystem
* XXX
@@ -69,6 +73,11 @@ static CMPIStatus associators(
if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) {
/* got LMI_UnixDirectory */
+ /* ignore this association if the directory is not root */
+ if (strcmp(path, "/")) {
+ CMReturn(CMPI_RC_OK);
+ }
+
CIM_ComputerSystemRef cim_csr;
CIM_ComputerSystemRef_Init(&cim_csr, _cb, ns);
CIM_ComputerSystemRef_Set_Name(&cim_csr, get_system_name());