In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9b86bb5cacfb65a283299b005919058f8a61701a?hp=e07ce2e4e82e3054dc912dbe99348744647bf30b>
- Log ----------------------------------------------------------------- commit 9b86bb5cacfb65a283299b005919058f8a61701a Author: Todd Rinaldo <[email protected]> Date: Sat Jul 3 15:32:08 2010 +0200 Fix RT #74472 Exporter.pm blocks Signal handling Exporter.pm overrides SIG{__WARN__}. This means It's not possible to write a test to trap warning events for this error. Since all the line seems to do is make the warning more verbose, I suggest it not be done if someone has defined a custom signal. At the moment Test::NoWarnings cannot trap these warnings because of this. M lib/Exporter.pm commit cae9400fee55b7e628d974f47e5bbebb4180a9c2 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Thu May 13 20:05:35 2010 +0000 Skip suid File::Copy tests on a nosuid partition These tests were being skipped on OpenBSD, but nosuid partitions can exist on other systems too. Now it just checks if it can create a suid directory, if not the tests are skipped. Perl builds without errors in a nosuid /tmp with this patch. M lib/File/Copy.t ----------------------------------------------------------------------- Summary of changes: lib/Exporter.pm | 2 +- lib/File/Copy.t | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/Exporter.pm b/lib/Exporter.pm index c37f39c..5fcc993 100644 --- a/lib/Exporter.pm +++ b/lib/Exporter.pm @@ -62,7 +62,7 @@ sub import { } return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; local $SIG{__WARN__} = - sub {require Carp; &Carp::carp}; + sub {require Carp; &Carp::carp} if not $SIG{__WARN__}; # shortcut for the common case of no type character *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_; } diff --git a/lib/File/Copy.t b/lib/File/Copy.t index b6e4a19..63c99d1 100644 --- a/lib/File/Copy.t +++ b/lib/File/Copy.t @@ -237,6 +237,14 @@ for my $cross_partition_test (0..1) { } } +my $can_suidp = sub { + my $dir = "suid-$$"; + my $ok = 1; + mkdir $dir or die "Can't mkdir($dir) for suid test"; + $ok = 0 unless chmod 2000, $dir; + rmdir $dir; + return $ok; +}; SKIP: { my @tests = ( @@ -251,9 +259,8 @@ SKIP: { my $skips = @tests * 6 * 8; - # TODO - make this skip fire if we're on a nosuid filesystem rather than guessing by OS - skip "OpenBSD filesystems default to nosuid breaking these tests", $skips - if $^O eq 'openbsd'; + my $can_suid = $can_suidp->(); + skip "Can't suid on this $^O filesystem", $skips unless $can_suid; skip "-- Copy preserves RMS defaults, not POSIX permissions.", $skips if $^O eq 'VMS'; skip "Copy doesn't set file permissions correctly on Win32.", $skips -- Perl5 Master Repository
