]> git.lyx.org Git - lyx.git/commit
Remove unsafe method FileName::tempName()
authorGeorg Baum <baum@lyx.org>
Mon, 9 Jun 2014 11:05:50 +0000 (13:05 +0200)
committerGeorg Baum <baum@lyx.org>
Mon, 9 Jun 2014 11:05:50 +0000 (13:05 +0200)
commitf09a9fe2e60e4aeaca23b42b2bf30f5d64cfd9b1
treeafe527cb2fff1c9cebe8001e1a7ae490b6cfa924
parentae15b5973487852325baf0859b40632e0f12b9c7
Remove unsafe method FileName::tempName()

FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
18 files changed:
src/Buffer.cpp
src/CutAndPaste.cpp
src/KeyMap.cpp
src/LayoutFile.cpp
src/LyXRC.cpp
src/LyXVC.cpp
src/TextClass.cpp
src/VCBackend.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiWorkArea.cpp
src/graphics/GraphicsCacheItem.cpp
src/graphics/GraphicsConverter.cpp
src/insets/InsetExternal.cpp
src/insets/InsetExternal.h
src/mathed/MathExtern.cpp
src/support/FileName.cpp
src/support/FileName.h
src/support/filetools.cpp