From f1b604fb0392abaaadbddc05b25631e04356996e Mon Sep 17 00:00:00 2001 From: Akos Vandra Date: Sun, 25 Sep 2016 16:25:41 +0200 Subject: [PATCH] Ability to run in tainted mode for spamassasin plugin. --- contrib/SpamAssassin/Collectd.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/SpamAssassin/Collectd.pm b/contrib/SpamAssassin/Collectd.pm index 1edcfc61..58d1e686 100644 --- a/contrib/SpamAssassin/Collectd.pm +++ b/contrib/SpamAssassin/Collectd.pm @@ -152,8 +152,8 @@ sub check_end { #try at least $self->{main}->{conf}->{collectd_retries} to get a #connection for (my $i = 0; $i < $self->{main}->{conf}->{collectd_retries} ; ++$i) { - last if $sock = new IO::Socket::UNIX - ($self->{main}->{conf}->{collectd_socket}); + my ($socket_path) = $self->{main}->{conf}->{collectd_socket} =~ /(.*)/ # Untaint path, which can contain any characters. + last if $sock = new IO::Socket::UNIX $socket_path; #sleep a random value between 0 and 50 microsecs to try for a new #thread usleep(int(rand(50))); -- 2.11.0