diff options
Diffstat (limited to 'gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm')
-rw-r--r-- | gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm b/gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm index 3ef0f339db3..85327ee0da3 100644 --- a/gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm +++ b/gnu/usr.bin/perl/dist/PathTools/lib/File/Spec.pm @@ -1,16 +1,14 @@ package File::Spec; use strict; -use vars qw(@ISA $VERSION); -$VERSION = '3.63_01'; +our $VERSION = '3.74'; $VERSION =~ tr/_//d; -my %module = (MacOS => 'Mac', +my %module = ( MSWin32 => 'Win32', os2 => 'OS2', VMS => 'VMS', - epoc => 'Epoc', NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare. symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian. dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP. @@ -21,7 +19,7 @@ my %module = (MacOS => 'Mac', my $module = $module{$^O} || 'Unix'; require "File/Spec/$module.pm"; -@ISA = ("File::Spec::$module"); +our @ISA = ("File::Spec::$module"); 1; @@ -158,10 +156,13 @@ Returns a string representation of the parent directory. =item no_upwards -Given a list of file names, strip out those that refer to a parent -directory. (Does not strip symlinks, only '.', '..', and equivalents.) +Given a list of files in a directory (such as from C<readdir()>), +strip out C<'.'> and C<'..'>. - @paths = File::Spec->no_upwards( @paths ); +B<SECURITY NOTE:> This does NOT filter paths containing C<'..'>, like +C<'../../../../etc/passwd'>, only literal matches to C<'.'> and C<'..'>. + + @paths = File::Spec->no_upwards( readdir $dirhandle ); =item case_tolerant |