Potassium
09-20-2005, 06:48 AM
Hi All,
I'm currently writing a simple Perl form processor (how unusual) and, for obvious reasons (the form does open a pipe to send some mail), I use the -T switch. Now, on the virtual server I'm currently working on, with the -T switch, Perl will simply refuse to send *anything* through the pipe - even without any tainted data around. Without -T, it runs just fine. Check the code:
#!/usr/local/bin/perl -Tw
print "Content-type: text/html\n\n";
print "Send an email<br>\n";
open (MAIL,'| /usr/sbin/sendmail -t');
print MAIL <<END;
To: blue\@someisp.com
From: info\@someisp.com
Subject: nothing much
Hi there! Tainted switch test: on.
END
close MAIL;
print "Email sent.<br>\n";
exit;
Any idea why this really basic script fails with -T on? Is this situation indicative of smthg wrong with the server setup, or did I screw up somewhere else without noticing? I'm working on a server running FreeBSD 5.3 with Perl 5.008005 installed, and I feel like banging my head in the wall.
Thanks in advance for your help!
I'm currently writing a simple Perl form processor (how unusual) and, for obvious reasons (the form does open a pipe to send some mail), I use the -T switch. Now, on the virtual server I'm currently working on, with the -T switch, Perl will simply refuse to send *anything* through the pipe - even without any tainted data around. Without -T, it runs just fine. Check the code:
#!/usr/local/bin/perl -Tw
print "Content-type: text/html\n\n";
print "Send an email<br>\n";
open (MAIL,'| /usr/sbin/sendmail -t');
print MAIL <<END;
To: blue\@someisp.com
From: info\@someisp.com
Subject: nothing much
Hi there! Tainted switch test: on.
END
close MAIL;
print "Email sent.<br>\n";
exit;
Any idea why this really basic script fails with -T on? Is this situation indicative of smthg wrong with the server setup, or did I screw up somewhere else without noticing? I'm working on a server running FreeBSD 5.3 with Perl 5.008005 installed, and I feel like banging my head in the wall.
Thanks in advance for your help!