develooper Front page | perl.cpan.workers | Postings from May 2015

RFC: Fixing fallback tempdir location on Win32

Thread Next
From:
David Golden
Date:
May 21, 2015 15:39
Subject:
RFC: Fixing fallback tempdir location on Win32
Message ID:
CAOeq1c9od25nH9TBpEW+n3SEV6tRj=bpaZ0zf2r5_BawgXwjAg@mail.gmail.com
We have various unsolved tickets (see end for links) about
File::Temp/File::Spec failing on Windows due to taint, where
File::Spec->tmpdir returns the root directory, which many Windows users
can't actually write to.  (Context: File::Spec checks -w on candidate temp
dirs, but that can be true on Windows, yet the ACLs can prevent files from
being written there. See perlport on -X operators.)

After discussions on #toolchain, I have two proposals:

(1)  That File::Temp fall back to the following if it can't create a
temporary directory in the directory that is the result of
File::Spec->tmpdir:


File::Spec->catdir(Win32::GetFolderPath(Win32::CSIDL_LOCAL_APPDATA),q{Temp})

(2) That File::Spec::Win32 put that same path after environment variables
paths but before all existing fallback paths (
https://metacpan.org/source/SMUELLER/PathTools-3.47/lib/File/Spec/Win32.pm#L74-78
)

Doing #1 will allow users to upgrade File::Temp and fix the problem on
older perls without needing to upgrade PathTools.  Doing #2 will fix both
and can go into perl v5.23 and be released to CPAN after the corresponding
v5.23 release.

Thoughts?

David

File::Temp tickets
* https://rt.cpan.org/Ticket/Display.html?id=60340 (two tickets merged)

PathTools tickets
* https://rt.cpan.org/Ticket/Display.html?id=76663
* https://rt.cpan.org/Ticket/Display.html?id=96863

-- 
David Golden <xdg@xdg.me> Twitter/IRC: @xdg

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About