aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/prune_causing_taint_mode_failures.mdwn
blob: cccb32ac7b7d712f7d1551ee692e01d9c282ff14 (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
29
30
31
32
33
Using ikiwiki version 2.5gpa1 (the backport to Debian 3.1), I suddenly started getting the following error when rebuilding the wiki:

<pre>
successfully generated /home/ikiwiki/cgi-bin/ikiwiki.cgi
Insecure dependency in rmdir while running with -T switch at /usr/share/perl5/IkiWiki/Render.pm line 242.
BEGIN failed--compilation aborted at (eval 5) line 130.
</pre>

I've no idea what's happening (hey, I'm a C programmer), but I've hacked prune() to workaround this as follows:

<pre>
use Scalar::Util qw(tainted);

sub prune ($) { #{{{
        my $file=shift;

        unlink($file);
        my $dir=dirname($file);
        if (!tainted($file) && $dir =~ /^(.*)$/) {
                $dir = $1;
        }
        while (rmdir($dir)) {
                $dir=dirname($dir);
                if (!tainted($file) && $dir =~ /^(.*)$/) {
                        $dir = $1;
                }
        }
} #}}}
</pre>

> Old versions of perl are known to have bugs with taint checking.
> I don't really support using ikiwiki with the perl 5.8.4 in debian
> oldstable, and would recommend upgrading. --[[Joey]]