From 600e3a464823b3f460a80723a8ea3525fe841285 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Nov 2019 11:13:47 +0000 Subject: tests: rely on PublicInbox::Git for pathname safety It's possible (but unlikely) a user will put spaces in TMPDIR and cause File::Temp::tempdir() to return a temporary directory with spaces in the filename, making it unsafe for shell expansion. PublicInbox::Git didn't exist when t/mda.t was written, and I just forgot about PublicInbox::Git->qx for t/plack.t :x --- t/plack.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/plack.t') diff --git a/t/plack.t b/t/plack.t index 7e65ad74..9308813f 100644 --- a/t/plack.t +++ b/t/plack.t @@ -54,9 +54,9 @@ EOF my $im = PublicInbox::Import->new($git, 'test', $addr); $im->add($mime); $im->done; - my $rev = `git --git-dir="$maindir" rev-list HEAD`; + my $rev = $git->qx(qw(rev-list HEAD)); like($rev, qr/\A[a-f0-9]{40}/, "good revision committed"); - @ls = `git --git-dir="$maindir" ls-tree -r --name-only HEAD`; + @ls = $git->qx(qw(ls-tree -r --name-only HEAD)); chomp @ls; } my $app = eval { -- cgit v1.2.3-24-ge0c7