CGI perl with -T

Help...
I am trying to use sendmail in a CGI script. When I use the OPEN command
(open sMail, "| /usr/lib/sendmail -oi -t -odq";)
I get the error (Insecure $ENV{PATH} while running with -T switch)
I don't want to disable the -T switch but I need to be able to call
sendmail.

Any Ideas?

Thanks
George [ Fr, 24 August 2007 02:48 ] [ ID #1804410 ]

Re: CGI perl with -T

George wrote:
> I am trying to use sendmail in a CGI script. When I use the OPEN command
> (open sMail, "| /usr/lib/sendmail -oi -t -odq";)
> I get the error (Insecure $ENV{PATH} while running with -T switch)
> I don't want to disable the -T switch but I need to be able to call
> sendmail.

Set $ENV{PATH} explicitly.

$ENV{PATH} = '';

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Gunnar Hjalmarsson [ Fr, 24 August 2007 02:58 ] [ ID #1804411 ]

Re: CGI perl with -T

Gunnar Hjalmarsson wrote:
> George wrote:
>> I am trying to use sendmail in a CGI script. When I use the OPEN
>> command (open sMail, "| /usr/lib/sendmail -oi -t -odq";)
>> I get the error (Insecure $ENV{PATH} while running with -T switch)
>> I don't want to disable the -T switch but I need to be able to call
>> sendmail.
>
> Set $ENV{PATH} explicitly.
>
> $ENV{PATH} = '';
>
Perfect!, That worked well.

Thanks
George [ Fr, 24 August 2007 03:15 ] [ ID #1804412 ]
Perl » alt.perl » CGI perl with -T

Vorheriges Thema: Http Response code
Nächstes Thema: website booking application form