private mail. New in 1.3.2 - support for matching arbitrary headers in rules - bugfixes pkgsrc includes additional changes: - fix for http://secunia.com/advisories/15977/ - work around an annoying header parsing issue which resulted in totally garbled date sorting - work around random SIGSEVs
29 lines
881 B
Text
29 lines
881 B
Text
$NetBSD: patch-ab,v 1.1 2005/07/16 15:40:56 wiz Exp $
|
|
|
|
--- src/stats.c.orig Thu Apr 29 10:06:10 2004
|
|
+++ src/stats.c
|
|
@@ -185,6 +185,8 @@ stats_dump (void)
|
|
FILE *fp;
|
|
mail_t *mail;
|
|
struct estats stats;
|
|
+ int fd;
|
|
+ char fn[25] = "/tmp/elmostats.XXXXXXXXX";
|
|
|
|
if (wrapbox_marray == NULL)
|
|
return;
|
|
@@ -200,9 +202,12 @@ stats_dump (void)
|
|
process_mail (& stats, mail);
|
|
}
|
|
|
|
- fp = fopen ("/tmp/elmostats", "w");
|
|
- if (fp == NULL){
|
|
- error_ (errno, _("couldn't open %s"), "/tmp/elmostats");
|
|
+ fp = NULL;
|
|
+ fd = mkstemp(fn);
|
|
+ if (fd != -1 )
|
|
+ fp = fdopen (fd, "w");
|
|
+ if (fp == NULL) {
|
|
+ error_ (errno, _("couldn't open %s"), fn);
|
|
destroy_stats (& stats);
|
|
return;
|
|
}
|