diff --git a/gorgone/gorgone/modules/centreon/mbi/libs/Utils.pm b/gorgone/gorgone/modules/centreon/mbi/libs/Utils.pm index ef2a404d3dc..7a313819a60 100644 --- a/gorgone/gorgone/modules/centreon/mbi/libs/Utils.pm +++ b/gorgone/gorgone/modules/centreon/mbi/libs/Utils.pm @@ -66,14 +66,15 @@ sub checkBasicOptions { sub buildCliMysqlArgs { my ($self, $con) = @_; - - my $args = '-u "' . $con->{user} . '" ' . - '-p"' . $con->{password} . '" ' . - '-h "' . $con->{host} . '" ' . - '-P ' . $con->{port}; + my $password = $con->{password}; + # as we will use a bash command we need to use single quote to protect against every characters, and escape single quote) + $password =~ s/'/'"'"'/; + my $args = "-u'" . $con->{user} . "' " . + "-p'" . $password . "' " . + "-h '" . $con->{host} . "' " . + "-P " . $con->{port}; return $args; } - sub getYesterdayTodayDate { my ($self) = @_;