nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] nmh should be more careful about when it unlinks draft files

2017-01-03 15:01:41
On Tuesday, 3 January 2017 10:50:11 PST Ken Hornstein wrote:
- The file is created with creat(), which as you know does get called
with O_CREAT, but does not include O_EXCL.
... 
At least in the case of comp(1), by the time creat() is called it is
writing a new draft into that file.  It seems like the assumption at
that point is that no one else is writing to that file.  So I am thinking
that using O_CREAT | O_EXCL is fine. What do others think?  It looks
like we could do something similar in replsbr.c:replout().

the error it signals up-stack must tell its caller why it fails, so that its 
caller can then try the next possible filename (message number). only if it 
fails N times in a row (suggest 6 or 42, from the prisoner and douglas adams) 
should comp then fail.

this should be done for all file-creation including inc/refile/rcvstore/etc.

if we're not going to do this much, then adding O_EXCL will do very little good.

-- 
P. Vixie
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers
<Prev in Thread] Current Thread [Next in Thread>