Skip to content

Commit bed56ea

Browse files
committed
Item14221: Merge branch 'Release02x01'
2 parents 904ec23 + 3bb6f66 commit bed56ea

File tree

9 files changed

+95
-57
lines changed

9 files changed

+95
-57
lines changed

FastCGIEngineContrib/lib/Foswiki/Engine/FastCGI.pm

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,7 @@ sub run {
6565
or die "Failed to create FastCGI socket: $!";
6666
}
6767
$args ||= {};
68-
69-
# Prepare output handles for FastCGI.
70-
$this->{$_} = IO::Handle->new foreach qw(fhOUT fhERR);
71-
72-
# This is a little trick to make all `print STDERR' clauses send their
73-
# output to the log file. May not work for spawned processes.
74-
75-
STDERR->fdopen( $this->{fhERR}->fileno, "w" );
76-
77-
my $r =
78-
FCGI::Request( \*STDIN, $this->{fhOUT}, $this->{fhERR}, \%ENV, $sock,
68+
my $r = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, $sock,
7969
&FCGI::FAIL_ACCEPT_ON_INTR );
8070
my $manager;
8171

@@ -197,8 +187,7 @@ sub preparePath {
197187
}
198188

199189
sub write {
200-
my $this = shift;
201-
syswrite $this->{fhOUT}, $_[0];
190+
syswrite STDOUT, $_[1];
202191
}
203192

204193
sub closeSocket {

JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/MANIFEST

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,13 @@ pub/System/JQueryPlugin/plugins/treeview/jquery.treeview.js.gz 0644
679679
pub/System/JQueryPlugin/plugins/treeview/jquery.treeview.uncompressed.css 0644
680680
pub/System/JQueryPlugin/plugins/treeview/jquery.treeview.uncompressed.js 0644
681681
pub/System/JQueryPlugin/plugins/treeview/Makefile 0644
682-
pub/System/JQueryPlugin/plugins/tmpl/Makefile
683-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.js
684-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.js.gz
685-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.uncompressed.js
686-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.js
687-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.js.gz
688-
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.uncompressed.js
682+
pub/System/JQueryPlugin/plugins/tmpl/Makefile 0644
683+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.js 0644
684+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.js.gz 0644
685+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl-loader.uncompressed.js 0644
686+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.js 0644
687+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.js.gz 0644
688+
pub/System/JQueryPlugin/plugins/tmpl/jquery.tmpl.uncompressed.js 0644
689689
pub/System/JQueryPlugin/plugins/ui/i18n/datepicker-af.js 0644
690690
pub/System/JQueryPlugin/plugins/ui/i18n/datepicker-ar-DZ.js 0644
691691
pub/System/JQueryPlugin/plugins/ui/i18n/datepicker-ar.js 0644

core/lib/Foswiki.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ $Foswiki::cfg{Email}{SSLVerifyServer} = $FALSE;
19201920

19211921
# **PATH LABEL="Certificate Authorities Filename" \
19221922
# FEEDBACK="icon='ui-icon-shuffle';label='Guess certificate locations'; wizard='SSLCertificates'; method='guess_locations'"\
1923+
# CHECK_ON_CHANGE="{Email}{SSLCaPath}" CHECK="also:{Email}{SSLCaPath}" \
19231924
# DISPLAY_IF="{EnableEmail} && /^Net::SMTP/.test({Email}{MailMethod}) && {Email}{SSLVerifyServer}"**
19241925
# Specify the file used to verify the server certificate trust chain.
19251926
# This is the list of root Certificate authorities that you trust to issue
@@ -1931,6 +1932,7 @@ $Foswiki::cfg{Email}{SSLCaFile} = '';
19311932
# FEEDBACK='label="Validate Contents"; wizard="SSLCertificates"; method="validate";\
19321933
# title="Examines every file in the directory and verifies \
19331934
# that the contents look like certificates/and/or CRLs"' \
1935+
# CHECK_ON_CHANGE="{Email}{SSLCaFile}" CHECK="also:{Email}{SSLCaFile}" \
19341936
# DISPLAY_IF="{EnableEmail} && /^Net::SMTP/.test({Email}{MailMethod}) && {Email}{SSLVerifyServer}"**
19351937
# Specify the directory used to verify the server certificate trust chain.
19361938
# This is the list of root Certificate authorities that you trust to issue

core/lib/Foswiki/Configure/Checkers/Email/SSLCaPath.pm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ sub check_current_value {
3636
);
3737
}
3838

39+
if ( $file && $path ) {
40+
my @mods = (
41+
{
42+
name => 'IO::Socket::SSL',
43+
usage =>
44+
'Required if both ={Email}{SSLCaFile}= and ={Email}{SSLCaPath}= are set. Clear one or the other.',
45+
minimumVersion => 1.973
46+
}
47+
);
48+
Foswiki::Configure::Dependency::checkPerlModules(@mods);
49+
foreach my $mod (@mods) {
50+
if ( !$mod->{ok} ) {
51+
$reporter->ERROR( $mod->{check_result} );
52+
}
53+
}
54+
}
55+
3956
my $cfile = $Foswiki::cfg{Email}{SSLCrlFile};
4057
Foswiki::Configure::Load::expandValue($cfile);
4158
if ( $Foswiki::cfg{Email}{SSLCheckCRL}

core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ sub _muteExec {
113113
close $fh2;
114114

115115
{
116+
# Don't try to capture STDERR on FastCGI systems. it won't work.
116117
my $muter = Foswiki::Aux::MuteOut->new(
117118
outFile => $outFile,
118119
errFile => $errFile,
@@ -184,14 +185,17 @@ NOCERT
184185

185186
if ( $Foswiki::cfg{SMTP}{MAILHOST} ) {
186187

187-
if ( 1
188-
|| $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/FastCGI$/ )
189-
{
190-
( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
188+
if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} =~ m/FastCGI$/ ) {
189+
$reporter->WARN(
190+
'Debug log not captured in FCGI environments. Check web server error log for debugging information'
191+
);
192+
$ok = _autoconfigSMTP($reporter);
191193
}
192194
else {
193-
$ok = _autoconfigSMTP($reporter);
195+
( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
194196
}
197+
$err =~ s/AUTH\s([^\s]+)\s.*$/AUTH $1 xxxxxxxxxxxxxxxx/mg if $err;
198+
195199
unless ($ok) {
196200
$reporter->WARN(
197201
"SMTP configuration using $Foswiki::cfg{SMTP}{MAILHOST} failed. Falling back to mail program"

core/lib/Foswiki/Configure/Wizards/SSLCertificates.pm

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ Guess the locations of SSL Certificate files.
2828
sub guess_locations {
2929
my ( $this, $reporter ) = @_;
3030

31+
my $supportBoth = 1; # Support both CA File and CA Path.
32+
33+
# SMELL: Versions of IO::Socket::SSL before 1.973 will croak if both CaFile and CaPath are set.
34+
my @mods = (
35+
{
36+
name => 'IO::Socket::SSL',
37+
usage =>
38+
'Required if both ={Email}{SSLCaFile}= and ={Email}{SSLCaPath}= are set. Clear one or the other.',
39+
minimumVersion => 1.973
40+
}
41+
);
42+
Foswiki::Configure::Dependency::checkPerlModules(@mods);
43+
foreach my $mod (@mods) {
44+
if ( !$mod->{ok} ) {
45+
$supportBoth = 0;
46+
}
47+
}
48+
3149
my @CERT_FILES = (
3250
"/etc/pki/tls/certs/ca-bundle.crt", #Fedora/RHEL
3351
"/etc/ssl/certs/ca-certificates.crt", #Debian/Ubuntu/Gentoo etc.
@@ -53,22 +71,22 @@ sub guess_locations {
5371
if ( $file || $path ) {
5472
$reporter->NOTE("Guessed from LWP settings");
5573
$guessed = 1;
56-
_setLocations( $reporter, $file, $path );
74+
_setLocations( $reporter, $file, $path, $supportBoth );
5775
}
5876
else {
5977
( $file, $path ) = @ENV{qw/HTTPS_CA_FILE HTTPS_CA_DIR/};
6078
if ( $file || $path ) {
6179
$reporter->NOTE("Guessed from Crypt::SSLEay's settings");
6280
$guessed = 1;
63-
_setLocations( $reporter, $file, $path );
81+
_setLocations( $reporter, $file, $path, $supportBoth );
6482
}
6583
else {
6684
if ( eval('require Mozilla::CA;') ) {
6785
$file = Mozilla::CA::SSL_ca_file();
6886
if ($file) {
6987
$reporter->NOTE("Obtained from Mozilla::CA");
7088
$guessed = 1;
71-
_setLocations( $reporter, $file, $path );
89+
_setLocations( $reporter, $file, $path, $supportBoth );
7290
}
7391
else {
7492
$reporter->WARN("Mozilla::CA is installed but has no file");
@@ -83,21 +101,19 @@ sub guess_locations {
83101
if ( -e $file && -r $file ) {
84102
$guessed = 1;
85103
$reporter->NOTE("Guessed $file as the CA certificate bundle.");
86-
_setLocations( $reporter, $file, $path );
104+
_setLocations( $reporter, $file, $path, $supportBoth );
87105
last;
88106
}
89107
}
90108

91-
# SMELL: I've seen some errors that suggest that only File or Path should be specified
92-
# but IO::Socket::SSL docs clearly state both are acceptable.
93-
#return undef if ($guessed);
109+
return undef if ( $guessed && !$supportBoth );
94110

95111
# First see if the linux default path work
96112
foreach $path (@CERT_DIRS) {
97113
if ( -d $path && -r $path ) {
98114
$reporter->NOTE("Guessed $path as the certificate directory.");
99115
$guessed = 1;
100-
_setLocations( $reporter, $file, $path );
116+
_setLocations( $reporter, $file, $path, $supportBoth );
101117
}
102118
}
103119

@@ -114,10 +130,36 @@ sub _setLocations {
114130

115131
# my ( $reporter, $file, $path ) = @_
116132
#$_[0]->WARN(Foswiki::Configure::Checker::GUESSED_MESSAGE);
133+
134+
if (
135+
!$_[3]
136+
&& ( $Foswiki::cfg{Email}{SSLCaFile}
137+
|| $Foswiki::cfg{Email}{SSLCaPath} )
138+
)
139+
{
140+
$_[0]->WARN(
141+
'Obsolete version of IO::Socket::SSL installed: ={Email}{SSLCaFile}= and ={Email}{SSLCaPath}= must not both be set.'
142+
);
143+
return;
144+
}
145+
117146
if ( $_[1] ) {
118147
$Foswiki::cfg{Email}{SSLCaFile} = $_[1];
119148
$_[0]->CHANGED('{Email}{SSLCaFile}');
120149
}
150+
151+
if (
152+
!$_[3]
153+
&& ( $Foswiki::cfg{Email}{SSLCaFile}
154+
|| $Foswiki::cfg{Email}{SSLCaPath} )
155+
)
156+
{
157+
$_[0]->WARN(
158+
'Obsolete version of IO::Socket::SSL installed: ={Email}{SSLCaFile}= and ={Email}{SSLCaPath}= must not both be set.'
159+
);
160+
return;
161+
}
162+
121163
if ( $_[2] ) {
122164
$Foswiki::cfg{Email}{SSLCaPath} = $_[2];
123165
$_[0]->CHANGED('{Email}{SSLCaPath}');

core/lib/Foswiki/Engine.pm

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,12 @@ BEGIN {
3434
3535
Constructs an engine object.
3636
37-
The default object has three initialized keys on it: =fhOUT=, =fhERR=.
38-
Those are filehandles used to communicate with HTTP server/environment and by
39-
default they're set to =STDIN=, =STDOUT=, and =STDERR= correspondingly. It is
40-
recommended to use =$engine->{fhERR}= instead of STDERR in order to get error
41-
messages always logged correctly:
42-
43-
<verbatim>
44-
print $Foswiki::engine->{fhERR} "This is the error we wanna see in the log.\n";
45-
46-
$SIG{__DIE__} = sub {
47-
print $Foswiki::engine->{fhERR} @_;
48-
exit 1;
49-
};
50-
</verbatim>
51-
5237
=cut
5338

5439
sub new {
5540
my $proto = shift;
5641
my $class = ref($proto) || $proto;
57-
my $this = {
58-
59-
# Standard file handles to support engines/environments where
60-
# communication is based on custom sockets.
61-
fhOUT => \*STDOUT,
62-
fhERR => \*STDERR,
63-
};
42+
my $this = {};
6443
return bless $this, $class;
6544
}
6645

core/lib/Foswiki/Engine/CGI.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ sub prepareBody {
234234
# as breaking uploads (though cdot believes this is because of the
235235
# deprecated dual nature of param delivering lightweight file handles,
236236
# and it would probably work in Foswiki. Just not tried it)
237-
my $cgi = new CGI;
237+
my $cgi = new CGI();
238238
my $err = $cgi->cgi_error;
239239
throw Foswiki::EngineException( $1, $2 )
240240
if defined $err && $err =~ m/\s*(\d{3})\s*(.*)/;

core/tools/check_extensions.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use strict;
44
use warnings;
55

6-
# cruise back up the tree until we find lib and data subdirs
76
use Cwd;
87
use File::Spec;
98
use File::Find;
@@ -14,6 +13,9 @@
1413
my $extension = shift;
1514
my %items; # Hash to cache item # & descriptions.
1615

16+
# Tasks that are typically left open and not documented in release notes, eg. Documentation, Translation, etc.
17+
my @omit = (qw(Item13883 Item13884 Item13504));
18+
1719
my $start = `git describe --tags --abbrev=0`;
1820
unless ($start) {
1921
help();
@@ -81,6 +83,9 @@ END
8183
my $last = '';
8284
foreach my $item ( sort @itemlist ) {
8385
next if $item eq $last;
86+
87+
#SMELL: SmartMatch is experimental. But had to give it a try. Will be changed in upcoming perl.
88+
next if $item ~~ @omit;
8489
$last = $item;
8590
my $taskinfo = get_task_info($item);
8691
print "WARNING: Wrong state: $taskinfo\n"

0 commit comments

Comments
 (0)