What part of perldoc perlsec am I missing?
I get this error:
Insecure dependency in chdir while running
with -T switch at ./simple line 21.
With this code:
#!/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');
}
email: mandog
Edited 2002-01-02 by dvergin adding paren per user request
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.