diff -uprk.orig mutt-1.4.orig/compress.c mutt-1.4/compress.c --- mutt-1.4.orig/compress.c 2003-01-24 13:28:22 +0300 +++ mutt-1.4/compress.c 2003-01-24 15:09:30 +0300 @@ -129,12 +129,21 @@ static COMPRESS_INFO *set_compress_info static void set_path (CONTEXT* ctx) { char tmppath[_POSIX_PATH_MAX]; + FILE *fp; + + /* XXX: Create the temporary file and reopen it w/out O_EXCL, this method + * has it's problems: see Zalewski's paper about tmp cleaners, but + * we call compressor with the filename ... */ + if ((fp = mutt_mktempfile (tmppath, sizeof (tmppath), "w")) == NULL) + { + mutt_perror ("could not create temporary folder"); + return; + } + fclose (fp); + fp = NULL; /* Setup the right paths */ ctx->realpath = ctx->path; - - /* Uncompress to /tmp */ - mutt_mktemp (tmppath); ctx->path = safe_malloc (strlen (tmppath) + 1); strcpy (ctx->path, tmppath); } diff -uprk.orig mutt-1.4.orig/nntp.c mutt-1.4/nntp.c --- mutt-1.4.orig/nntp.c 2003-01-24 13:28:22 +0300 +++ mutt-1.4/nntp.c 2003-01-24 15:12:53 +0300 @@ -403,9 +403,11 @@ static int nntp_read_header (CONTEXT *ct int ret; HEADER *h = ctx->hdrs[ctx->msgcount]; - mutt_mktemp (tempfile); - if (!(f = safe_fopen (tempfile, "w+"))) + if (!(f = mutt_mktempfile (tempfile, sizeof (tempfile), "w+"))) + { + mutt_perror ("mutt_mktempfile"); return -1; + } if (!msgid) snprintf (buf, sizeof (buf), "HEAD %d\r\n", article_num); @@ -893,13 +895,12 @@ int nntp_fetch_message (MESSAGE *msg, CO mutt_message (m); cache->index = ctx->hdrs[msgno]->index; - mutt_mktemp (path); - cache->path = safe_strdup (path); - if (!(msg->fp = safe_fopen (path, "w+"))) + if (!(msg->fp = mutt_mktempfile (path, sizeof (path), "w+"))) { - FREE (&cache->path); + mutt_perror ("mutt_mktempfile"); return -1; } + cache->path = safe_strdup (path); if (ctx->hdrs[msgno]->article_num == 0) snprintf (buf, sizeof (buf), "ARTICLE %s\r\n",