WindowsAgent icon indicating copy to clipboard operation
WindowsAgent copied to clipboard

old_deviceid inside xml download history

Open alacn1 opened this issue 4 years ago • 1 comments

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().

alacn1 avatar Feb 28 '20 11:02 alacn1

probaly related #156

alacn1 avatar Feb 28 '20 12:02 alacn1

Hi,

I am closing this issue as the issue is resolved.

Regards, Charlene

charleneauger avatar Dec 22 '22 13:12 charleneauger