summaryrefslogtreecommitdiff
path: root/mail/p5-Mail-Audit/patches/patch-aa
blob: ccc30e263c761ff331c983c9f3782e79b53c8406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-aa,v 1.1 2006/02/02 12:08:14 salo Exp $

Security fix for SA18656, from Debian.

--- Audit.pm.orig	2002-03-03 18:11:20.000000000 +0100
+++ Audit.pm	2006-02-02 12:48:52.000000000 +0100
@@ -4,7 +4,13 @@
 
 my $logging;
 my $loglevel=3;
-my $logfile = "/tmp/".getpwuid($>)."-audit.log";
+my $logfile;
+if (exists $ENV{HOME} and defined $ENV{HOME} and -d $ENV{HOME}) {
+     $logfile = "$ENV{HOME}/.mail_audit.log"
+}
+else {
+     (undef,$logfile) = tempfile("mail_audit.log-XXXXX",TMPDIR=>1);
+}
 
 # ----------------------------------------------------------
 # no user-modifiable parts below this line.
@@ -18,6 +24,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $ASSUME_MSGPREFIX);
 # @ISA will depend on whether the message is MIME; if it is, we'll be MIME::Entity.  if not, we'll be Mail::Internet.
 use Fcntl ':flock';
+use File::Temp qw(tempfile);
 
 $ASSUME_MSGPREFIX = 0;