Skip to content

Commit

Permalink
Item13028: in DEBUG mode when locales are not in use, check for Taint…
Browse files Browse the repository at this point in the history
…::Runtime and use it to programmatically enable taint checking. Developers need to be recommended to install this module, but it doesn't need to be compulsory
  • Loading branch information
Comment committed Feb 9, 2015
1 parent aee1123 commit 0211836
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CompareRevisionsAddOn/bin/compare
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion CompareRevisionsAddOn/bin/compareauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion ConfigurePlugin/bin/configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/attach
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/edit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/login
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/logon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/manage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/oops
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/preview
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/previewauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/rdiff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/rdiffauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/register
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/rename
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/resetpasswd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/rest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/restauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/save
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/search
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/statistics
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/upload
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/viewauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/viewfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/bin/viewfileauth
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl -wT
#! /usr/bin/perl -w
# See bottom of file for license and copyright information
use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/AssertOff.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use strict;
sub ASSERT { }

sub UNTAINTED {
return 0;
return 1;
}

sub TAINT {
Expand Down
11 changes: 11 additions & 0 deletions core/lib/Foswiki.pm
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,17 @@ BEGIN {
require locale;
import locale();
}
elsif (DEBUG) {
eval { require Taint::Runtime; };
if ($@) {
print STDERR
"DEVELOPER WARNING: taint mode could not be enabled. Is Taint::Runtime installed?\n";
}
else {
# Enable taint checking
Taint::Runtime::_taint_start();
}
}

# If not set, default to strikeone validation
$Foswiki::cfg{Validation}{Method} ||= 'strikeone';
Expand Down

0 comments on commit 0211836

Please sign in to comment.