Blame SOURCES/PathTools-3.63-CVE-2016-1238-avoid-loading-optional-modules-from.patch

22d2ea
diff -up PathTools/Cwd.pm.cve PathTools/Cwd.pm
22d2ea
--- PathTools/Cwd.pm.cve	2016-03-01 13:33:02.000000000 +0100
22d2ea
+++ PathTools/Cwd.pm	2016-08-02 13:39:39.814316060 +0200
22d2ea
@@ -40,7 +40,10 @@ if ($^O eq 'os2') {
22d2ea
 my $use_vms_feature;
22d2ea
 BEGIN {
22d2ea
     if ($^O eq 'VMS') {
22d2ea
-        if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
22d2ea
+        if (eval { local $SIG{__DIE__};
22d2ea
+                   local @INC = @INC;
22d2ea
+                   pop @INC if $INC[-1] eq '.';
22d2ea
+                   require VMS::Feature; }) {
22d2ea
             $use_vms_feature = 1;
22d2ea
         }
22d2ea
     }
22d2ea
diff -up PathTools/lib/File/Spec/Cygwin.pm.cve PathTools/lib/File/Spec/Cygwin.pm
22d2ea
--- PathTools/lib/File/Spec/Cygwin.pm.cve	2016-03-01 13:33:02.000000000 +0100
22d2ea
+++ PathTools/lib/File/Spec/Cygwin.pm	2016-08-02 13:39:39.814316060 +0200
22d2ea
@@ -137,7 +137,11 @@ sub case_tolerant {
22d2ea
   if ($mntopts and ($mntopts =~ /,managed/)) {
22d2ea
     return 0;
22d2ea
   }
22d2ea
-  eval { require Win32API::File; } or return 1;
22d2ea
+  eval {
22d2ea
+      local @INC = @INC;
22d2ea
+      pop @INC if $INC[-1] eq '.';
22d2ea
+      require Win32API::File;
22d2ea
+  } or return 1;
22d2ea
   my $osFsType = "\0"x256;
22d2ea
   my $osVolName = "\0"x256;
22d2ea
   my $ouFsFlags = 0;
22d2ea
diff -up PathTools/lib/File/Spec/VMS.pm.cve PathTools/lib/File/Spec/VMS.pm
22d2ea
--- PathTools/lib/File/Spec/VMS.pm.cve	2016-03-01 13:33:02.000000000 +0100
22d2ea
+++ PathTools/lib/File/Spec/VMS.pm	2016-08-02 13:39:39.814316060 +0200
22d2ea
@@ -39,7 +39,10 @@ via the C<DECC$FILENAME_UNIX_REPORT> CRT
22d2ea
 
22d2ea
 my $use_feature;
22d2ea
 BEGIN {
22d2ea
-    if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
22d2ea
+    if (eval { local $SIG{__DIE__};
22d2ea
+               local @INC = @INC;
22d2ea
+               pop @INC if $INC[-1] eq '.';
22d2ea
+               require VMS::Feature; }) {
22d2ea
         $use_feature = 1;
22d2ea
     }
22d2ea
 }
22d2ea
diff -up PathTools/lib/File/Spec/Win32.pm.cve PathTools/lib/File/Spec/Win32.pm
22d2ea
--- PathTools/lib/File/Spec/Win32.pm.cve	2016-03-01 13:33:02.000000000 +0100
22d2ea
+++ PathTools/lib/File/Spec/Win32.pm	2016-08-02 13:39:39.814316060 +0200
22d2ea
@@ -90,7 +90,11 @@ Default: 1
22d2ea
 =cut
22d2ea
 
22d2ea
 sub case_tolerant {
22d2ea
-  eval { require Win32API::File; } or return 1;
22d2ea
+  eval {
22d2ea
+    local @INC = @INC;
22d2ea
+    pop @INC if $INC[-1] eq '.';
22d2ea
+    require Win32API::File;
22d2ea
+  } or return 1;
22d2ea
   my $drive = shift || "C:";
22d2ea
   my $osFsType = "\0"x256;
22d2ea
   my $osVolName = "\0"x256;