summaryrefslogtreecommitdiffstats
path: root/spampd/untaint-pidfile.patch
blob: cd93ad0dffb7844bf6f855221c4d574052c5aedd (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
commit 662d82ec2badc34f4de561021ea714afe1e1bddc
Author: Florian Pritz <bluewind@xinu.at>
Date:   Tue May 28 20:20:44 2013 +0200

    untaint $pidfile to prevent errors when opening it
    
    For some reason that worked before perl 5.18, but I don't care enough
    to figure out why. Since we trust the CLI args untaining anything
    should be ok.
    
    Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
 spampd | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/spampd.pl b/spampd.pl
index 7b1f234..53161d9 100644
--- a/spampd
+++ b/spampd
@@ -937,6 +937,8 @@ if ( !$options{logsock} ) {
 	};
 }
 
+# untaint pidfile
+($pidfile) = ($pidfile =~ /^(.+)$/);
 
 my $server = bless {
     server => {host => $host,