in reply to Re: use re 'taint' with s/// operator
in thread use re 'taint' with s/// operator
where $path = '/path/to/a///file/with///few//args'; and is tainted.sub get_file_and_args { my ($path, ) = @_; my (@info, ); while (1) { last if ((@info = stat ($path))); last if ($path !~ s{^(/.+)(/+.*)}{$1}); push (@args, $2); } return ($path, \@args); }
Later on I want to force checking both $path and @args values (by tainting them) because I cant really be sure who and how is using them. Im not discussing if the same result can be achieved in any other 'better' or elegant way because the answer is 'yes, of course!' - I just want to show that there might be a reason "to replace bits of a tainted string with other bits and continue to consider it tainted".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: use re 'taint' with s/// operator
by BrowserUk (Patriarch) on Nov 19, 2010 at 15:07 UTC |