in reply to Re: Re: Re: (Ovid) Re: A Quest for Taint
in thread A Quest for Taint
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (Ovid) Re: A Quest for Taint
by chipmunk (Parson) on Dec 14, 2000 at 01:31 UTC | |
by coreolyn (Parson) on Dec 14, 2000 at 01:36 UTC |