X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fbin%2Fmason_handler.fcgi.in;h=52dddd3d3c8a0a34d651c2a9b6a5b380a5e4f5bf;hp=e932bfc2922f2bdd77d891638c3f52b650189546;hb=c582e92888b4a5553e1b4e5214cf35217e4a0cf0;hpb=945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd diff --git a/rt/bin/mason_handler.fcgi.in b/rt/bin/mason_handler.fcgi.in index e932bfc29..52dddd3d3 100644 --- a/rt/bin/mason_handler.fcgi.in +++ b/rt/bin/mason_handler.fcgi.in @@ -27,14 +27,15 @@ use strict; use File::Basename; require ('@RT_BIN_PATH@/webmux.pl'); -my $h = &RT::Interface::Web::NewCGIHandler(); +my $h = &RT::Interface::Web::NewCGIHandler(@RT::MasonParameters); # Enter CGI::Fast mode, which should also work as a vanilla CGI script. require CGI::Fast; RT::Init(); +RT::DropSetGIDPermissions(); + -# Response loop while ( my $cgi = CGI::Fast->new ) { # the whole point of fastcgi requires the env to get reset here.. # So we must squash it again @@ -44,11 +45,25 @@ while ( my $cgi = CGI::Fast->new ) { $ENV{'ENV'} = '' if defined $ENV{'ENV'}; $ENV{'IFS'} = '' if defined $ENV{'IFS'}; - unless ($h->interp->comp_exists($cgi->path_info)) { - $cgi->path_info($cgi->path_info . "/index.html"); + RT::ConnectToDatabase(); + + if ( ( !$h->interp->comp_exists( $cgi->path_info ) ) + && ( $h->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) { + $cgi->path_info( $cgi->path_info . "/index.html" ); } - $h->handle_cgi_object($cgi); - # _should_ always be tied + + eval { $h->handle_cgi_object($cgi); }; + if ($@) { + $RT::Logger->crit($@); + } + + + if ($RT::Handle->TransactionDepth) { + $RT::Handle->ForceRollback; + $RT::Logger->crit("Transaction not committed. Usually indicates a software fault. Data loss may have occurred") ; + } + + } 1;