Filter out all uncommon characters from the remote_host

setting. (thanks to Frank Denis / Jedi/Sector One for the hint).


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@142 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2003-04-21 08:28:12 +00:00
parent c68e306d17
commit 1223c26ccf
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,10 @@
0.26-dev 0.26-dev
Filter out all uncommon characters from the remote_host
setting. (thanks to Frank Denis / Jedi/Sector One for the hint).
Added a check for the spool_dir having mode 0700.
Don't break under taint mode on OpenBSD. (thanks to Frank Denis / Don't break under taint mode on OpenBSD. (thanks to Frank Denis /
Jedi/Sector One) Jedi/Sector One)

View File

@ -15,6 +15,11 @@ sub start_connection {
my $remote_info = $ENV{TCPREMOTEINFO} ? "$ENV{TCPREMOTEINFO}\@$remote_host" : $remote_host; my $remote_info = $ENV{TCPREMOTEINFO} ? "$ENV{TCPREMOTEINFO}\@$remote_host" : $remote_host;
my $remote_ip = $ENV{TCPREMOTEIP}; my $remote_ip = $ENV{TCPREMOTEIP};
# if the local dns resolver doesn't filter it out we might get
# ansi escape characters that could make a ps axw do "funny"
# things. So to be safe, cut them out.
$remote_host =~ tr/a-zA-Z\.\-0-9//cd;
$0 = "$0 [$remote_ip : $remote_host]"; $0 = "$0 [$remote_ip : $remote_host]";
$self->SUPER::connection->start(remote_info => $remote_info, $self->SUPER::connection->start(remote_info => $remote_info,