From bdb53d0ae3eceaeb140d7efc448708494478c4e6 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 14 Dec 2017 15:48:27 +0100 Subject: [PATCH] Decode HTML entities in the WMI username. Ref pandora_enterprise#1680. --- pandora_server/lib/PandoraFMS/WMIServer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index be422fa2a2..74cb4e6ae8 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -145,10 +145,10 @@ sub data_consumer ($$) { # Build command to execute my $wmi_command = ''; if (defined ($module->{'plugin_pass'}) && $module->{'plugin_pass'} ne "") { - $wmi_command = $pa_config->{'wmi_client'} . ' -U "' . $module->{'plugin_user'} . '"%"' . pandora_output_password($pa_config, $module->{'plugin_pass'}) . '"'; + $wmi_command = $pa_config->{'wmi_client'} . ' -U "' . safe_output($module->{'plugin_user'}) . '"%"' . pandora_output_password($pa_config, $module->{'plugin_pass'}) . '"'; } elsif (defined ($module->{'plugin_user'}) && $module->{'plugin_user'} ne "") { - $wmi_command = $pa_config->{'wmi_client'} . ' -U "' . $module->{'plugin_user'} . '"'; + $wmi_command = $pa_config->{'wmi_client'} . ' -U "' . safe_output($module->{'plugin_user'}) . '"'; } else { $wmi_command = $pa_config->{'wmi_client'} . ' -N';