Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Pod::Usage and Taint Mode

by ghenry (Vicar)
on May 26, 2006 at 10:46 UTC ( [id://551815]=perlquestion: print w/replies, xml ) Need Help??

ghenry has asked for the wisdom of the Perl Monks concerning the following question:

Dear all,

Has anyone done a workaround or similar when using Pod::Usage and Taint Mode, with the --man option?

I keep getting on Linux (Fedora Core 5, perl 5.8.8):

Insecure dependency in system while running with -T switch at /usr/lib +/perl5/5.8.8/Pod/Usage.pm line 547.
Script code has:
pod2usage( -verbose => 2 ) if $options{man};
and offending Pod::Usage code is:
539 ## Now translate the pod document and then exit with the desir +ed status 540 if ( !$opts{"-noperldoc"} 541 and $opts{"-verbose"} >= 2 542 and !ref($opts{"-input"}) 543 and $opts{"-output"} == \*STDOUT ) 544 { 545 ## spit out the entire PODs. Might as well invoke perldoc 546 my $progpath = File::Spec->catfile($Config{scriptdir}, "per +ldoc"); 547 system($progpath, $opts{"-input"}); 548 } 549 else { 550 $parser->parse_from_file($opts{"-input"}, $opts{"-output"}) +; 551 } 552 553

Thanks,
Gavin.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

Replies are listed 'Best First'.
Re: Pod::Usage and Taint Mode
by herveus (Prior) on May 26, 2006 at 11:19 UTC
    Howdy!

    Off the top of my head, I'd suspect $ENV{PATH} as the offending item. I'd try setting $ENV{PATH} (possibly to '' unless you need it elsewhere) to some fixed value to untaint it.

    yours,
    Michael

      Nah, that's already been done ;-)

      Here are some quick read links:
      Pod docs
      Syntax highlighted HTML

      For reference, here is the complete program:

      The --man option is the only thing left to fix.

      Thanks,
      Gavin.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!

        > The --man option is the only thing left to fix.

        Excuse me for reviving the thread but I had the same problem today and found a working solution elsewhere on the web that I would like to appear here:

        pod2usage({-verbose => 2, -input => \*DATA});

        or, if called inside a package

        pod2usage({-verbose => 2, -input => \*::DATA});
Re: Pod::Usage and Taint Mode (%opts)
by tye (Sage) on May 26, 2006 at 14:42 UTC

    I'd guess you need to untaint $opts{"-input"} before passing it to system.

    - tye        

Re: Pod::Usage and Taint Mode
by Anonymous Monk on Oct 30, 2011 at 14:41 UTC

    Late update: CPAN#29978 covers this, and it is fixed since 1.36.

    Ob-mention: The CHANGES file also says the package is dead, but I didn't see reference to a replacement for the (very handy) pod2usage

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://551815]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-18 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found