Because you can't run a regex against the variable to untaint the value until execution time.
Maybe I can give a better explanation of what's going on here:
The overall application has an Environment variable pointing to the root of a filesystem/application tree. Lets call it good ol $ENV{FOO}. So far so good, but the perl script needs to pull in a library that is relative to $ENV{FOO}. Let's call that "/bar/lib". There is no way under perl -T that I can call 'use lib "$ENV{FOO}/bar/lib"' because I cannot clear the taint from $ENV{FOO} at compile time.
Hmmm too much english here's some code:
#! /usr/bin/perl -T $DEZVAR = $ENV{CRROOTWSDIR}; if ($CRROOTWSDIR =~ /^([-\/\w.]+)$/) #Can't evaluate this { #until execution $MAINPATH = $1 } else { die "Invalid path, please check setenv"; } $LIB = "$MAINPATH/cr/cds/comms/x2p"; use lib $LIB; #Must be available at compiletime blah; blah; blah;
In reply to Re: (Ovid) Re: A Quest for Taint
by coreolyn
in thread A Quest for Taint
by andye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |