summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-01-08 15:06:44 +0100
committerMarc Mutz <marc.mutz@qt.io>2025-01-23 22:42:17 +0000
commita01b14f1de59d378088a949bb21f3536832634c8 (patch)
tree991b2d70d7ba506672312558f843b6af2ae5fb43 /src/opengl/qopengltexture.cpp
parent2dfbfd5f9a800f40afd2a4e48a208a9f781fb0ae (diff)
QTemporaryFile: add private API for an overwriting rename()
In many situations, it is desireable that QTemporaryFile::rename() overwrites an existing file, such as when emulating QSaveFile because one would like more control over the temp file (such as passing it to a different process). The public API of QTemporaryFile did not allow it, making the typical Unix mktemp + mv algorithm to avoid symlink attacks unimplementable with public Qt API. QSaveFile is not a 100% replacement, because it always follows symlinks and places the temporary file beside the physical target file, keeping the symlink intact, instead of placing the tmp file beside the symlink and clobbering it, if the target happens to be one. Extract Method QTemporaryFilePrivate::rename() and add a bool overwrite parameter that causes the existing QTemporaryFileEngine::renameOverwrite() to be called in lieu of QTemporaryFileEngine::rename(). The non-atomic path via QFile::rename() is not affected. This makes the functionality available as private API, in case we need it in older branches. Task-number: QTBUG-132646 Pick-to: 6.9 6.8 6.5 5.15 Change-Id: I0d5ca96c0a1a557854582e1a565a3db0d8af2a95 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/opengl/qopengltexture.cpp')
0 files changed, 0 insertions, 0 deletions