This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/op/taint.t: handle symlink requiring anything unavailable
authorTony Cook <tony@develop-help.com>
Wed, 28 Oct 2020 02:46:01 +0000 (13:46 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 1 Dec 2020 04:29:33 +0000 (15:29 +1100)
like privileges, or a filesystem without symlink support

t/op/taint.t

index 73246a0..607a305 100644 (file)
@@ -1498,7 +1498,11 @@ violates_taint(sub { link $TAINT, '' }, 'link');
        unlink($symlink);
        my $sl = "/something/naughty";
        # it has to be a real path on Mac OS
-       symlink($sl, $symlink) or die "symlink: $!\n";
+       unless (symlink($sl, $symlink)) {
+            skip "symlink not available or no priviliges", 1,
+                if $^O eq "MSWin32";
+            die "symlink: $!\n";
+        }
        my $readlink = readlink($symlink);
        is_tainted($readlink);
        unlink($symlink);