]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/prune_causing_taint_mode_failures.mdwn
File issue.
[ikiwiki.git] / doc / bugs / prune_causing_taint_mode_failures.mdwn
1 Using ikiwiki version 2.5gpa1 (the backport to Debian 3.1), I suddenly started getting the following error when rebuilding the wiki:
2
3 <pre>
4 successfully generated /home/ikiwiki/cgi-bin/ikiwiki.cgi
5 Insecure dependency in rmdir while running with -T switch at /usr/share/perl5/IkiWiki/Render.pm line 242.
6 BEGIN failed--compilation aborted at (eval 5) line 130.
7 </pre>
8
9 I've no idea what's happening (hey, I'm a C programmer), but I've hacked prune() to workaround this as follows:
10
11 <pre>
12 use Scalar::Util qw(tainted);
13
14 sub prune ($) {
15         my $file=shift;
16
17         unlink($file);
18         my $dir=dirname($file);
19         if (!tainted($file) && $dir =~ /^(.*)$/) {
20                 $dir = $1;
21         }
22         while (rmdir($dir)) {
23                 $dir=dirname($dir);
24                 if (!tainted($file) && $dir =~ /^(.*)$/) {
25                         $dir = $1;
26                 }
27         }
28 }
29 </pre>
30
31 > Old versions of perl are known to have bugs with taint checking.
32 > I don't really support using ikiwiki with the perl 5.8.4 in debian
33 > oldstable, and would recommend upgrading. --[[Joey]]
34
35 [[!tag patch done]]