nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paul Vixie
Subject: Re: [Nmh-workers] nmh should be more careful about when it unlinks draft files
Date: Tue, 03 Jan 2017 13:01:00 -0800
User-agent: KMail/5.3.2 (Linux/4.4.36-8-default; KDE/5.26.0; x86_64; ; )

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]