On Fri, Jan 07, 2011 at 01:32:27PM -0700, Theo de Raadt wrote: > I think it is important that people who do use mktemp(3) realize that > they must loop over failure (creating a new path each time), and they > need to use a "do not use the path from elsewhere unless the code that > opens it returns success" paradigm. mktemp(3) just provides a "potentially > unique name"; the expected gaurantees must be supplied by the caller.
It is also important that the caller provides enough XXX to actually have a chance to finish the loop against a motivated concurrent user, especially when using something like /tmp. Joerg