On 8/16/22 09:25, Eli Zaretskii wrote:
The programmer didn't
expect that because it is natural to expect each call to a function
that creates a temporary file to create a file under a new name, not
reuse the same name.

Regardless of whether the programmer expects a random name or a predictable-but-unique name, there are only a finite number of names to choose from so the programmer must take into account the possibility that the chosen name clashes with names that the programmer would prefer not to be chosen.

This means an Emacs patch such as [1] is needed regardless of whether Gnulib's gen_tempname is changed to be more random than it is. Although it's true that the bug fixed by [1] is less likely if gen_tempname generates more-random names, the bug can occur no matter what we do about gen_tempname.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?filename=0001-Don-t-create-temp-file-with-same-name-as-visited.patch;bug=57129;msg=59;att=2

Reply via email to