Skip to content

Commit

Permalink
Prevent special characters in passwords and other args to mess up the… (
Browse files Browse the repository at this point in the history
#3190)

* Prevent special characters in passwords and other args to mess up the command

This should fix #3189

* Might as well quote the pgsql driver command

Adresses issue #3189

* Debug should be false by default, fixing issue #3179
  • Loading branch information
nvaken authored and jmolivas committed Feb 23, 2017
1 parent dd620a8 commit 86df4f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Bootstrap/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct($autoload, $root, $appRoot)
$this->appRoot = $appRoot;
}

public function boot($debug)
public function boot($debug = FALSE)
{
$output = new ConsoleOutput();
$input = new ArrayInput([]);
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Database/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

if ($databaseConnection['driver'] == 'mysql') {
$command = sprintf(
'mysqldump --user=%s --password=%s --host=%s --port=%s %s > %s',
'mysqldump --user="%s" --password="%s" --host="%s" --port="%s" "%s" > "%s"',
$databaseConnection['username'],
$databaseConnection['password'],
$databaseConnection['host'],
Expand All @@ -111,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
} elseif ($databaseConnection['driver'] == 'pgsql') {
$command = sprintf(
'PGPASSWORD="%s" pg_dumpall -w -U %s -h %s -p %s -l %s -f %s',
'PGPASSWORD="%s" pg_dumpall -w -U "%s" -h "%s" -p "%s" -l "%s" -f "%s"',
$databaseConnection['password'],
$databaseConnection['username'],
$databaseConnection['host'],
Expand Down

0 comments on commit 86df4f8

Please sign in to comment.