Scott Kostyshak
2014-07-17 03:09:25 UTC
commit f09a9fe2e60e4aeaca23b42b2bf30f5d64cfd9b1
Date: Mon Jun 9 13:05:50 2014 +0200
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().
I'm seeing a regression and git bisect led me back to here. Georg, canDate: Mon Jun 9 13:05:50 2014 +0200
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().
you take a look to see if you can reproduce? If not, I will try to dig
deeper. The regression is that the attached document shows the date
before this commit for me but does not show the date (it shows nothing
where the date is inserted) as of this commit. Attached is the
document that leads to different outputs before and after this commit.
As for how I created the document, I can reproduce on Ubuntu 14.04
with the following:
1. Start a new document and wrote "Test: "
2. Go to Insert > File > External Material
3. Do not put anything in the "File" text box (I believe a "." is
automatically inserted).
4. Change "Template" to "Date".
5. Compile
Note that I'm not sure if this just resurfaced a different bug. I
think I heard somewhere that the "Date" external template was not
meant to be serious and was just put in as an example.
Scott