[Rt-commit] r13978 - rt/3.8/trunk/lib/RT/Crypt

ruz at bestpractical.com ruz at bestpractical.com
Thu Jul 10 19:42:47 EDT 2008


Author: ruz
Date: Thu Jul 10 19:42:46 2008
New Revision: 13978

Modified:
   rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm

Log:
* fix GPG probe function

Modified: rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	Thu Jul 10 19:42:46 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