diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2002-03-13 23:34:58 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2002-03-13 23:34:58 +0000 |
commit | 9d196d14c3a3229fa677f0827303d95b97b37680 (patch) | |
tree | 45a595d5bea7162b1f957bccf747870033519251 /attach.c | |
parent | 76f4bd34f401fa7bd45eb1d4f19460a07b1f1621 (diff) |
Don't fopen mail folders in append mode where we should safe_fopen()
them in write mode. Debian bug #138200, noted by Colin Philipps
<cph@cph.demon.co.uk>.
NEEDS BACKPORTING.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -762,7 +762,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) fseek (fp, m->offset, 0); if (fgets (buf, sizeof (buf), fp) == NULL) return -1; - if (mx_open_mailbox(path, M_APPEND | M_QUIET, &ctx) == NULL) + if (mx_open_mailbox (path, (flags == M_SAVE_APPEND ? M_APPEND : M_NEW) | M_QUIET, &ctx) == NULL) return -1; if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL) { |