From 3fabf795a567244a54008e4c72bdfcec4dc87f18 Mon Sep 17 00:00:00 2001 From: Calvo Date: Tue, 25 Apr 2023 09:52:22 +0200 Subject: [PATCH] Changed xml agent filename to hash to avoid special chars problems --- pandora_agents/pc/pandora_agent | 2 +- pandora_agents/unix/pandora_agent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index c5437d2225..94a51f199e 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -2018,7 +2018,7 @@ sub pandora_agent_run () { $Xml = $xml_header . $Xml . ""; # Save XML data file - my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data'; + my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data'; if (-l $temp_file && !unlink($temp_file)) { error ("File '$temp_file' already exists as a symlink and could not be removed: $!"); return 1; diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 27c9d286d2..d8273a5ec0 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -4377,7 +4377,7 @@ while (1) { $Xml = $xml_header . $Xml . ""; # Save XML data file - my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data'; + my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data'; error ("File '$temp_file' already exists as a symlink and could not be removed: $!") if (-l $temp_file && !unlink($temp_file)); open (TEMP_FILE, "> $temp_file") || error ("Could not write XML data file: $!"); print TEMP_FILE $Xml;