Gossamer Forum
Home : General : Perl Programming :

cant load module in taint mode

Quote Reply
cant load module in taint mode
hey, i have a website where the login system and html template are loaded through modules.
it works fine for most of except one file that (i think) needs to b in taint mode. it uses a agent to fetch info from another website. i dont want to remove the -Tw because i aint to sure if its safe to do so. however when i run this page it says it cant find the module.
thanks
Pedge

Code:

#!/usr/bin/perl -Tw
package both;
use CGI;
use DBI;
use POSIX qw/strftime/;
use strict;
use CGI::Carp qw(fatalsToBrowser);
use LWP::UserAgent; # this loads the LWP module (used to retrieve a web page)
require check_session; #FAILS
require html; #FAILS
Error:
Can't locate check_session.pm in @INC (@INC contains: /usr/lib/perl5/
5.8.3/i386-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5
.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread
-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/
site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5
/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3
/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread
-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/
perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/
5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /
usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl)
at news.cgi line 11.

Quote Reply
Re: [pedge] cant load module in taint mode In reply to
Hi. Have you tried specifying a 'lib' folder?

Something like this may work;

Code:
use lib './';

...or you may have to use;

Code:
use lib '/full/path/to/your/folder';

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [pedge] cant load module in taint mode In reply to
You need a use lib '/path/to/check_session'; in there above your require check_session; with taint mode on. Taint mode removes the . from @INC.

~Charlie
Quote Reply
Re: [Chaz] cant load module in taint mode In reply to
thanks. that worked.
Quote Reply
Re: [Chaz] cant load module in taint mode In reply to
In Reply To:
You need a use lib '/path/to/check_session'; in there above your require check_session; with taint mode on. Taint mode removes the . from @INC.

Ah, I was right then =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] cant load module in taint mode In reply to
Sorry Andy, I guess we were posting at the same time. I didn't even see your post there :)
Quote Reply
Re: [Chaz] cant load module in taint mode In reply to
No prob =)

I sometimes do that. Open up, ready to reply, and then get caught up in something else. You then go back later, and make the post... to find out that someone posted the same answer/different answer several minutes before you Blush

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!