Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 71799
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: jeff [...] math.tntech.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: find_tempdir() still has problems under ms-windows
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1493
Download (untitled) / with headers
text/plain 1.4k
Older CGI.pm versions had the following code in the find_tempdir sub: if( $CGI::OS eq 'WINDOWS' ){ unshift @TEMP, $ENV{TEMP}, $ENV{TMP}, $ENV{WINDIR} . $SL . 'TEMP'; } This was problematic because it could put 'undef' values onto the @TEMP array. This is fixed in 3.55 (and before) via the following: # PeterH: These vars may not exist if this is invoked... unshift(@TEMP,$ENV{TEMP}) if defined $ENV{TEMP}; unshift(@TEMP,$ENV{TMP}) if defined $ENV{TMP}; unshift(@TEMP,$ENV{WINDIR} . $SL . 'TEMP') if defined $ENV{WINDIR}; HOWEVER, this new code puts entries onto @TEMP in the opposite order of the original code. The result is that C:\WINDOWS\TEMP will be preferred over the settings from the environment variables, which is *not* what most people will want. The order of the above three lines should be reversed: unshift(@TEMP,$ENV{WINDIR} . $SL . 'TEMP') if defined $ENV{WINDIR}; unshift(@TEMP,$ENV{TMP}) if defined $ENV{TMP}; unshift(@TEMP,$ENV{TEMP}) if defined $ENV{TEMP}; ----- An alternative fix would be to restore the old code and remove the other 'if defined' check that appears, and then change the line inside the loop: for (@TEMP) { do {$TMPDIRECTORY = $_; last} if -d $_ && -w _; } to do {$TMPDIRECTORY = $_; last} if defined($_) && -d $_ && -w _; Thanks! -Jeff PS: Yes, I am kind of ashamed of myself for using Perl with ms-win, but I have no choice, I tellya, they've got my kids and won't release them unless I cooperate !-)
From mark [...] summersault.com Thu Oct 27 09: 42:27 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-6.581 tagged_above=-99.9 required=10 tests=[AWL=-0.346, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_SOFTFAIL=0.665] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-2600-1319076913-1811.71799-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-71799 [...] rt.cpan.org> <rt-3.8.HEAD-2600-1319076913-1811.71799-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <4EA95FB4.3030704 [...] summersault.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.581
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id BC75E240BE9 for <cpan-bug+cgi.pm [...] hipster.bestpractical.com>; Thu, 27 Oct 2011 09:42:27 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vTucqq1M5Ur1 for <cpan-bug+cgi.pm [...] hipster.bestpractical.com>; Thu, 27 Oct 2011 09:42:26 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 33176240AFF for <bug-cgi.pm [...] rt.cpan.org>; Thu, 27 Oct 2011 09:42:26 -0400 (EDT)
Received: (qmail 538 invoked by uid 103); 27 Oct 2011 13:42:25 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 27 Oct 2011 13:42:25 -0000
Received: from tanagra.summersault.com (HELO tanagra.summersault.com) (12.161.105.149) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Thu, 27 Oct 2011 06:42:23 -0700
Received: (qmail 30992 invoked from network); 27 Oct 2011 13:42:18 -0000
Received: from simba.summersault.com (192.168.97.182) by tanagra.summersault.com with SMTP; 27 Oct 2011 13:42:18 -0000
Delivered-To: cpan-bug+cgi.pm [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
Subject: Re: [rt.cpan.org #71799] find_tempdir() still has problems under ms-windows
Return-Path: <mark [...] summersault.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+cgi.pm [...] hipster.bestpractical.com
X-RT-Mail-Extension: cgi.pm
Date: Thu, 27 Oct 2011 09:42:12 -0400
X-Spam-Level:
To: bug-cgi.pm [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Mark Stosberg <mark [...] summersault.com>
RT-Message-ID: <rt-3.8.HEAD-2600-1319722948-103.71799-0-0 [...] rt.cpan.org>
Content-Length: 253
Download (untitled) / with headers
text/plain 253b
Thanks for the report, Jeff. Either option proposed seems fine. If you want to make this really easy for me, you could fork on github and submit a pull request. But, the change is simple enough. Someone will take a look and merge it. Thanks again.
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-5432-1400760742-1464.71799-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 240
Download (untitled) / with headers
text/plain 240b
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/91 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-2643-1405087201-91.71799-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 552
Download (untitled) / with headers
text/plain 552b
commit cb434b3b27897e2a486c930f144bba60216caa22 Author: Lee Johnson <lee@givengain.ch> Date: Fri Jul 11 15:56:35 2014 +0200 resolve #91 [rt.cpan.org #71799] - WIN TEMP dir order returned to that before e24d04e9bc5fda7722444b02fec135d8cc2ff488, which fixed issues with undefined values being unshifted onto the array. However the change from a single unshift statement to three calls mean the order was changed. restore the original order by reversing the order of the unshift calls Changes | 4 ++++ lib/CGI.pm | 4 ++--


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.