X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=src%2Fsrc%2Fspool_mbox.c;h=12cf3d43eaf58b7c33ed96575cad8403b1979ef5;hp=3364b57517ba56a1e969e00bb38ee11bcf6ac226;hb=eb57651e8badf0b65af0371732e42f2ee5c7772c;hpb=8544e77a6ed430f7063162906c449f1353d72e58 diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c index 3364b5751..12cf3d43e 100644 --- a/src/src/spool_mbox.c +++ b/src/src/spool_mbox.c @@ -1,5 +1,3 @@ -/* $Cambridge: exim/src/src/spool_mbox.c,v 1.15 2010/06/05 11:13:30 pdp Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ @@ -58,7 +56,7 @@ FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) { mbox_file = modefopen(mbox_path, "wb", SPOOL_MODE); if (mbox_file == NULL) { log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno, - "scan file %s", mbox_file)); + "scan file %s", mbox_path)); goto OUT; }; @@ -98,7 +96,11 @@ FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) { }; /* End headers */ - (void)fwrite("\n", 1, 1, mbox_file); + if (fwrite("\n", 1, 1, mbox_file) != 1) { + log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \ + message headers to %s", mbox_path); + goto OUT; + } /* copy body file */ if (source_file_override == NULL) { @@ -157,7 +159,7 @@ FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) { if (Ustat(mbox_path, &statbuf) != 0 || (yield = Ufopen(mbox_path,"rb")) == NULL) { log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno, - "scan file %s", mbox_file)); + "scan file %s", mbox_path)); goto OUT; };