Skip to content

Instantly share code, notes, and snippets.

@xdg

xdg/stdout Secret

Created December 9, 2015 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdg/cccc68c668dcaad71b0a to your computer and use it in GitHub Desktop.
Save xdg/cccc68c668dcaad71b0a to your computer and use it in GitHub Desktop.
diff --git a/dist/PathTools/t/taint.t b/dist/PathTools/t/taint.t
index 309b3e5..a86ce8d 100644
--- a/dist/PathTools/t/taint.t
+++ b/dist/PathTools/t/taint.t
@@ -1,5 +1,5 @@
#!./perl -Tw
-# Testing Cwd under taint mode.
+# Testing Cwd and File::Spec under taint mode.
use strict;
@@ -34,3 +34,9 @@ foreach my $func (@Functions) {
# Previous versions of Cwd tainted $^O
is !tainted($^O), 1, "\$^O should not be tainted";
+
+{
+ my $cwd = Cwd::getcwd();
+ ok( tainted($cwd), "getcwd is tainted" );
+ ok( tainted(File::Spec->canonpath($cwd)), "canonpath(getcwd) is tainted" );
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment