From: Philip Hazel Date: Fri, 1 Jul 2005 10:49:01 +0000 (+0000) Subject: Add "b" to calls to fopen() that lack it (for Cygwin's benefit). X-Git-Tag: exim-4_52 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c58b88df956cd5f2b2febc6c447d8549928b454b;p=exim.git Add "b" to calls to fopen() that lack it (for Cygwin's benefit). --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index b79d62de5..dd2e74280 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.180 2005/06/30 10:01:01 steve Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.181 2005/07/01 10:49:01 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -246,6 +246,9 @@ SC/10 Eximstats: added histograms for user specified patterns as requested SC/11 Eximstats: v1.43 - bugfix for pattern histograms with -h0 specified. +PH/33 Patch from the Cygwin maintainer to add "b" to all occurences of + fopen() in the content-scanning modules that did not already have it. + Exim version 4.51 ----------------- diff --git a/src/src/demime.c b/src/src/demime.c index 70125a53d..1f86407f8 100644 --- a/src/src/demime.c +++ b/src/src/demime.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/demime.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/demime.c,v 1.7 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -256,7 +256,7 @@ int mime_get_dump_file(uschar *extension, FILE **f, uschar *info) { } while(result != -1); - *f = fopen(CS file_name,"w+"); + *f = fopen(CS file_name,"wb+"); if (*f == NULL) { /* cannot open new dump file, disk full ? -> soft error */ snprintf(CS info, 1024,"unable to open dump file"); diff --git a/src/src/malware.c b/src/src/malware.c index c137d570f..a790b284b 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/malware.c,v 1.10 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/malware.c,v 1.11 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -873,7 +873,7 @@ int malware(uschar **listptr) { }; snprintf(CS file_name,1024,"%s/scan/%s/%s_scanner_output", spool_directory, message_id, message_id); - scanner_record = fopen(CS file_name,"w"); + scanner_record = fopen(CS file_name,"wb"); if (scanner_record == NULL) { log_write(0, LOG_MAIN|LOG_PANIC, @@ -911,7 +911,7 @@ int malware(uschar **listptr) { malware_name = malware_name_buffer; /* re-open the scanner output file, look for name match */ - scanner_record = fopen(CS file_name,"r"); + scanner_record = fopen(CS file_name,"rb"); while(fgets(CS linebuffer,32767,scanner_record) != NULL) { /* try match */ result = pcre_exec(cmdline_regex_re, NULL, CS linebuffer, Ustrlen(linebuffer), 0, 0, ovector, 30); diff --git a/src/src/mime.c b/src/src/mime.c index 52c92ca85..a4ad0f509 100644 --- a/src/src/mime.c +++ b/src/src/mime.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/mime.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/mime.c,v 1.9 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -244,10 +244,10 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) { if ((pname != NULL) && (fname != NULL)) { snprintf(CS filename, 2048, "%s/%s", pname, fname); - f = fopen(CS filename,"w+"); + f = fopen(CS filename,"wb+"); } else if (pname == NULL) { - f = fopen(CS fname,"w+"); + f = fopen(CS fname,"wb+"); } else if (fname == NULL) { int file_nr = 0; @@ -264,7 +264,7 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) { result = stat(CS filename,&mystat); } while(result != -1); - f = fopen(CS filename,"w+"); + f = fopen(CS filename,"wb+"); }; /* set expansion variable */ diff --git a/src/src/receive.c b/src/src/receive.c index daa260fff..7fa35878b 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/receive.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/receive.c,v 1.21 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1113,7 +1113,7 @@ if (rc == OK) { closedir(tempdir); if (entry != NULL) { - mbox_file = Ufopen(rfc822_file_path,"r"); + mbox_file = Ufopen(rfc822_file_path,"rb"); if (mbox_file == NULL) { log_write(0, LOG_PANIC, "acl_smtp_mime: can't open RFC822 spool file, skipping."); diff --git a/src/src/regex.c b/src/src/regex.c index 7383f3c46..63c1c2c10 100644 --- a/src/src/regex.c +++ b/src/src/regex.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/regex.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/regex.c,v 1.7 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -210,7 +210,7 @@ int mime_regex(uschar **listptr) { /* open file */ - f = fopen(CS mime_decoded_filename, "r"); + f = fopen(CS mime_decoded_filename, "rb"); if (f == NULL) { /* open failed */ log_write(0, LOG_MAIN, diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c index 70926811d..dd5d73b7a 100644 --- a/src/src/spool_mbox.c +++ b/src/src/spool_mbox.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/spool_mbox.c,v 1.7 2005/06/27 14:29:44 ph10 Exp $ */ +/* $Cambridge: exim/src/src/spool_mbox.c,v 1.8 2005/07/01 10:49:02 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -56,7 +56,7 @@ FILE *spool_mbox(unsigned long *mbox_file_size) { /* open [message_id].eml file for writing */ snprintf(CS mbox_path, 1024, "%s/scan/%s/%s.eml", spool_directory, message_id, message_id); - mbox_file = Ufopen(mbox_path,"w"); + mbox_file = Ufopen(mbox_path,"wb"); if (mbox_file == NULL) { debug_printf("unable to open file for writing: %s\n", mbox_path); @@ -129,7 +129,7 @@ FILE *spool_mbox(unsigned long *mbox_file_size) { for (i = 0; i < 2; i++) { message_subdir[0] = (split_spool_directory == (i == 0))? message_id[5] : 0; sprintf(CS mbox_path, "%s/input/%s/%s-D", spool_directory, message_subdir, message_id); - data_file = Ufopen(mbox_path,"r"); + data_file = Ufopen(mbox_path,"rb"); if (data_file != NULL) break; }; @@ -162,7 +162,7 @@ FILE *spool_mbox(unsigned long *mbox_file_size) { *mbox_file_size = statbuf.st_size; /* open [message_id].eml file for reading */ - mbox_file = Ufopen(mbox_path,"r"); + mbox_file = Ufopen(mbox_path,"rb"); return mbox_file; }