qt5base-lts/tests/auto/corelib
João Abecasis f4f729cb7b Atomic implementation of create file and obtain handle for Win/Symbian
Besides generating a unique name, createFileFromTemplate now also
acquires a file handle on all platforms. The file engine's native handle
is passed by reference and modified in place.

This fixes a long standing security issue on Windows.

On Windows and Symbian platforms we directly use the "native" file path
when processing the template and generating the unique name. Since the
native encoding is known, conversions at this point are safe.

Errors other than "file exists" are propagated to Q(Temporary)File,
and result in a failure in open(). The changes also unify error handling
and should give consistent behaviour across all platforms.

Worthy of note, there's a change in behaviour on Windows and Symbian:
fileNames returned by QTemporaryFile on Windows and Symbian are always
absolute after open has been called. This has to do with how
QFileSystemEntry::nativeFilePath works on these platforms. (Test was
updated to reflect change in behaviour.)

Reviewed-by: Gareth Stockwell
Reviewed-by: Shane Kearns
(cherry picked from commit ff9b69838ec146aeb43d4af8a03043f9c5f0454d)

Conflicts:

	tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp

Change-Id: Ibc9affb321ea4f4b193efc1f7336c9770b43d8df
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:18 +02:00
..
animation Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
codecs Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
concurrent Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
global Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
io Atomic implementation of create file and obtain handle for Win/Symbian 2011-10-21 22:20:18 +02:00
kernel Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
plugin Tests: Fix compilation on Windows. 2011-10-03 07:57:41 +02:00
statemachine Add missing Q_OBJECT macro to GoToStateTransition 2011-10-05 15:00:38 +02:00
thread Remove DEPENDS_ON from qtestlib API. 2011-10-19 07:24:13 +02:00
tools Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
xml Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
corelib.pro Exclude qtconcurrent tests via .pro files. 2011-10-12 18:01:19 +02:00