]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1089448: Strawberry Perl throws a "Insecure dependency in sysopen" error when...
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 25 Sep 2015 18:33:38 +0000 (20:33 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 25 Sep 2015 18:33:38 +0000 (20:33 +0200)
r=gerv

Bugzilla.pm

index 21b086cbde96bd74f1ddd9594256f7abd1daa7bd..b53eef0a730594308093b6b6bb98328ced304544 100644 (file)
@@ -87,6 +87,14 @@ sub init_page {
         # Some modules throw undefined errors (notably File::Spec::Win32) if
         # PATH is undefined.
         $ENV{'PATH'} = '';
+        # On Windows, these paths are tainted, preventing File::Spec::Win32->tmpdir
+        # from using them. But we need a place to temporary store attachments
+        # which are uploaded.
+        if (ON_WINDOWS) {
+            foreach my $temp (qw(TMPDIR TMP TEMP)) {
+                trick_taint($ENV{$temp}) if $ENV{$temp};
+            }
+        }
     }
 
     # Because this function is run live from perl "use" commands of