diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-06-01 17:15:27 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-01 17:15:27 -0700 |
| commit | cbb4c260c40779ba84c794dd68147c54f3de2f52 (patch) | |
| tree | 2be7909d11386d157240b48ac4ce5ff878adfa1f /rt/bin | |
| parent | d4617c6565d5fc6bafe14d11c19646b0674ae73d (diff) | |
RT 3.8.13
Diffstat (limited to 'rt/bin')
| -rwxr-xr-x | rt/bin/rt-mailgate | 4 | ||||
| -rw-r--r-- | rt/bin/rt-mailgate.in | 4 | ||||
| -rw-r--r-- | rt/bin/webmux.pl.in | 27 |
3 files changed, 16 insertions, 19 deletions
diff --git a/rt/bin/rt-mailgate b/rt/bin/rt-mailgate index de0529d84..373d2cfbf 100755 --- a/rt/bin/rt-mailgate +++ b/rt/bin/rt-mailgate @@ -81,9 +81,7 @@ unless ( $opts{'url'} ) { my $ua = new LWP::UserAgent; $ua->cookie_jar( { file => $opts{'jar'} } ) if $opts{'jar'}; -my %args = ( - SessionType => 'REST', # Surpress login box -); +my %args; foreach ( qw(queue action) ) { $args{$_} = $opts{$_} if defined $opts{$_}; }; diff --git a/rt/bin/rt-mailgate.in b/rt/bin/rt-mailgate.in index a74b2da15..1e231152f 100644 --- a/rt/bin/rt-mailgate.in +++ b/rt/bin/rt-mailgate.in @@ -81,9 +81,7 @@ unless ( $opts{'url'} ) { my $ua = new LWP::UserAgent; $ua->cookie_jar( { file => $opts{'jar'} } ) if $opts{'jar'}; -my %args = ( - SessionType => 'REST', # Surpress login box -); +my %args; foreach ( qw(queue action) ) { $args{$_} = $opts{$_} if defined $opts{$_}; }; diff --git a/rt/bin/webmux.pl.in b/rt/bin/webmux.pl.in index 7aae041b3..296f64917 100644 --- a/rt/bin/webmux.pl.in +++ b/rt/bin/webmux.pl.in @@ -60,24 +60,25 @@ package RT::Mason; our ($Nobody, $SystemUser, $Handler, $r); -my $protect_fd; +my $protect_fds; sub handler { ($r) = @_; - if ( !$protect_fd && $ENV{'MOD_PERL'} && exists $ENV{'MOD_PERL_API_VERSION'} - && $ENV{'MOD_PERL_API_VERSION'} >= 2 && fileno(STDOUT) != 1 + if ( !$protect_fds && $ENV{'MOD_PERL'} && exists $ENV{'MOD_PERL_API_VERSION'} + && $ENV{'MOD_PERL_API_VERSION'} >= 2 ) { - # under mod_perl2, STDOUT gets closed and re-opened, however new STDOUT - # is not on FD #1. In this case next IO operation will occupy this FD - # and make all system() and open "|-" dangerouse, for example DBI - # can get this FD for DB connection and system() call will close - # by putting grabage into the socket - open( $protect_fd, '>', '/dev/null' ) - or die "Couldn't open /dev/null: $!"; - unless ( fileno($protect_fd) == 1 ) { - warn "We opened /dev/null to protect FD #1, but descriptor #1 is already occupied"; - } + # under mod_perl2, STDIN and STDOUT get closed and re-opened, + # however they are not on FD 0 and 1. In this case, the next + # socket that gets opened will occupy one of these FDs, and make + # all system() and open "|-" calls dangerous; for example, the + # DBI handle can get this FD, which later system() calls will + # close by putting garbage into the socket. + $protect_fds = []; + push @{$protect_fds}, IO::Handle->new_from_fd(0, "r") + if fileno(STDIN) != 0; + push @{$protect_fds}, IO::Handle->new_from_fd(1, "w") + if fileno(STDOUT) != 1; } local $SIG{__WARN__}; |
