fusioninventory / fusioninventory-for-glpi

FusionInventory plugin for GLPI
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
362 stars 150 forks source link

Wrong entity ID moving item #2378

Closed trasher closed 6 years ago

trasher commented 6 years ago

Initially reported as a GLPI issue (https://github.com/glpi-project/glpi/issues/3245); but FI should not try to use an entity name as id.

After updating to 9.2.1, I got the sql-error.log flooded with SQL errors

  SQL: SELECT *
                      FROM `glpi_softwares`
                      WHERE `entities_id` = Entité racine > IUT RS
                            AND `name` = 'FusionInventory Agent 2.3.19 (x64 edition)'
                            AND `manufacturers_id` = '2148'
  Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'racine > IUT RS
                            AND `name` = 'FusionInventory Age' at line 3
  Backtrace :
  inc/dbmysqliterator.class.php:274
  inc/dbmysql.class.php:542                          DBmysqlIterator->__construct()
  inc/transfer.class.php:1435                        DBmysql->request()
  inc/transfer.class.php:1473                        Transfer->copySingleSoftware()
  inc/transfer.class.php:1538                        Transfer->copySingleVersion()
  inc/transfer.class.php:1150                        Transfer->transferComputerSoftwares()
  inc/transfer.class.php:199                         Transfer->transferItem()
  ...ry/inc/inventorycomputerinventory.class.php:504 Transfer->moveItems()
  ...inventory/inc/inventoryruleimport.class.php:790 PluginFusioninventoryInventoryComputerInventory->rulepassed()
  inc/rule.class.php:1436                            PluginFusioninventoryInventoryRuleImport->executeActions()
  inc/rulecollection.class.php:1461                  Rule->process()
  ...ry/inc/inventorycomputerinventory.class.php:378 RuleCollection->processAllRules()
  ...ry/inc/inventorycomputerinventory.class.php:126 PluginFusioninventoryInventoryComputerInventory->sendCriteria()
  ...fusioninventory/inc/communication.class.php:235 PluginFusioninventoryInventoryComputerInventory->import()
  ...fusioninventory/inc/communication.class.php:463 PluginFusioninventoryCommunication->import()
  plugins/fusioninventory/front/communication.php:93 PluginFusioninventoryCommunication->handleOCSCommunication()
  plugins/fusioninventory/index.php:59               include_once()

This is about entities_id value not being quoted.

moobyfr commented 6 years ago

This bug can be closed, FI uses id correctly, (I'm the initial reporter of the bug in GLPI)