Detecting taint mode

Andy Armstrong andy at hexten.net
Sun Feb 25 20:55:37 GMT 2007


On 25 Feb 2007, at 20:34, David Cantrell wrote:
> Anyone got a nifty way of detecting whether you're running in taint- 
> mode
> which doesn't rely on ${^TAINT}?  Cos that magic variable ain't
> available in 5.6.2.

Looks evil but presumably works:

sub is_tainted2 { local $^W = 0; local $@; eval { kill 0 * $_[0] };  
$@ =~ /^Insecure/ }

From:

http://search.cpan.org/src/RHANDOM/Taint-Runtime-0.02/lib/Taint/ 
Runtime.pm


-- 
Andy Armstrong, hexten.net



More information about the london.pm mailing list