Acme-TaintTest
view release on metacpan or search on metacpan
LICENSE
MANIFEST
Makefile.PL
README.md
lib/Acme/TaintTest.pm
log/dummy
t/a1.t
t/a2.t
t/README
t/testrules.yml
t/log/dummy
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
# test with arbitrary tainted string of absolute path of a real directory
use File::Spec;
use File::Temp qw(tempdir);
use Test::More tests => 1;
my $pathdir = $ENV{HOME}; # make variable tainted and set to an existing absolute directory
(-d $pathdir) and File::Spec->file_name_is_absolute($pathdir);
my $workdir = tempdir("temp.XXXXXX", DIR => "log");
ok((-d $workdir), 'tempdir test');
die "MonkeyPatch tempdir failed" unless $mock;
my $mock2 = Mock::MonkeyPatch->patch('File::Spec::Unix::canonpath' => \&_patched_pp_canonpath);
die "MonkeyPatch canonpath failed" unless $mock2;
use Test::More tests => 1;
my $pathdir = $ENV{HOME}; # make variable tainted and set to an existing absolute directory
(-d $pathdir) and File::Spec->file_name_is_absolute($pathdir);
my $workdir = File::Temp::tempdir("temp.XXXXXX", DIR => "log");
ok((-d $workdir), 'tempdir test');
( run in 0.850 second using v1.01-cache-2.11-cpan-49f99fa48dc )