Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Newbie Tainted glob question

by DamnDirtyApe (Curate)
on Oct 25, 2001 at 02:30 UTC ( [id://121295]=note: print w/replies, xml ) Need Help??


in reply to Newbie Tainted glob question

I tried running elbie's code with Perl 5.6.1, and I got the following error:

Too late for "-T" option at taint.pl line 1.

I got the same error on Windows and BSD. Can someone please explain what's with this?

_______________
DamnDirtyApe
Home Node | Email

Replies are listed 'Best First'.
Re: Re: Newbie Tainted glob question
by blakem (Monsignor) on Oct 25, 2001 at 02:58 UTC
(elbie): Newbie Tainted glob question
by elbie (Curate) on Oct 25, 2001 at 05:37 UTC
    I suspect that it's not as complicated as all that NT specific stuff blakem mentions, if the problem is happening on BSD as well.

    If you're invoking the script as 'perl taint.pl', then the switches in your hashbang line aren't being executed as early on as they possibly could be.

    Assuming this is the case, you have two options (at least on BSD):

    Invoke it as 'perl -T taint.pl', or make the script executeable and invoke it as './taint.pl'

    Have fun!

    elbieelbieelbie

      Yup, a simple matter of adding the -T to the command line.

      Something struck me as a little odd there, so I played around and discovered that warnings don't follow the same rule -- warnings can be turned on or off from the shebang without appearing on the command line. So, is -w the only option to which this applies?

      (Not that it matters much; I always use use strict; use warnings; use diagnostics;, but I'm curious to know how it works.)

      _______________
      DamnDirtyApe
      Home Node | Email
        You might be able to find the answer in this tpj article (would have linked to the official archive but it always seems to hang in my browser)

        I have to admit that I don't understand it enough to actually answer your question, but the article above ends with:

        And now you know why perl 5.004 has the new warning Too late for -T option. Taint mode isn't effective unless it's done from the very start, i.e. from the real command line. By the time yylex is called, a lot of taint-related things should already have happened, so perl can't guarantee that your data is safe. To avoid this problem, always make -T the first option on the shebang line.
        So, I assume the answer can be found somewhere in there....
        time for me to go read it myself, now.

        -Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found