qt5base-lts/tests/auto/corelib/io
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
..
qabstractfileengine Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
qbuffer Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
qdatastream Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qdebug Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
qdir Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qdiriterator Avoid using QSKIP in lieu of compile-time checks 2011-10-05 03:04:31 +02:00
qfile Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qfileinfo Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qfilesystementry Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qfilesystemwatcher Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qiodevice Avoid using QSKIP in lieu of compile-time checks 2011-10-05 03:04:31 +02:00
qprocess Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qprocessenvironment Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qresourceengine Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qsettings Remove SkipMode parameter from QSKIP calls. 2011-10-21 01:20:29 +02:00
qtemporaryfile Atomic implementation of create file and obtain handle for Win/Symbian 2011-10-21 22:20:18 +02:00
qtextstream Avoid using QSKIP in lieu of compile-time checks 2011-10-05 03:04:31 +02:00
qurl Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
io.pro Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00