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
This commit is contained in:
Ask Bjørn Hansen 2003-04-21 08:23:35 +00:00
parent b1fc4cafc5
commit c68e306d17
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,8 @@
0.26-dev 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!" 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 message we send back to the client (to help those odd sendmail using
people debug their logs) people debug their logs)

View File

@ -55,6 +55,7 @@ sub notes {
my $self = shift; my $self = shift;
my $key = shift; my $key = shift;
@_ and $self->{_notes}->{$key} = shift; @_ and $self->{_notes}->{$key} = shift;
#warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]);
$self->{_notes}->{$key}; $self->{_notes}->{$key};
} }
@ -71,6 +72,14 @@ sub body_write {
: Qpsmtpd::Utils::tildeexp('~/tmp/'); : Qpsmtpd::Utils::tildeexp('~/tmp/');
$spool_dir .= "/" unless ($spool_dir =~ m!/$!); $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: $!"; -d $spool_dir or mkdir($spool_dir, 0700) or die "Could not create spool_dir: $!";
$self->{_filename} = $spool_dir . join(":", time, $$, $transaction_counter++); $self->{_filename} = $spool_dir . join(":", time, $$, $transaction_counter++);