diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-16 13:36:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-16 13:36:30 +0000 |
commit | 926cbafe59ef28067493b902ada7a0be81a77e57 (patch) | |
tree | d71be45e833b28d28ecec336cd9660780012b978 /ext/Cwd/t | |
parent | fe30b7f462c3fd9dd4006057fb687b35590b7378 (diff) | |
download | perl-926cbafe59ef28067493b902ada7a0be81a77e57.tar.gz |
Stas' tainting worries, obscured by me.
p4raw-id: //depot/perl@15950
Diffstat (limited to 'ext/Cwd/t')
-rw-r--r-- | ext/Cwd/t/cwd.t | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t index 919cfb1527..83b6f7fda2 100644 --- a/ext/Cwd/t/cwd.t +++ b/ext/Cwd/t/cwd.t @@ -1,4 +1,4 @@ -#!./perl +#!./perl -T BEGIN { chdir 't' if -d 't'; @@ -41,7 +41,10 @@ print "# native pwd = '$pwd_cmd'\n"; SKIP: { skip "No native pwd command found to test against", 4 unless $pwd_cmd; - chomp(my $start = `$pwd_cmd`); + local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; + my ($pwd_cmd_untainted) = $pwd_cmd =~ /^(.+)$/; # Untaint. + chomp(my $start = `$pwd_cmd_untainted`); + # Win32's cd returns native C:\ style $start =~ s,\\,/,g if ($^O eq 'MSWin32' || $^O eq "NetWare"); # DCL SHOW DEFAULT has leading spaces |