Subject: | Insecure dependency in chdir while running with -T switch at /usr/lib/perl5/site_perl/5.6.1/Archive/Zip.pm line 1089. |
if perl is running in -T mode you will get the error Message:
Insecure dependency in chdir while running with -T switch at /usr/lib/perl5/site_perl/5.6.1/Archive/Zip.pm line 1089.
when using addTree or a simillar one when using modifyTree. thats because chdir checks for tainted Data and the return of cwd() is marked tainted.
If you untaint this data the next problem is File::Find which will get you a simillar Error unless you use the untaint option from it.
I added a small patch that gets Archive Zip runing in Taint mode (only tested with 5.6.1 and 5.8.0).
diff B C:\Dokumente und Einstellungen\5096\Desktop\Archive.pm C:\Dokumente und Einstellungen\5096\Desktop\Archive_Zip.pm
1082c1082,1083
< my $startDir = cwd();
---
> my $startDir = &untaintDir(cwd());
>
1094c1095
< File::Find::find( $wanted, $root );
---
> File::Find::find( {wanted=>$wanted,untaint=>1}, $root );
1251c1252
< my $startDir = cwd();
---
> my $startDir = &untaintDir(cwd());
1264c1265
< File::Find::find( $wanted, $root );
---
> File::Find::find( {wanted=>$wanted,untaint=>1}, $root );
1298a1300,1307
> }
>
> sub untaintDir
> {
> my $dir=shift;
> $dir=~/([\.\/\w\-])/;
> $dir=$1;
> return $dir;