mandog has asked for the wisdom of the Perl Monks concerning the following question:
I get this error:
With this code:Insecure dependency in chdir while running with -T switch at ./simple line 21.
email: mandog#!/usr/local/bin/perl -Tw use strict; my $sites_root='/home/sites'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; opendir(DH,$sites_root) or die "1: $!\n"; my @sites=readdir(DH)or die "2: $!\n"; closedir(DH) or die "3: $!\n"; chdir($sites_root); foreach my $site (@sites){ next if ($site eq '.') or ($site eq '..') or (not (-d "$sites_root/$site")); $site=~s/[^-\@\w\/]//; my $dir="$sites_root/$site"; chdir($dir) or die "couldn't chdir to $dir : $!\n"; #tmp debug statment system('/bin/pwd'); }
Edited 2002-01-02 by dvergin adding paren per user request
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: -T taint mode & chdir
by Juerd (Abbot) on Jan 02, 2002 at 00:42 UTC |