From 7fbd5ed735dc6dd52412cb54c566f05feff4cf70 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 6 Sep 2021 13:32:17 +0200 Subject: [PATCH] Do not search the agent name in tagente.direccion. Ref. pandora_enterprise#7952. --- pandora_server/lib/PandoraFMS/DB.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 1f53cb228b..b6e5264dfe 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -273,9 +273,9 @@ sub get_agent_id ($$) { my $rc; if($is_meta == 1) { - $rc = get_db_value ($dbh, "SELECT id_agente FROM tmetaconsole_agent WHERE nombre = ? OR direccion = ?", safe_input($agent_name), $agent_name); + $rc = get_db_value ($dbh, "SELECT id_agente FROM tmetaconsole_agent WHERE nombre = ?", safe_input($agent_name)); } else { - $rc = get_db_value ($dbh, "SELECT id_agente FROM tagente WHERE nombre = ? OR direccion = ?", safe_input($agent_name), $agent_name); + $rc = get_db_value ($dbh, "SELECT id_agente FROM tagente WHERE nombre = ?", safe_input($agent_name)); } return defined ($rc) ? $rc : -1;