L
Larry
Hi,
i have a script running on a web server (Apache) that accepts data
from STDIN and saves it:
#!/perl
use IO::Handle '_IONBF';
use constant BUFSIZE => 1024 * 2;
my $io = new IO::Handle;
if ( $io->fdopen(fileno(STDIN),"r") )
{
while($io->read($buf, BUFSIZE))
{
# ... save $buf ...
}
$io->close;
}
__END__;
I decided to check out if a user can upload to this script or else my
web server would screw up. So I put this on top of my script:
if ($ENV{"HTTP_USER_PASS"} ne 'mypassword')
{
close STDIN;
exit;
}
then I sent a couple of MBs of data thru http without the USER_PASS
header, i was struck by my finding out the script sort of died but I was
still sending raw data to the script...I though close STDIN would drop
the connection, too bad it didn't...how can I sort this out?
thanks
i have a script running on a web server (Apache) that accepts data
from STDIN and saves it:
#!/perl
use IO::Handle '_IONBF';
use constant BUFSIZE => 1024 * 2;
my $io = new IO::Handle;
if ( $io->fdopen(fileno(STDIN),"r") )
{
while($io->read($buf, BUFSIZE))
{
# ... save $buf ...
}
$io->close;
}
__END__;
I decided to check out if a user can upload to this script or else my
web server would screw up. So I put this on top of my script:
if ($ENV{"HTTP_USER_PASS"} ne 'mypassword')
{
close STDIN;
exit;
}
then I sent a couple of MBs of data thru http without the USER_PASS
header, i was struck by my finding out the script sort of died but I was
still sending raw data to the script...I though close STDIN would drop
the connection, too bad it didn't...how can I sort this out?
thanks