[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Insecure $ENV{PATH} while running with -T at Mail/Mailer/sendmail.pm
From:       Stas Bekman <stas () stason ! org>
Date:       2004-04-30 18:39:18
Message-ID: 40929D56.7070607 () stason ! org
[Download RAW message or body]

Alexander.Farber@nokia.com wrote:
[...]
> I've workarounded my problem by moving the line 
> 
>         $ENV{PATH} = '/bin:/usr/bin:/usr/lib';
> 
> from the BEGIN block into the handler sub, right before I call
> 
>         my $sendmail = Mail::Mailer->new();
>         $sendmail->open(....);
> 
> So it looks to me, that it's a problem of mod_perl 
> or maybe of the Apache::StatINC

Not mod_perl's problem, but some piece of code that messes with $ENV{PATH}. 
All mod_perl is doing is setting -T. You didn't answer this question:

"could it be that Mail::Mailer redefines $ENV{PATH} in its code? check what's 
the value that you get before you call the code that fails."

The fact that setting it in the handler solves the problem, suggests that 
either the BEGIN block is not being run (add a warn "BEGIN is running" to 
test) or something resets that env var.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic