Permalink
Browse files

Item14205: Only skip STDERR for Fcgi, STDOUT still capturable.

Also restore obfuscation of any password data revealed in the debug
logs.
  • Loading branch information...
gac410 committed Dec 5, 2016
1 parent 979a363 commit f174302b06d1d3a7b41f7c35da17ece2819f5080
Showing with 13 additions and 7 deletions.
  1. +13 −7 core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
@@ -113,9 +113,13 @@ sub _muteExec {
close $fh2;
{
+ # Don't try to capture STDERR on FastCGI systems. it won't work.
my $muter = Foswiki::Aux::MuteOut->new(
- outFile => $outFile,
- errFile => $errFile,
+ outFile => $outFile,
+ errFile => (
+ defined $Foswiki::cfg{Engine}
+ && $Foswiki::cfg{Engine} =~ m/FastCGI$/
+ ) ? undef : $errFile,
reporter => $reporter,
);
@@ -184,12 +188,14 @@ NOCERT
if ( $Foswiki::cfg{SMTP}{MAILHOST} ) {
- if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/FastCGI$/ ) {
- ( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
- }
- else {
- $ok = _autoconfigSMTP($reporter);
+ if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} =~ m/FastCGI$/ ) {
+ $reporter->WARN(
+'Debug log not captured in FCGI environments. Check web server error log for debugging information'
+ );
}
+ ( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
+ $err =~ s/AUTH\s([^\s]+)\s.*$/AUTH $1 xxxxxxxxxxxxxxxx/mg if $err;
+
unless ($ok) {
$reporter->WARN(
"SMTP configuration using $Foswiki::cfg{SMTP}{MAILHOST} failed. Falling back to mail program"

0 comments on commit f174302

Please sign in to comment.