web commit by ali: Reporting bug with prune and taint mode
[ikiwiki] / 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 successfully generated /home/ikiwiki/cgi-bin/ikiwiki.cgi
4 Insecure dependency in rmdir while running with -T switch at /usr/share/perl5/IkiWiki/Render.pm line 242.
5 BEGIN failed--compilation aborted at (eval 5) line 130.
6
7 I've no idea what's happening (hey, I'm a C programmer), but I've hacked prune() to workaround this as follows:
8
9 use Scalar::Util qw(tainted);
10
11 sub prune ($) { #{{{
12         my $file=shift;
13
14         unlink($file);
15         my $dir=dirname($file);
16         if (!tainted($file) && $dir =~ /^(.*)$/) {
17                 $dir = $1;
18         }
19         while (rmdir($dir)) {
20                 $dir=dirname($dir);
21                 if (!tainted($file) && $dir =~ /^(.*)$/) {
22                         $dir = $1;
23                 }
24         }
25 } #}}}