From 1684ff9f98a5bb68d1fb38c1d1a7c39ed676d989 Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 16 Feb 2023 17:32:55 +0100 Subject: [PATCH] fixed bug with passwords with rare characters --- pandora_server/util/plugin/wizard_wmi_module.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/plugin/wizard_wmi_module.pl b/pandora_server/util/plugin/wizard_wmi_module.pl index 3cb1661da9..7d999fd024 100755 --- a/pandora_server/util/plugin/wizard_wmi_module.pl +++ b/pandora_server/util/plugin/wizard_wmi_module.pl @@ -123,7 +123,7 @@ foreach my $op (@operation){ my $wmi_query = 'SELECT ' . $config->{'fieldsList'} . ' FROM ' . $config->{'wmiClass'} . ($config->{'queryFilter'} ? ' WHERE ' . $config->{'queryFilter'} : ''); # Build wmic command -my $wmi_command = $config->{'wmicPath'} . ' -U ' . $config->{'user'} . '%' . $config->{'pass'} . ($config->{'namespace'} ? ' --namespace="' . $config->{'namespace'} . '"' : '') . ' //' . $config->{'host'} . ' "' . $wmi_query . '"'; +my $wmi_command = $config->{'wmicPath'} . ' -U ' . "'" . $config->{'user'} . '%' . $config->{'pass'} . "'" . ($config->{'namespace'} ? ' --namespace="' . $config->{'namespace'} . '"' : '') . ' //' . $config->{'host'} . ' "' . $wmi_query . '"'; # Run wmic and parse output my $output = `$wmi_command 2>/dev/null`; @@ -173,4 +173,4 @@ foreach my $k (keys %{$fields_values}){ my $result = eval $operation; if (defined($result)){ print $result . "\n"; -} \ No newline at end of file +}