summaryrefslogtreecommitdiff
path: root/rt/bin
diff options
context:
space:
mode:
authorivan <ivan>2011-04-18 23:49:54 +0000
committerivan <ivan>2011-04-18 23:49:54 +0000
commit01f60974743197ac14e569c16c68a0c2ff3a5bd4 (patch)
tree140ae6bfc2a89a2b635c81859a74eff5587ef71a /rt/bin
parentb5c4237a34aef94976bc343c8d9e138664fc3984 (diff)
commiting rt 3.8.10 to HEAD
Diffstat (limited to 'rt/bin')
-rwxr-xr-xrt/bin/fastcgi_server12
-rwxr-xr-xrt/bin/mason_handler.fcgi11
-rwxr-xr-xrt/bin/mason_handler.scgi12
-rw-r--r--rt/bin/mason_handler.svc11
-rwxr-xr-xrt/bin/rt-mailgate4
-rw-r--r--rt/bin/rt-mailgate.in2
-rwxr-xr-xrt/bin/standalone_httpd2
7 files changed, 50 insertions, 4 deletions
diff --git a/rt/bin/fastcgi_server b/rt/bin/fastcgi_server
index 248267e45..4ccf014da 100755
--- a/rt/bin/fastcgi_server
+++ b/rt/bin/fastcgi_server
@@ -230,6 +230,18 @@ while ( my $cgi = CGI::Fast->new ) {
Module::Refresh->refresh if RT->Config->Get('DevelMode');
RT::ConnectToDatabase();
+ # Each environment has its own way of handling .. and so on in paths,
+ # so RT consistently forbids such paths.
+ if ( $cgi->path_info =~ m{/\.} ) {
+ $RT::Logger->crit("Invalid request for ".$cgi->path_info." aborting");
+ print STDOUT "HTTP/1.0 400\r\n\r\n";
+
+ RT::Interface::Web::Handler->CleanupRequest();
+ $proc_manager->pm_post_dispatch;
+
+ next;
+ }
+
my $interp = $RT::Mason::Handler->interp;
if (
!$interp->comp_exists( $cgi->path_info )
diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi
index 432296be7..996e96076 100755
--- a/rt/bin/mason_handler.fcgi
+++ b/rt/bin/mason_handler.fcgi
@@ -68,6 +68,17 @@ while ( my $cgi = CGI::Fast->new ) {
Module::Refresh->refresh if RT->Config->Get('DevelMode');
RT::ConnectToDatabase();
+ # Each environment has its own way of handling .. and so on in paths,
+ # so RT consistently forbids such paths.
+ if ( $cgi->path_info =~ m{/\.} ) {
+ $RT::Logger->crit("Invalid request for ".$cgi->path_info." aborting");
+ print STDOUT "HTTP/1.0 400\r\n\r\n";
+
+ RT::Interface::Web::Handler->CleanupRequest();
+
+ next;
+ }
+
my $interp = $RT::Mason::Handler->interp;
if (
!$interp->comp_exists( $cgi->path_info )
diff --git a/rt/bin/mason_handler.scgi b/rt/bin/mason_handler.scgi
index 5cbb9a30f..83649edaf 100755
--- a/rt/bin/mason_handler.scgi
+++ b/rt/bin/mason_handler.scgi
@@ -57,6 +57,18 @@ require (dirname(__FILE__) . '/webmux.pl');
require CGI;
my $cgi = CGI->new;
+
+# Each environment has its own way of handling .. and so on in paths,
+# so RT consistently forbids such paths.
+if ( $cgi->path_info =~ m{/\.} ) {
+ $RT::Logger->crit("Invalid request for ".$cgi->path_info." aborting");
+ print STDOUT "HTTP/1.0 400\r\n\r\n";
+
+ RT::Interface::Web::Handler->CleanupRequest();
+
+ return 0;
+}
+
if ( ( !$Handler->interp->comp_exists( $cgi->path_info ) )
&& ( $Handler->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) {
$cgi->path_info( $cgi->path_info . "/index.html" );
diff --git a/rt/bin/mason_handler.svc b/rt/bin/mason_handler.svc
index ceb6cbcd9..6275a9e59 100644
--- a/rt/bin/mason_handler.svc
+++ b/rt/bin/mason_handler.svc
@@ -234,6 +234,17 @@ $Handler ||= RT::Interface::Web::Handler->new(
while( my $cgi = CGI::Fast->new ) {
my $comp = $ENV{'PATH_INFO'};
+ # Each environment has its own way of handling .. and so on in paths,
+ # so RT consistently forbids such paths.
+ if ( $cgi->path_info =~ m{/\.} ) {
+ $RT::Logger->crit("Invalid request for ".$cgi->path_info." aborting");
+ print STDOUT "HTTP/1.0 400\r\n\r\n";
+
+ RT::Interface::Web::Handler->CleanupRequest();
+
+ next;
+ }
+
$comp = $1 if ($comp =~ /^(.*)$/);
my $web_path = RT->Config->Get('WebPath');
$comp =~ s|^\Q$web_path\E\b||i;
diff --git a/rt/bin/rt-mailgate b/rt/bin/rt-mailgate
index 9227a6ee6..de0529d84 100755
--- a/rt/bin/rt-mailgate
+++ b/rt/bin/rt-mailgate
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
@@ -186,7 +186,7 @@ sub write_down_message {
print STDERR "$0: Couldn't create temp file, using memory\n";
print STDERR "error: $@\n" if $@;
- my $message = \do { local (@ARGV, $/); <> };
+ my $message = \do { local (@ARGV, $/); <STDIN> };
unless ( $$message =~ /\S/ ) {
print STDERR "$0: no message passed on STDIN\n";
exit 0;
diff --git a/rt/bin/rt-mailgate.in b/rt/bin/rt-mailgate.in
index 10db6ad1e..a74b2da15 100644
--- a/rt/bin/rt-mailgate.in
+++ b/rt/bin/rt-mailgate.in
@@ -186,7 +186,7 @@ sub write_down_message {
print STDERR "$0: Couldn't create temp file, using memory\n";
print STDERR "error: $@\n" if $@;
- my $message = \do { local (@ARGV, $/); <> };
+ my $message = \do { local (@ARGV, $/); <STDIN> };
unless ( $$message =~ /\S/ ) {
print STDERR "$0: no message passed on STDIN\n";
exit 0;
diff --git a/rt/bin/standalone_httpd b/rt/bin/standalone_httpd
index 9488d0a8b..a307910c1 100755
--- a/rt/bin/standalone_httpd
+++ b/rt/bin/standalone_httpd
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT: