summaryrefslogtreecommitdiffstats
path: root/src/logicalfile/file.c
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2013-11-11 14:59:31 +0100
committerJan Safranek <jsafrane@redhat.com>2013-11-13 14:35:39 +0100
commita4e4d396c85fa897010c49e400e2992d9866c62a (patch)
tree68a0b0984f8d6c0a228e0d2c13a0563da67482ca /src/logicalfile/file.c
parentdb95a46cedf3a5e6909f15b4bc4b33791139693f (diff)
downloadopenlmi-providers-a4e4d396c85fa897010c49e400e2992d9866c62a.tar.gz
openlmi-providers-a4e4d396c85fa897010c49e400e2992d9866c62a.tar.xz
openlmi-providers-a4e4d396c85fa897010c49e400e2992d9866c62a.zip
logicalfile: fixed key checking in associations.
Don't assume that the Associators() or References() get correct object 'cop' argument - the object might be totally unrelated to the association. E.g. SFCB calls Associators() on LMI_DirectoryContainsFile associations with CIM_ComputerSystem as 'cop' parameter, while the association is between a directory and a file in it and does not associate ComputerSystem in any way.
Diffstat (limited to 'src/logicalfile/file.c')
-rw-r--r--src/logicalfile/file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/logicalfile/file.c b/src/logicalfile/file.c
index 7796189..b7469a5 100644
--- a/src/logicalfile/file.c
+++ b/src/logicalfile/file.c
@@ -30,8 +30,12 @@ CMPIStatus lmi_check_required(
{
const char *prop;
+ CMPIStatus st;
+ CMPIData data;
/* check computer system creation class name */
- if (CMIsNullValue(CMGetKey(o, "CSCreationClassName", NULL))) {
+ data = CMGetKey(o, "CSCreationClassName", &st);
+ check_status(st);
+ if (CMIsNullValue(data)) {
CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "CSCreationClassName is empty");
}
prop = get_string_property_from_op(o, "CSCreationClassName");
@@ -40,7 +44,9 @@ CMPIStatus lmi_check_required(
}
/* check fqdn */
- if (CMIsNullValue(CMGetKey(o, "CSName", NULL))) {
+ data = CMGetKey(o, "CSName", &st);
+ check_status(st);
+ if (CMIsNullValue(data)) {
CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "CSName is empty");
}
prop = get_string_property_from_op(o, "CSName");