[Rt-commit] rt branch, 4.2/smime-gnupg-on-fastcgi, created. rt-4.2.0-15-g40f489d
Alex Vandiver
alexmv at bestpractical.com
Thu Oct 3 19:06:17 EDT 2013
The branch, 4.2/smime-gnupg-on-fastcgi has been created
at 40f489d7f2f1607df3b4f26b556e04b1b35e0da7 (commit)
- Log -----------------------------------------------------------------
commit c62970b5b6d9e6f3f0303d9d7a54f9bf3883b6ba
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Oct 2 12:14:35 2013 -0400
Set RejectOnUnencrypted explicitly, for fastcgi tests
Fiddling the config at runtime does not propagate to the
RT_SiteConfig.pm file on disk, which is what the fastcgi tests use.
Using the explicit config argument to the test module properly
configures the Crypt setting in the fastcgi child.
diff --git a/t/mail/smime/reject_on_unencrypted.t b/t/mail/smime/reject_on_unencrypted.t
index 8987a7d..f8d61ad 100644
--- a/t/mail/smime/reject_on_unencrypted.t
+++ b/t/mail/smime/reject_on_unencrypted.t
@@ -1,15 +1,13 @@
use strict;
use warnings;
-use RT::Test::SMIME tests => undef;
+use RT::Test::SMIME tests => undef, config => 'Set( %Crypt, RejectOnUnencrypted => 1 );';
my $test = 'RT::Test::SMIME';
use IPC::Run3 'run3';
use String::ShellQuote 'shell_quote';
use RT::Tickets;
-RT->Config->Get('Crypt')->{'RejectOnUnencrypted'} = 1;
-
my ($url, $m) = RT::Test->started_ok;
ok $m->login, "logged in";
commit d89e28cf61e70f70c2eae6527d6b2263e2b0a779
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Oct 2 15:45:50 2013 -0400
Include the $PATH in the GnuPG/SMIME error message, and suggest a full path
diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index 44d6518..265b48a 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -1843,8 +1843,8 @@ sub Probe {
my $path = File::Which::which( $bin );
unless ($path) {
$RT::Logger->warning(
- "Can't find gpg binary '$bin' in PATH; GnuPG support has been disabled. ".
- "Check the 'GnuPG' configuration in %GnuPG");
+ "Can't find gpg binary '$bin' in PATH ($ENV{PATH}); GnuPG support has been disabled. ".
+ "You may need to specify a full path to gpg via the 'GnuPG' configuration in %GnuPG");
return 0;
}
$self->GnuPGPath( $bin = $path );
diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index cb05e33..ff29763 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -166,8 +166,8 @@ sub Probe {
my $path = File::Which::which( $bin );
unless ($path) {
$RT::Logger->warning(
- "Can't find openssl binary '$bin' in PATH; SMIME support has been disabled. ".
- "Check the 'OpenSSL' configuration in %OpenSSL");
+ "Can't find openssl binary '$bin' in PATH ($ENV{PATH}); SMIME support has been disabled. ".
+ "You may need to specify a full path to opensssl via the 'OpenSSL' configuration in %OpenSSL");
return 0;
}
$self->OpenSSLPath( $bin = $path );
commit 40f489d7f2f1607df3b4f26b556e04b1b35e0da7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Oct 3 19:00:38 2013 -0400
Provide a default PATH in cases where it is unset (mod_fastcgi)
mod_fastcgi, by default, spawns fastcgi children with no environment --
including PATH. In such cases, it is still possible to spawn
subprocesses without absolute paths: namely, if called via a subshell,
/bin/sh contains a compiled-in default $PATH (generally
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ) which is
used. If the shell is skipped, and there is no PATH set, execvp(3) uses
a _different_ hardcoded default, equivalent to ".:/bin:/usr/bin".
As File::Which is unaware of these two defaults, and thus fails to
locate gnupg or openssl, despite that system() would likely find them in
/usr/bin. As such, gpg or smime support is improperly disabled in
configurations where it worked previously.
Hard-code the default PATH from /bin/sh in cases where it is unset 9not
just empty), to mimic the previous functionality.
diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index 265b48a..7a02277 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -1840,6 +1840,8 @@ sub Probe {
return 0;
}
} else {
+ local $ENV{PATH} = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
+ unless defined $ENV{PATH};
my $path = File::Which::which( $bin );
unless ($path) {
$RT::Logger->warning(
diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index ff29763..7f59b14 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -163,6 +163,8 @@ sub Probe {
return 0;
}
} else {
+ local $ENV{PATH} = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
+ unless defined $ENV{PATH};
my $path = File::Which::which( $bin );
unless ($path) {
$RT::Logger->warning(
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list