taint mode and require using "."

Discussion in 'Perl Misc' started by Asterbing, Apr 5, 2006.

  1. Asterbing

    Asterbing Guest

    Considering a script with a line like this :

    require 'config.cgi';

    When I activate the taint mode through "#!/usr/bin/perl -T" and adding
    "use CGI::Carp qw/fatalsToBrowser/;" for the purpose to see tatal errors
    on browser, I'm getting this error "Can't locate config.cgi in @INC".

    According to what I've read, it seems normal since taint mode remove the
    "." from @INC.

    I don't wish to indicate an absolute path which would be to adjust for
    every install on a new server, thus I've just modified the require line
    like this : "require './config.cgi';

    But... When I run the script now I'm just getting a direct perl.exe
    crash without any message !

    How to write this require line with taint mode ?
     
    Asterbing, Apr 5, 2006
    #1
    1. Advertising

  2. Asterbing wrote:
    > Considering a script with a line like this :
    >
    > require 'config.cgi';
    >
    > When I activate the taint mode through "#!/usr/bin/perl -T" and adding
    > "use CGI::Carp qw/fatalsToBrowser/;" for the purpose to see tatal errors
    > on browser, I'm getting this error "Can't locate config.cgi in @INC".
    >
    > According to what I've read, it seems normal since taint mode remove the
    > "." from @INC.


    You can add it:

    use lib '.';

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Apr 5, 2006
    #2
    1. Advertising

  3. Le Wed, 05 Apr 2006 14:51:42 +0200, Gunnar Hjalmarsson a écrit :

    >
    > You can add it:
    >
    > use lib '.';


    Nope, not in taint mode.

    --
    Pluralitas non est ponenda sine necessitate.
    Guillaume d'Ockham.
     
    Emmanuel Florac, Apr 5, 2006
    #3
  4. Emmanuel Florac wrote:
    > Le Wed, 05 Apr 2006 14:51:42 +0200, Gunnar Hjalmarsson a écrit :
    >>
    >>You can add it:
    >>
    >> use lib '.';

    >
    > Nope, not in taint mode.


    C:\home>type test.pl
    use lib '.';
    grep $_ eq '.', @INC and print "Worked fine\n";

    C:\home>perl -T test.pl
    Worked fine

    C:\home>

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Apr 5, 2006
    #4
  5. Le Wed, 05 Apr 2006 22:32:15 +0200, Gunnar Hjalmarsson a écrit :

    >
    > C:\home>perl -T test.pl
    > Worked fine


    Weird, didn't work last time I tried.

    --
    Si ça a l'air facile, c'est difficile. Si ça a l'air difficile, c'est
    carrément impossible. Si ça a l'air impossible, c'est un compilateur
    Ada.
    Théorème de Stockmayer.
     
    Emmanuel Florac, Apr 5, 2006
    #5
  6. Asterbing

    robic0 Guest

    On Wed, 5 Apr 2006 08:47:28 +0200, Asterbing <> wrote:

    >Considering a script with a line like this :
    >
    >require 'config.cgi';
    >
    >When I activate the taint mode through "#!/usr/bin/perl -T" and adding
    >"use CGI::Carp qw/fatalsToBrowser/;" for the purpose to see tatal errors
    >on browser, I'm getting this error "Can't locate config.cgi in @INC".
    >
    >According to what I've read, it seems normal since taint mode remove the
    >"." from @INC.
    >
    >I don't wish to indicate an absolute path which would be to adjust for
    >every install on a new server, thus I've just modified the require line
    >like this : "require './config.cgi';
    >
    >But... When I run the script now I'm just getting a direct perl.exe
    >crash without any message !
    >
    >How to write this require line with taint mode ?

    Whats a taint mode? I hope this is not a word from Perl.
    If it is, then Perl really does suck rancid wet dogshit.
     
    robic0, Apr 6, 2006
    #6
  7. robic0 <> wrote:

    > Whats a taint mode?



    perldoc perlsec


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Apr 6, 2006
    #7
  8. Asterbing

    Joe Smith Guest

    robic0 wrote:

    >> How to write this require line with taint mode ?

    > Whats a taint mode? I hope this is not a word from Perl.
    > If it is, then Perl really does suck rancid wet dogshit.


    And you've never watched a courtroom drama where the
    judge disallows the use of "tainted evidence", right?

    Taint: place under suspicion or cast doubt upon, as
    in unreliable testimony.

    Anyone who does not accept 'taint' as a valid word
    really does suck rancid wet robicshit.
     
    Joe Smith, Apr 10, 2006
    #8
  9. Asterbing

    robic0 Guest

    On Sun, 09 Apr 2006 17:50:44 -0700, Joe Smith <> wrote:

    >robic0 wrote:
    >
    >>> How to write this require line with taint mode ?

    >> Whats a taint mode? I hope this is not a word from Perl.
    >> If it is, then Perl really does suck rancid wet dogshit.

    >
    >And you've never watched a courtroom drama where the
    >judge disallows the use of "tainted evidence", right?
    >
    >Taint: place under suspicion or cast doubt upon, as
    > in unreliable testimony.
    >
    >Anyone who does not accept 'taint' as a valid word
    >really does suck rancid wet robicshit.

    ^^^^^
    blow me scumbag.
     
    robic0, Apr 10, 2006
    #9
  10. Asterbing

    robic0 Guest

    On Thu, 6 Apr 2006 07:47:54 -0500, Tad McClellan <> wrote:

    >robic0 <> wrote:
    >
    >> Whats a taint mode?

    >
    >
    > perldoc perlsec

    taint true, just taint... hehehe
     
    robic0, Apr 10, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johann C. Rocholl

    Taint (like in Perl) as a Python module: taint.py

    Johann C. Rocholl, Feb 5, 2007, in forum: Python
    Replies:
    5
    Views:
    491
    Johann C. Rocholl
    Feb 6, 2007
  2. Louis Erickson
    Replies:
    2
    Views:
    230
    James Willmore
    Sep 3, 2003
  3. Ben
    Replies:
    17
    Views:
    256
  4. Dave Saville

    Find::File and taint mode

    Dave Saville, Nov 18, 2003, in forum: Perl Misc
    Replies:
    5
    Views:
    149
    Ben Morrow
    Nov 18, 2003
  5. kj

    Taint mode and PERL5LIB

    kj, Jun 11, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    355
    Ben Morrow
    Jun 14, 2004
Loading...

Share This Page