
20 Mar
2002
20 Mar
'02
5:42 a.m.
"D. Tweed"
Could someone post an example of the creation of a temporary file where race conditions are important?
myscript wants to create a temporary file called /tmp/storedStuff being half-careful, checks file doesn't exist (*) miniscule delay occurs creates a new file called /tmp/storedStuff
and of course, the solution is to open(file, ... | O_EXCL | O_CREAT) that way if someone wants to trick you it fails nicely, and in other cases everything is nice :)