From c68e306d177b20e3ad28325ac9fd4b967a15772e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Mon, 21 Apr 2003 08:23:35 +0000 Subject: [PATCH] Don't break under taint mode on OpenBSD. (thanks to Frank Denis / Jedi/Sector One) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@141 958fd67b-6ff1-0310-b445-bb7760255be9 --- Changes | 3 +++ lib/Qpsmtpd/Transaction.pm | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/Changes b/Changes index d63cc1a..a72b07f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ 0.26-dev + Don't break under taint mode on OpenBSD. (thanks to Frank Denis / + Jedi/Sector One) + Have the qmail-queue plugin add the message-id to the "Queued!" message we send back to the client (to help those odd sendmail using people debug their logs) diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index 975c2b8..32857a3 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -55,6 +55,7 @@ sub notes { my $self = shift; my $key = shift; @_ and $self->{_notes}->{$key} = shift; + #warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]); $self->{_notes}->{$key}; } @@ -71,6 +72,14 @@ sub body_write { : Qpsmtpd::Utils::tildeexp('~/tmp/'); $spool_dir .= "/" unless ($spool_dir =~ m!/$!); + + $spool_dir =~ /^(.+)$/ or die "spool_dir not configured properly"; + $spool_dir = $1; + + if (-e $spool_dir) { + my $mode = (stat($spool_dir))[2]; + die "Permissions on the spool_dir are not 0700" if $mode & 07077; + } -d $spool_dir or mkdir($spool_dir, 0700) or die "Could not create spool_dir: $!"; $self->{_filename} = $spool_dir . join(":", time, $$, $transaction_counter++);