WindowsAgent
WindowsAgent copied to clipboard
old_deviceid inside xml download history
General information
Operating system : Windows any
OCS Inventory information
Windows agent version : all 2.x versions
Problem's description
There is a bug that xml element OLD_DEVICEID
goes inside DOWNLOAD/HISTORY
.
Looking at source code looks like it affect all windows agent versions including 2.0 up to 2.6.
Example of generated windows agent xml:
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
<DEVICEID>ECELEPARXXXXX-2020-02-28-08-21-35</DEVICEID>
<CONTENT>
<DOWNLOAD>
<HISTORY>
<PACKAGE ID="1576260409" />
<PACKAGE ID="1582803334" />
<OLD_DEVICEID>ECELEPARXXXXX-2020-02-28-08-19-54</OLD_DEVICEID>
</HISTORY>
</DOWNLOAD>
[...]
Possible solution
The problem seems at file OCSInventory Front/InventoryRequest.cpp
:
BOOL CInventoryRequest::initInventory()
{
[...]
if (!loadDownloadHistory()) [...]
if( m_pDeviceid->getOldDeviceID() != _T("") )
m_cmXml.AddChildElem( _T("OLD_DEVICEID"),m_pDeviceid->getOldDeviceID());
[...]
}
BOOL CInventoryRequest::loadDownloadHistory()
{
[...]
m_cmXml.AddElem( _T("DOWNLOAD"));
m_cmXml.AddElem( _T("HISTORY"));
if( historyOpened )
{
[...]
}
else
{
return FALSE;
}
return TRUE;
}
Where AddElem(DOWNLOAD)
and AddElem(HISTORY)
doesn't have it's matching OutOfElem()
.
probaly related #156
Hi,
I am closing this issue as the issue is resolved.
Regards, Charlene