[Rt-commit] r7598 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Sat Apr 21 11:42:21 EDT 2007
Author: ruz
Date: Sat Apr 21 11:41:56 2007
New Revision: 7598
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
Log:
r5040 at cubic-pc: cubic | 2007-04-21 17:27:45 +0400
* defaulting signal handler of SIG_CHLD must be on the same level as waitpid
or we'll get wrong exit code
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm Sat Apr 21 11:41:56 2007
@@ -66,7 +66,6 @@
$stderr->fdopen( 2, 'w' );
local *STDERR = $stderr;
- local $SIG{'CHLD'} = 'DEFAULT';
local @ENV{'LANG', 'LC_ALL'} = ('C', 'C');
shift->();
}
@@ -123,6 +122,7 @@
$gnupg->passphrase( $args{'Passphrase'} );
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $pid = _safe_run_child { $gnupg->detach_sign( handles => $handles ) };
$entity->make_multipart( 'mixed', Force => 1 );
$entity->parts(0)->print( $handle{'input'} );
@@ -181,6 +181,7 @@
$gnupg->passphrase( $args{'Passphrase'} ) if $args{'Sign'};
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $pid = _safe_run_child { $args{'Sign'}
? $gnupg->sign_and_encrypt( handles => $handles )
: $gnupg->encrypt( handles => $handles ) };
@@ -401,6 +402,7 @@
my %res;
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $pid = _safe_run_child { $gnupg->verify( handles => $handles ) };
$args{'Data'}->bodyhandle->print( $handle{'input'} );
close $handle{'input'};
@@ -449,6 +451,7 @@
my %res;
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $pid = _safe_run_child { $gnupg->verify( handles => $handles, command_args => [ '-', $tmp_fn ] ) };
$args{'Signature'}->bodyhandle->print( $handle{'input'} );
close $handle{'input'};
@@ -497,6 +500,7 @@
my %res;
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $pid = _safe_run_child { $gnupg->verify( handles => $handles, command_args => [ '-', $tmp_fn ] ) };
$args{'Signature'}->bodyhandle->print( $handle{'input'} );
close $handle{'input'};
@@ -553,6 +557,7 @@
my %res;
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
$gnupg->passphrase( $args{'Passphrase'} );
my $pid = _safe_run_child { $gnupg->decrypt( handles => $handles ) };
$args{'Data'}->bodyhandle->print( $handle{'input'} );
@@ -619,6 +624,7 @@
my %res;
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
$gnupg->passphrase( $args{'Passphrase'} );
my $pid = _safe_run_child { $gnupg->decrypt( handles => $handles ) };
$args{'Data'}->bodyhandle->print( $handle{'input'} );
@@ -1054,6 +1060,7 @@
);
eval {
+ local $SIG{'CHLD'} = 'DEFAULT';
my $method = $type eq 'private'? 'list_secret_keys': 'list_public_keys';
my $pid = _safe_run_child { $gnupg->$method( handles => $handles, command_args => [ $email ] ) };
waitpid $pid, 0;
More information about the Rt-commit
mailing list