Larry
2008-10-11 22:01:51 UTC
#!/usr/bin/perl
use strict;
use warnings;
# use IO::Handle '_IONBF';
# use constant BUFSIZE => 1024 * 2;
use CGI;
my $q = new CGI();
$CGI::DISABLE_UPLOADS = 1;
print "content-type: text/plain\n\n";
__END__;
my $io = new IO::Handle;
if ( $io->fdopen(fileno(STDIN),"r") )
{
while($io->read(my $buf, BUFSIZE))
{
}
$io->close;
}
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
claudio 531 0.0 0.0 0 0 ? Z 19:13 0:00 [receiver.cgi]
<defunct>
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.
then, i tried to send the data to the following CGI script:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
my $q = new CGI();
$CGI::DISABLE_UPLOADS = 1;
print "content-type: text/plain\n\n";
__END__;
it just keeps on accetping the data...so i tried ps -ux on the web server
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
claudio 531 0.0 0.0 0 0 ? Z 19:13 0:00 [receiver.cgi]
<defunct>
what is <defunct>?? i tried to kill it, yet i didnt get...thats so
strange!
use strict;
use warnings;
# use IO::Handle '_IONBF';
# use constant BUFSIZE => 1024 * 2;
use CGI;
my $q = new CGI();
$CGI::DISABLE_UPLOADS = 1;
print "content-type: text/plain\n\n";
__END__;
my $io = new IO::Handle;
if ( $io->fdopen(fileno(STDIN),"r") )
{
while($io->read(my $buf, BUFSIZE))
{
}
$io->close;
}
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
claudio 531 0.0 0.0 0 0 ? Z 19:13 0:00 [receiver.cgi]
<defunct>
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.
then, i tried to send the data to the following CGI script:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
my $q = new CGI();
$CGI::DISABLE_UPLOADS = 1;
print "content-type: text/plain\n\n";
__END__;
it just keeps on accetping the data...so i tried ps -ux on the web server
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
claudio 531 0.0 0.0 0 0 ? Z 19:13 0:00 [receiver.cgi]
<defunct>
what is <defunct>?? i tried to kill it, yet i didnt get...thats so
strange!