summaryrefslogtreecommitdiff
path: root/lib/Cwd.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-06-03 19:15:26 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-06-03 19:15:26 +0000
commit680d0beb650bdbbd6136e2939d2d4288dac7df6c (patch)
tree5d9f5931b6029d382354944ce425159c0c5f96e2 /lib/Cwd.pm
parenta6d5524ecde20b5db1ce867a5f7d6515a107b933 (diff)
downloadperl-680d0beb650bdbbd6136e2939d2d4288dac7df6c.tar.gz
Protect against localizing an %ENV slice.
p4raw-id: //depot/perl@16982
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r--lib/Cwd.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 8b00543e1e..24ad1e2969 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -196,7 +196,11 @@ $pwd_cmd ||= 'pwd';
# The 'natural and safe form' for UNIX (pwd may be setuid root)
sub _backtick_pwd {
- local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
+ local $ENV{PATH};
+ local $ENV{IFS};
+ local $ENV{CDPATH};
+ local $ENV{ENV};
+ local $ENV{BASH_ENV};
my $cwd = `$pwd_cmd`;
# Belt-and-suspenders in case someone said "undef $/".
local $/ = "\n";