summaryrefslogtreecommitdiffstats
path: root/src/logicalfile/LMI_RootDirectoryProvider.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logicalfile/LMI_RootDirectoryProvider.c')
-rw-r--r--src/logicalfile/LMI_RootDirectoryProvider.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/logicalfile/LMI_RootDirectoryProvider.c b/src/logicalfile/LMI_RootDirectoryProvider.c
index 6ced12b..dc6cd6b 100644
--- a/src/logicalfile/LMI_RootDirectoryProvider.c
+++ b/src/logicalfile/LMI_RootDirectoryProvider.c
@@ -62,6 +62,10 @@ static CMPIStatus associators(
CMPIData pathd;
pathd = CMGetKey(cop, "Name", &st);
const char *path = KChars(pathd.value.string);
+ char *fsname;
+ if (get_fsname_from_path("/", &fsname) < 0) {
+ CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name");
+ }
/*
* allow only LMI_UnixDirectory and Linux_ComputerSystem
@@ -94,7 +98,7 @@ static CMPIStatus associators(
/* got Linux_ComputerSystem */
LMI_UnixDirectory lmi_ud;
LMI_UnixDirectory_Init(&lmi_ud, _cb, ns);
- fill_logicalfile(LMI_UnixDirectory, &lmi_ud, "/", LMI_UnixDirectory_ClassName);
+ fill_logicalfile(LMI_UnixDirectory, &lmi_ud, "/", fsname, LMI_UnixDirectory_ClassName);
o = LMI_UnixDirectory_ToObjectPath(&lmi_ud, &st);
if (names) {
CMReturnObjectPath(cr, o);
@@ -103,7 +107,7 @@ static CMPIStatus associators(
CMReturnInstance(cr, ci);
}
}
-
+ free(fsname);
CMReturn(CMPI_RC_OK);
}
@@ -130,6 +134,10 @@ static CMPIStatus references(
cd = CMGetKey(cop, "CreationClassName", &st);
const char *path = KChars(pathd.value.string);
const char *ccname = KChars(cd.value.string);
+ char *fsname;
+ if (get_fsname_from_path("/", &fsname) < 0) {
+ CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name");
+ }
/*
* allow only LMI_UnixDirectory and Linux_ComputerSystem
@@ -166,7 +174,7 @@ static CMPIStatus references(
LMI_UnixDirectory lmi_ud;
LMI_UnixDirectory_Init(&lmi_ud, _cb, ns);
- fill_logicalfile(LMI_UnixDirectory, &lmi_ud, "/", LMI_UnixDirectory_ClassName);
+ fill_logicalfile(LMI_UnixDirectory, &lmi_ud, "/", fsname, LMI_UnixDirectory_ClassName);
o = LMI_UnixDirectory_ToObjectPath(&lmi_ud, &st);
LMI_RootDirectory_SetObjectPath_PartComponent(&lmi_rd, o);
}
@@ -178,6 +186,7 @@ static CMPIStatus references(
ci = LMI_RootDirectory_ToInstance(&lmi_rd, &st);
CMReturnInstance(cr, ci);
}
+ free(fsname);
CMReturn(CMPI_RC_OK);
}