Paul wrote: > On 2012-09-16 4:50 PM, David Levine wrote: > > Lyndon wrote: > > > >> On 2012-09-16, at 8:42 AM, Lyndon Nerenberg wrote: > >> > >>> Well, there's the obvious race condition ... > >> Sorry, I left out the "NFS" in front of "race." > > What's the NFS race condition? If you're talking about > > old NFS that doesn't support O_EXCL, I'm not willing to > > jump through hoops for that. > > i don't think it requires nfs in order for it to be a race. granted, > this code cannot lose a race against itself if coded as open, close, > fopen, since the file name will be stable and the open uses creat|excl. > however, some other app could sneak in and get the file opened between > the close and the fopen, which smells like a security problem. far > better to do open, fdopen. (i'm thinking now of two of "crontab"'s early > CERT advisories.)
How is this more dangerous than fopen'ing for write any of my existing files? mhstore already has multiple open-closes on an output file to support gluing together of message/partial's, how is that different? David _______________________________________________ Nmh-workers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/nmh-workers
