Make tempfile names unique across Exim instances running in a cluster on
a shared $spool_directory. (They need to set localhost_number to have
cluster-unique message_exim_ids.)
(a previous attempt to fix addressed lack, for a long time, of initial
input).
(a previous attempt to fix addressed lack, for a long time, of initial
input).
+HS/01 Bug 2390: Use message_id for tempfile creation to avoid races in a
+ shared (NFS) environment. The length of the tempfile name is now
+ 4 + 16 ("hdr.$message_exim_id") which might break on file
+ systems which restrict the file name length to lower values.
+ (It was "hdr.$pid".)
+
Exim version 4.92
-----------------
Exim version 4.92
-----------------
uschar * tname;
uschar * fname;
uschar * tname;
uschar * fname;
-tname = spool_fname(US"input", message_subdir,
- string_sprintf("hdr.%d", (int)getpid()), US"");
+tname = spool_fname(US"input", message_subdir, US"hdr.", message_id);
if ((fd = spool_open_temp(tname)) < 0)
return spool_write_error(where, errmsg, US"open", NULL, NULL);
if ((fd = spool_open_temp(tname)) < 0)
return spool_write_error(where, errmsg, US"open", NULL, NULL);