Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 96863
Status: open
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
info [...] gwendragon.de
Cc: MITHALDU [...] cpan.org
AdminCc:

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



Subject: [Bug] File::Spec::Win32 - user temporary directory not found if taint mode
Date: Tue, 1 Jul 2014 18:48:17 +0200
To: bug-PathTools [...] rt.cpan.org
From: GwenDragon <info [...] gwendragon.de>
Hello Steffen, File::Spec::Win32 has some issues if used by other modules or programs running in taint mode (command line switch or shebang with -T). No temporary directory for user (may be in %LOCALAPPDATA%\TEMP on some Windows versions) is found on taint mode. In some cases tmpdir returns / which is not desireable. A fix could be done in Win32.pm in method tmpdir(). The user temp path can be found in Windows by : concat Win32::GetFolderPath(Win32::CSIDL_LOCAL_APPDATA()) and 'Temp'. Please check my patch/module and fix the module asap if my fix is a correct solution. Thanks and have a nice day. -- Regards from Franken (Germany) GwenDragon E-Mail: gd@gwendragon.de Web: http://gwendragon.de/ +-----------------------------------------------------------------+ | E-Mail mit GnuPG signiert/Signed with GnuPG | | | | GnuPG-Signatur RSA/4096bit | | Key-ID: 0x269218D092DD50ED | | Fingerprint: A856 CB19 1371 BF21 E2F9 DC09 2692 18D0 92DD 50ED | +-----------------------------------------------------------------+

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Download (untitled)
application/pgp-signature 830b

Message body not shown because it is not plain text.

From: info [...] gwendragon.de
If %TMP% or %TEMP% do not exist or can not be used (Taint mode) or missing C:\temp in system we run into a problem. tmpdir() then shows \ as temp dir, which is incorrect. Problematic code is around line 53 in file File\Spec\Win32.pm I added a testcase for problems with Taint mode to show this. Call test like this: perl File-Spec-tempdir-win32.t results in: U:\>perl File-Spec-tempdir-win32.t ok 1 - require File::Spec; # # DEBUG: Tempdir is: 'C:\Users\GWENDR~1\AppData\Local\Temp' ok 2 - tmpdir is not like \ 1..2 Call test like this: perl -T File-Spec-tempdir-win32.t U:\>perl -T File-Spec-tempdir-win32.t ok 1 - require File::Spec; # # DEBUG: Tempdir is: '\' not ok 2 - tmpdir is not like \ # Failed test 'tmpdir is not like \' # at U:\LylCanbys\Downloads\File-Spec-tempdir-win32.t line 22. 1..2 # Looks like you failed 1 test of 2. Please check and fix this with my previously sent patched Win32.pm.
Subject: File-Spec-tempdir-win32.t
#!perl use Test::More; use strict; use warnings; require_ok('File::Spec'); use File::Spec; my $temp = File::Spec->tmpdir; diag("\nDEBUG: Tempdir is: '$temp'"); # ### single \ is a fault # ### valid temporary dir should be: # %LOCALAPPDATA%\Temp as user temporary dir # C:\TMP system wide # C:\TEMP system wide # # fails because %TEMP%, %TMPDIR% or %TEMP% are not used with taint mode! # see line 53 in file File\Spec\Win32.pm ok( $temp !~ /^\\/, 'tmpdir is not like \\' ); done_testing(); 1;
I've been hitting this, with cpantesters failures from windows users -- e.g. http://www.cpantesters.org/cpan/report/c7de0f50-6d6e-1014-afb3-f4f4e8181ba5 Is there any chance this could be fixed? windows users are feeling like they are second-class citizens, with so many things uninstallable by default.