On 2013-04-22 20:36:08 -0500, Derek Martin wrote: > Regardless, I did outline a way to use mkstemp() to do this, years > ago. There's a reference to it in an earlier comment in this bug: > > http://marc.info/?l=mutt-dev&m=128900518711082
But there's a race condition, and I think that the name with the suffix can easily be guessed from the file that has just been created. For instance, the suffix can often be ".pdf". Or perhaps you can add random characters before the suffix, and in case of failure, try again. > I'd be reasonably happy to take some time to rewrite safe_open() and > company, EXCEPT that I already have a patch for a 1.6 bug (#3298) > that's been completely ignored for four years. In fact, Michael > very recently went out of his way to provide a completely independent > implementation (without ever commenting on the one I already > provided), which I pointed out completely failed to address the > problem, resulting in its reversion... I then provided an improved > patch which, like the first, has been completely ignored. This, > despite the lengthy conversation we just had about that very problem. FYI, I've tested your new patch and I'm using it, and it seems to work well. And yes, it's a pity patches are ignored. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <http://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)