[perl #8262] //g loops infinitely on tainted data
[p5sagit/p5-mst-13.2.git] / t / io / fs.t
index 58204dd..63b5efe 100755 (executable)
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -49,7 +49,7 @@ $needs_fh_reopen = 1 if (defined &Win32::IsWin95 && Win32::IsWin95());
 my $skip_mode_checks =
     $^O eq 'cygwin' && $ENV{CYGWIN} !~ /ntsec/;
 
-plan tests => 49;
+plan tests => 51;
 
 
 if (($^O eq 'MSWin32') || ($^O eq 'NetWare')) {
@@ -173,10 +173,16 @@ SKIP: {
     ok(open(my $fh, "<", "a"), "open a");
     is(chmod(0, $fh), 1, "fchmod");
     $mode = (stat "a")[2];
-    is($mode & 0777, 0, "perm reset");
+    SKIP: {
+        skip "no mode checks", 1 if $skip_mode_checks;
+        is($mode & 0777, 0, "perm reset");
+    }
     is(chmod($newmode, "a"), 1, "fchmod");
     $mode = (stat $fh)[2];
-    is($mode & 0777, $newmode, "perm restored");
+    SKIP: { 
+        skip "no mode checks", 1 if $skip_mode_checks;
+        is($mode & 0777, $newmode, "perm restored");
+    }
 }
 
 SKIP: {
@@ -433,5 +439,16 @@ else {
 
 ok(-d 'tmp1', "rename on directories working");
 
+{
+    # Change 26011: Re: A surprising segfault
+    # to make sure only that these obfuscated sentences will not crash.
+
+    map chmod(+()), ('')x68;
+    ok(1, "extend sp in pp_chmod");
+
+    map chown(+()), ('')x68;
+    ok(1, "extend sp in pp_chown");
+}
+
 # need to remove 'tmp' if rename() in test 28 failed!
 END { rmdir 'tmp1'; rmdir 'tmp'; 1 while unlink "Iofs.tmp"; }