Skip to content

Commit

Permalink
Item14205: Only skip STDERR for Fcgi, STDOUT still capturable.
Browse files Browse the repository at this point in the history
Also restore obfuscation of any password data revealed in the debug
logs.
  • Loading branch information
gac410 committed Dec 5, 2016
1 parent 979a363 commit f174302
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
Expand Up @@ -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,
);

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit f174302

Please sign in to comment.