web commit by ali: Reporting bug with prune and taint mode

master
joey 2007-08-21 06:19:13 +00:00
parent 17c0deafcd
commit b1fecf16da
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
Using ikiwiki version 2.5gpa1 (the backport to Debian 3.1), I suddenly started getting the following error when rebuilding the wiki:
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.
I've no idea what's happening (hey, I'm a C programmer), but I've hacked prune() to workaround this as follows:
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;
}
}
} #}}}