Stenyj has asked for the wisdom of the Perl Monks concerning the following question:
The value of $subdomain is 'sub-one'$subdomain = untaint($subdomain); $destFolder = untaint($destFolder); my $dir1 = "/home/siteName/templates/tmpl"; my $dir2 = "/home/siteName/public_html/$subdomain/$destFolder/ +tmpl"; my @list = <$dir1/*.*>; foreach(@list) { copy("$_","$dir2/") or die "FAIL :$! \n"; } sub untaint { my $var = $_[0]; my ($untained_file) = $var =~ /^(\w+)$/ or die "bad filename: $var +"; return $untained_file; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Plz help w/ taint issue while copying dir contents
by PodMaster (Abbot) on Apr 12, 2005 at 04:13 UTC | |
by polettix (Vicar) on Apr 12, 2005 at 09:37 UTC | |
by PodMaster (Abbot) on Apr 12, 2005 at 10:02 UTC | |
by polettix (Vicar) on Apr 12, 2005 at 10:20 UTC | |
|
Re: Plz help w/ taint issue while copying dir contents
by tlm (Prior) on Apr 12, 2005 at 03:14 UTC | |
by Stenyj (Beadle) on Apr 12, 2005 at 03:27 UTC | |
by tlm (Prior) on Apr 12, 2005 at 03:41 UTC | |
|
Re: Plz help w/ taint issue while copying dir contents
by chanio (Priest) on Apr 13, 2005 at 03:19 UTC |