Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13028: in DEBUG mode when locales are not in use, check for Taint…
…::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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
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.