CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 28 Jul 2025 15:49:44 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20230131195432
location: https://web.archive.org/web/20230131195432/https://perl5.git.perl.org/perl5.git/commitdiff
server-timing: captures_list;dur=0.504849, exclusion.robots;dur=0.015760, exclusion.robots.policy;dur=0.007430, esindex;dur=0.010295, cdx.remote;dur=388.376335, LoadShardBlock;dur=224.146530, PetaboxLoader3.datanode;dur=142.925370
x-app-server: wwwb-app203
x-ts: 302
x-tr: 638
server-timing: TR;dur=0,Tw;dur=1238,Tc;dur=0
set-cookie: SERVER=wwwb-app203; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 28 Jul 2025 15:49:46 GMT
content-type: application/xhtml+xml; charset=utf-8
x-archive-orig-date: Tue, 31 Jan 2023 19:54:32 GMT
x-archive-orig-server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips
x-archive-orig-keep-alive: timeout=5, max=100
x-archive-orig-connection: Keep-Alive
x-archive-orig-x-crawler-transfer-encoding: chunked
x-archive-orig-content-length: 21979
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 31 Jan 2023 19:54:32 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 25 Jan 2021 07:38:48 GMT", ; rel="prev memento"; datetime="Wed, 26 Jan 2022 20:35:04 GMT", ; rel="memento"; datetime="Tue, 31 Jan 2023 19:54:32 GMT", ; rel="last memento"; datetime="Tue, 31 Jan 2023 19:54:32 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: CC-MAIN-2023-06-1674764499890.39-0030/CC-MAIN-20230131190543-20230131220543-00615.warc.gz
server-timing: captures_list;dur=1.378024, exclusion.robots;dur=0.051029, exclusion.robots.policy;dur=0.025420, esindex;dur=0.025708, cdx.remote;dur=86.590037, LoadShardBlock;dur=96.920861, PetaboxLoader3.datanode;dur=91.823151, load_resource;dur=192.928882, PetaboxLoader3.resolve;dur=115.835125
x-app-server: wwwb-app203
x-ts: 200
x-tr: 469
server-timing: TR;dur=0,Tw;dur=1116,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
perl5.git.perl.org Git - perl5.git/commitdiff
This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e9f20e0)
raw | patch | inline | side by side (parent: e9f20e0)
author | Yves Orton <demerphq@gmail.com> | |
Mon, 30 Jan 2023 01:55:45 +0000 (02:55 +0100) | ||
committer | Yves Orton <demerphq@gmail.com> | |
Tue, 31 Jan 2023 00:42:26 +0000 (08:42 +0800) |
Fixes #20734 - in a previous patch I missed the early cleanup call
and the fact that it could result in a race condition. This hopefully
resolves the problem.
These tests files are pretty crufty. It would be nice to see them split
apart so that the "sanity" checks which expect to be run in t/ are
executed in a separate test files from the checks which build a tree to
traverse for testing. A perfect task for a new contributor.
and the fact that it could result in a race condition. This hopefully
resolves the problem.
These tests files are pretty crufty. It would be nice to see them split
apart so that the "sanity" checks which expect to be run in t/ are
executed in a separate test files from the checks which build a tree to
traverse for testing. A perfect task for a new contributor.
ext/File-Find/t/find.t | patch | blob | blame | history | |
ext/File-Find/t/taint.t | patch | blob | blame | history |
diff --git a/ext/File-Find/t/find.t b/ext/File-Find/t/find.t
--- a/ext/File-Find/t/find.t
+++ b/ext/File-Find/t/find.t
# };
# }
-cleanup();
-
##### Sanity checks #####
# Do find() and finddepth() work correctly with an empty list of
# directories?
my $FastFileTests_OK = 0;
+my $test_root_dir = cwd();
+my $test_temp_dir = tempdir("FF_find_t_XXXXXX",CLEANUP=>1);
+chdir($test_temp_dir) or die "Failed to chdir to '$test_temp_dir': $!";
+
sub cleanup {
- chdir($orig_dir);
+ # doing this in two steps avoids the need to know about
+ # directory separators, which is helpful as we override
+ # the File::Spec heirarchy, so we can't ask it to help us here.
+ chdir($test_root_dir) or die "Failed to chdir to '$test_root_dir': $!";
+ chdir($test_temp_dir) or die "Failed to chdir to '$test_temp_dir': $!";
my $need_updir = 0;
if (-d dir_path('for_find')) {
$need_updir = 1 if chdir(dir_path('for_find'));
if (-d dir_path('for_find')) {
rmdir dir_path('for_find') or print "# Can't rmdir for_find: $!\n";
}
+ chdir($test_root_dir) or die "Failed to chdir to '$test_root_dir': $!";
}
END {
*file_path_name = \&file_path;
##### Create directories, files and symlinks used in testing #####
-my $root_dir = cwd();
-my $test_dir = tempdir("FF_find_t_XXXXXX",CLEANUP=>1);
-chdir $test_dir;
-
mkdir_ok( dir_path('for_find'), 0770 );
ok( chdir( dir_path('for_find')), "Able to chdir to 'for_find'")
or die("Unable to chdir to 'for_find'");
like($@, qr/invalid top directory/,
"find() correctly died due to undefined top directory");
}
-chdir $root_dir; # let File::Temp cleanup - Switch to `defer {}` one day
done_testing();
--- a/ext/File-Find/t/taint.t
+++ b/ext/File-Find/t/taint.t
my $symlink_exists = eval { symlink("",""); 1 };
-my $orig_dir = cwd();
-( my $orig_dir_untainted ) = $orig_dir =~ m|^(.+)$|; # untaint it
-
-cleanup();
-
my $found;
find({wanted => sub { ++$found if $_ eq 'taint.t' },
untaint => 1, untaint_pattern => qr|^(.+)$|}, File::Spec->curdir);
my $case = 2;
my $FastFileTests_OK = 0;
+my $test_root_dir; # where we are when this test starts
+my $test_root_dir_tainted = cwd();
+if ($test_root_dir_tainted =~ /^(.*)$/) {
+ $test_root_dir = $1;
+} else {
+ die "Failed to untaint root dir of test";
+}
+my $test_temp_dir = tempdir("FF_taint_t_XXXXXX",CLEANUP=>1);
+chdir($test_temp_dir) or die "Failed to chdir to '$test_temp_dir': $!";
+
sub cleanup {
- chdir($orig_dir_untainted);
+ # doing this in two steps avoids the need to know about
+ # directory separators, which is helpful as we override
+ # the File::Spec heirarchy, so we can't ask it to help us here.
+ chdir($test_root_dir) or die "Failed to chdir to '$test_root_dir': $!";
+ chdir($test_temp_dir) or die "Failed to chdir to '$test_temp_dir': $!";
my $need_updir = 0;
if (-d dir_path('for_find_taint')) {
$need_updir = 1 if chdir(dir_path('for_find_taint'));
if (-d dir_path('for_find_taint')) {
rmdir dir_path('for_find_taint') or print "# Can't rmdir for_find_taint: $!\n";
}
+ chdir($test_root_dir) or die "Failed to chdir to '$test_root_dir': $!";
}
END {
*file_path_name = \&file_path;
##### Create directories, files and symlinks used in testing #####
-my $root_dir_tainted = cwd();
-my $root_dir;
-if ($root_dir_tainted=~/^(.*)$/) {
- $root_dir = $1;
-} else {
- die "Failed to untaint root dir of test";
-}
-my $test_dir = tempdir("FF_taint_t_XXXXXX",CLEANUP=>1);
-chdir $test_dir;
-
mkdir_ok( dir_path('for_find_taint'), 0770 );
ok( chdir( dir_path('for_find_taint')), 'successful chdir() to for_find_taint' );
chdir($cwd_untainted);
}
-chdir $root_dir; # let File::Temp cleanup - Switch to `defer {}` one day