[Purdue-pm] Problem with she-bang and PERL5OPT
Rick Westerman
westerman at purdue.edu
Thu Nov 20 19:33:11 PST 2014
> If someone has a suggestion on how to run individual web programs using taint I am all ears.
One suggestion that I did come across is to create a ‘taintperl’ program. I may ask Doug to do that. Or, as I said, I am open to votes on if to turn on taint for all of our web programs. Good idea? Or bad since it may cause massive program failures?
--
Rick Westerman
westerman at purdue.edu
> On Nov 20, 2014, at 9:04 PM, Mark Senn <mark at ecn.purdue.edu> wrote:
>
> Rick Westerman <westerman at purdue.edu> wrote on 2014-11-20 at 14:52
> From all I have read the following program should work:
> | #!/bin/env PERL5OPT=-T perl
> |
> | warn 'Taint mode is '.(${^TAINT} ? 'on' : 'off');
> |
> | # End
> |
> | But when I run it, at least on the RCAC and on the Genomics systems, the
> | program just hangs. Take away PERL5OPT and it works. Put in '-w'
> | instead of '-T' and it fails in the same manner. Quoting does not seem
> | to matter. Just running from the command line:
> |
> | /bin/env PERL5OPT=-T perl program.file
> |
> | Works fine.
> |
> | I am mystified. Anyone have an idea?
>
> From
> http://stackoverflow.com/questions/2528959/how-do-i-set-the-taint-mode-in-a-perl-script-with-a-usr-bin-env-perl-sheba
>
> You cannot actually specify a variable in a shebang with
> /usr/bin/env. Doing so will cause env to execve itself in an infinite
> loop, never even getting to the command requested. I tested this against
> both Linux and FreeBSD. – Zed
>
>
> Rick, I got the sme results with these scripts that you got with yours
> #!/bin/env /bin/cat
> hello there
> and
> #!/bin/env TEMPVAR=hello /bin/cat
> hello there
> (I wanted to try it with something simpler than perl.)
>
> -mark
More information about the Purdue-pm
mailing list