1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From b0da9a700c4dd50d12af5ec8b3fbdaae0f295137 Mon Sep 17 00:00:00 2001
From: martin f. krafft <madduck@madduck.net>
Date: Tue, 26 May 2009 08:20:03 +0200
Subject: [PATCH 1/2] Changed tmpdir default to /var/tmp
By default, mutt stores drafts in
/tmp/mutt-$HOSTNAME-$UID-$PID-$REV. /tmp is designed to hold data
that isn't guaranteed to be preserved between different invocations
of programmes. For practical purposes, and on Debian at least, this
translates to files being deleted on every boot, unless TMPTIME is
amended in /etc/default/rcS and /tmp is not a tmpfs.
This behaviour can cause loss of data, e.g. when the laptop dies or
turns itself off due to low power; the user might not have a chance
to commit the temporary mail draft s/he was working on to
non-volatile storage.
I suggest that mutt should use /var/tmp by default for its mail
drafts, as that directory is also temporary in nature, but cleaned
less frequently than /tmp. More specifically, the FHS dictates that
"files and directories located in /var/tmp must not be deleted when
the system is booted."
This patch modifies all occurrences of $tmpdir, $TMPDIR and Tempdir, but
not the documentation, which looks like it's generated from init.h.
--- a/init.c
+++ b/init.c
@@ -3750,7 +3750,7 @@
MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
}
- Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
+ Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/var/tmp");
p = getenv ("VISUAL");
if (!p)
--- a/init.h
+++ b/init.h
@@ -4340,7 +4340,7 @@
** This variable allows you to specify where Mutt will place its
** temporary files needed for displaying and composing messages. If
** this variable is not set, the environment variable \fC$$$TMPDIR\fP is
- ** used. If \fC$$$TMPDIR\fP is not set then ``\fC/tmp\fP'' is used.
+ ** used. If \fC$$$TMPDIR\fP is not set then ``\fC/var/tmp\fP'' is used.
*/
{ "to_chars", DT_MBCHARTBL, R_BOTH, {.p=&Tochars}, {.p=" +TCFL"} },
/*
|