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: Ken Hornstein
Subject: Re: [Nmh-workers] nmh should be more careful about when it unlinks draft files
Date: Tue, 03 Jan 2017 09:18:58 -0500

>I didn't look at the code.  :-)  I just thought that surely 42 is
>open(2)'d with O_CREAT|O_EXCL so Unix annoints the race's winner.

Geez Ralph, how long have you been working with MH/nmh??  And don't
call me Shirley.

The long answer is:

- Programs will call m_draft() to get the name of the draft file.  There
  is locking there, but only to get the "new" sequence.  It's easy for two
  programs to get the same filename for "new".

- There is a check to see if the draft file exists, but there's no locking
  there so it's easy to see how two programs could decide the same file
  doesn't exist.

- The file is created with creat(), which as you know does get called with
  O_CREAT, but does not include O_EXCL.

Really, the safest thing to do for Laura's case is to use the MH environment
variable to point to a new .mh_profile that has it's own Path that doesn't
stomp all over your personal mail directory.

--Ken



reply via email to

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