[Rt-commit] r14007 - rt/3.8/branches/3.8.0-releng/lib/RT/Crypt

jesse at bestpractical.com jesse at bestpractical.com
Fri Jul 11 11:24:20 EDT 2008


Author: jesse
Date: Fri Jul 11 11:24:09 2008
New Revision: 14007

Modified:
   rt/3.8/branches/3.8.0-releng/lib/RT/Crypt/GnuPG.pm

Log:
 r39574 at 68-246-144-190 (orig r13978):  ruz | 2008-07-10 19:42:46 -0400
 * fix GPG probe function


Modified: rt/3.8/branches/3.8.0-releng/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/3.8/branches/3.8.0-releng/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/3.8/branches/3.8.0-releng/lib/RT/Crypt/GnuPG.pm	Fri Jul 11 11:24:09 2008
@@ -2312,12 +2312,25 @@
 
     eval {
         local $SIG{'CHLD'} = 'DEFAULT';
-        my $pid = safe_run_child { $gnupg->version( handles => $handles ) };
+        my $pid = safe_run_child { $gnupg->wrap_call( commands => ['--version' ], handles => $handles ) };
         close $handle{'stdin'};
         waitpid $pid, 0;
     };
-    return 0 if $@;
-    return 0 if $?;
+    if ( $@ ) {
+        $RT::Logger->debug(
+            "Probe for GPG failed."
+            ." Couldn't run `gpg --version`: ". $@
+        );
+        return 0;
+    }
+    if ( $? ) {
+        $RT::Logger->debug(
+            "Probe for GPG failed."
+            ." Process exitted with code ". ($? >> 8)
+            . ($? & 127 ? (" as recieved signal ". ($? & 127)) : '')
+        );
+        return 0;
+    }
     return 1;
 }
 


More information about the Rt-commit mailing list