1 --- elm2.5.6/src/reply.c.orig Thu Aug 2 17:24:37 2001
2 +++ elm2.5.6/src/reply.c Tue Oct 30 04:18:05 2001
5 #include "elm_globals.h"
11 /** Note that this routine generates automatic header information
12 for the subject and (obviously) to lines, but that these can
15 char entered[VERY_LONG_STRING], expanded[VERY_LONG_STRING];
16 char *filename, buffer[VERY_LONG_STRING], *msg;
20 + char tempfilename[255],*tmpdir;
25 if (!get_to(entered, expanded, SM_ORIGINAL))
27 /* tempnam is bad.... but only if we open the file in a way that follows
28 * symlinks.... file_open doesn't. */
30 - if((filename = tempnam(temp_dir, "snd.")) == NULL) {
31 + tmpdir=getenv("TMPDIR");
33 + snprintf(tempfilename,255,"%s/snd.XXXXXX",tmpdir);
36 + strncpy(tempfilename,"/tmp/snd.XXXXXX",254);
39 + if((tmpfd = mkstemp(tempfilename)) == -1) {
40 dprint(1, (debugfile, "couldn't make temp file nam! (remail)\n"));
41 set_error(catgets(elm_msg_cat, ElmSet, ElmCouldntMakeTempFileName,
42 "Sorry - couldn't make file temp file name."));
43 --- elm2.5.5/src/sndpart_io.c.tempnam Thu Apr 6 16:01:21 2000
44 +++ elm2.5.5/src/sndpart_io.c Mon Jun 11 15:00:46 2001
53 static int multipart_seqnum;
56 char *fname_tmp, *fname_sel, cmd_buf[SLEN], *s;
65 + tmpdir=getenv("TMPDIR");
68 + strcpy(tmpdir,"/tmp");
71 + fname_tmp=(char*)calloc(300,sizeof(char));
72 + snprintf(fname_tmp,299,"%s/emm.XXXXXX",tmpdir);
73 switch (mime_encoding_type(part->content_header[BP_CONT_ENCODING])) {
77 - if ((fname_tmp = tempnam(temp_dir, "emm.")) == NULL) {
78 + if((mkstemp(fname_tmp))==-1){
79 error("Cannot make temp file name.");
86 - if ((fname_tmp = tempnam(temp_dir, "emm.")) == NULL) {
87 + if((mkstemp(fname_tmp))==-1){
88 error("Cannot make temp file name.");
94 case ENCODING_UUENCODE:
95 - if ((fname_tmp = tempnam(temp_dir, "emm.")) == NULL) {
96 + if((mkstemp(fname_tmp))==-1){
97 error("Cannot make temp file name.");
103 /* encoding not needed */
108 --- elm2.5.5/src/sndmsg.c.tempnam Thu Apr 6 16:19:55 2000
109 +++ elm2.5.5/src/sndmsg.c Mon Jun 11 15:00:46 2001
111 #include "sndparts.h"
118 extern char *bounce_off_remote();
119 extern char *strip_commas();
121 char bigbuf[VERY_LONG_STRING];
125 - /* is there a cancelled message laying around from last time? */
127 +/* is there a cancelled message laying around from last time? */
128 static int cancelled_msg = FALSE;
129 static int saved_want_sig = FALSE;
135 + tmpdir=getenv("TMPDIR");
138 + strcpy(tmpdir,"/tmp");
141 assert(mssgtype == SM_ORIGINAL || OPMODE_IS_READMODE(opmode));
145 remove_hostbang(shdr->expanded_bcc);
147 /* create temp file in which to build entire message */
148 - if ((fname_fullmssg = tempnam(temp_dir, "xmt.")) == NULL) {
150 + free(fname_fullmssg);
151 + fname_fullmssg=calloc(300,sizeof(char));
152 + snprintf(fname_fullmssg,299,"%s/xmt.XXXXXX",tmpdir);
154 + if (mkstemp(fname_fullmssg)==-1){
155 dprint(1, (debugfile, "couldn't make temp file nam! (mail)\n"));
156 error(catgets(elm_msg_cat, ElmSet, ElmCouldNotMakeTemp,
157 "Sorry - couldn't make temp file name."));
158 --- elm2.5.5/src/sndpart_lib.c.tempnam Thu Mar 14 12:29:56 1996
159 +++ elm2.5.5/src/sndpart_lib.c Mon Jun 11 15:00:56 2001
161 #include "sndparts.h"
169 /*******************/
170 /* Part is parts!! */
178 + tmpdir=getenv("TMPDIR");
181 + strcpy(tmpdir,"/tmp");
184 assert(sel >= 0 && sel < BP_NUM_CONT_HEADERS);
185 bodypart_integrity_check(part);
188 case BP_CONT_DESCRIPTION:
190 - if ((fname_tmp = tempnam(temp_dir, "fil.")) != NULL) {
191 - MIME_FILE_CMD(buf, part->fname, fname_tmp);
194 + fname_tmp=calloc(300,sizeof(char));
195 + snprintf(fname_tmp,299,"%s/file.XXXXXX",tmpdir);
196 + if(mkstemp(fname_tmp)!=-1){
197 + MIME_FILE_CMD(buf, part->fname, fname_tmp);
198 if (system_call(buf, 0) == 0) {
199 if ((fp = fopen(fname_tmp, "r")) != NULL) {
200 if (fgets(buf, sizeof(buf), fp) != NULL) {