interop provider gives invalid error while trying to create CIM_IndicationFilter instance with out "SourceNamespace" property.
xml request : (Note the SourceNamespace property is not available).
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="interop"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationFilter">
<PROPERTY NAME="SystemCreationClassName" TYPE="string">
<VALUE>CIM_ComputerSystem</VALUE>
</PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="CreationClassName" TYPE="string">
<VALUE>CIM_IndicationFilter</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>Filter1</VALUE>
</PROPERTY>
<PROPERTY NAME="QueryLanguage" TYPE="string">
<VALUE>WQL</VALUE>
</PROPERTY>
<PROPERTY NAME="Query" TYPE="string">
<VALUE>SELECT * FROM CIM_AlertIndication</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
xml Response :
HTTP/1.1 200 OK
Content-Type: application/xml; charset="utf-8"
Content-Length: 297
Cache-Control: no-cache
CIMOperation: MethodResponse
Connection: close
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="480295" PROTOCOLVERSION="1.0">
<SIMPLERSP>
<IMETHODRESPONSE NAME="CreateInstance">
<ERROR CODE="6" DESCRIPTION="The requested object could not be found"/>
</IMETHODRESPONSE>
</SIMPLERSP>
</MESSAGE>
</CIM>
Suggestion :
In interopProvider.c, while creating instance using "InteropProviderCreateInstance" function. It gets all the properties of CIM_IndicationFilter instance like "querylanguage", "query", and finally "SourceNamespace". It uses "st" to get the status. In our case "SourceNameSpace" is not available and thus st will set with "CMPI_RC_ERR_NOT_FOUND". The function continues and when sns is NULL it sets "root/interop" as the namespace. Finally it adds the filter in the global list. When it tries to add it in the repository st is not set as CMPI_RC_OK and it returnd the error code 6 as response.
Note: When we use the same command to create the instance, it checks in the global list and return "CMPI_RC_ERR_ALREADY_EXIST" with error code 11.
Working patch
Committed patch (minor mods)
I don't find any neccessity in moving the line number 798 to 807. i.e., the line "CMPIString *sns=ciLocal->ft->getProperty(ciLocal,"SourceNamespace",&st).value.string;".
Can you please explain the proper requirement to do that. Is that due to the performance that it may fail before that line?
While that change was not strictly required to make this fix, I felt it was a better structure to have the 2 previous getProperty calls issued, their results checked, then issue this one and check its results. That way anything that gets placed in &st isn't overwritten before the values are checked. Is that change causing any problem?
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 60 days (the time period specified by
the administrator of this Tracker).