aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-07-09 16:47:38 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-07-09 16:47:38 -0400
commit30b2731bd21741a6370afba330cea31c75da3bdb (patch)
tree3716d5042d416c09cbb79d21a20983e705f2198a /src/test/perl/PostgresNode.pm
parentc57562725d219c4249b82f4a4fb5aaeee3ae0d53 (diff)
downloadpostgresql-30b2731bd21741a6370afba330cea31c75da3bdb.tar.gz
postgresql-30b2731bd21741a6370afba330cea31c75da3bdb.zip
Fix TAP tests and MSVC scripts for pathnames with spaces.
Change assorted places in our Perl code that did things like system("prog $path/file"); to do it more like system('prog', "$path/file"); which is safe against spaces and other special characters in the path variable. The latter was already the prevailing style, but a few bits of code hadn't gotten this memo. Back-patch to 9.4 as relevant. Michael Paquier, Kyotaro Horiguchi Discussion: <20160704.160213.111134711.horiguchi.kyotaro@lab.ntt.co.jp>
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 636dfec5c06..57679195b42 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -475,7 +475,8 @@ sub backup
my $name = $self->name;
print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
- TestLib::system_or_bail("pg_basebackup -D $backup_path -p $port -x");
+ TestLib::system_or_bail('pg_basebackup', '-D', $backup_path,
+ '-p', $port, '-x');
print "# Backup finished\n";
}
@@ -763,7 +764,7 @@ sub enable_restoring
my $copy_command =
$TestLib::windows_os
? qq{copy "$path\\\\%f" "%p"}
- : qq{cp $path/%f %p};
+ : qq{cp "$path/%f" "%p"};
$self->append_conf(
'recovery.conf', qq(
@@ -791,7 +792,7 @@ sub enable_archiving
my $copy_command =
$TestLib::windows_os
? qq{copy "%p" "$path\\\\%f"}
- : qq{cp %p $path/%f};
+ : qq{cp "%p" "$path/%f"};
# Enable archive_mode and archive_command on node
$self->append_conf(