Create a gist now

Instantly share code, notes, and snippets.

@xdg /stdout Secret
Created Dec 9, 2015

Embed
What would you like to do?
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