Merge branch 'ent-10455-15091-plugin-wizard_wmi_module-rompe-la-ejecucion-cuando-la-contrasena-tiene-un' into 'develop'

fixed bug with passwords with rare characters

See merge request artica/pandorafms!5545
This commit is contained in:
Diego Muñoz-Reja 2023-04-03 15:53:36 +00:00
commit 4435a64727
1 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ foreach my $op (@operation){
my $wmi_query = 'SELECT ' . $config->{'fieldsList'} . ' FROM ' . $config->{'wmiClass'} . ($config->{'queryFilter'} ? ' WHERE ' . $config->{'queryFilter'} : ''); my $wmi_query = 'SELECT ' . $config->{'fieldsList'} . ' FROM ' . $config->{'wmiClass'} . ($config->{'queryFilter'} ? ' WHERE ' . $config->{'queryFilter'} : '');
# Build wmic command # 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 # Run wmic and parse output
my $output = `$wmi_command 2>/dev/null`; my $output = `$wmi_command 2>/dev/null`;
@ -173,4 +173,4 @@ foreach my $k (keys %{$fields_values}){
my $result = eval $operation; my $result = eval $operation;
if (defined($result)){ if (defined($result)){
print $result . "\n"; print $result . "\n";
} }