Commit f9ec5f4d authored by Jakub Wilk's avatar Jakub Wilk

Remove "." from @INC as early as possible

parent 2440cf69
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::ar_info; package Lintian::coll::ar_info;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{LINTIAN_ROOT}/lib"; use lib "$ENV{LINTIAN_ROOT}/lib";
use FileHandle; use FileHandle;
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::bin_pkg_control; package Lintian::coll::bin_pkg_control;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use constant ERROR_FILES => qw(control-index-errors control-errors); use constant ERROR_FILES => qw(control-index-errors control-errors);
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::changelog_file; package Lintian::coll::changelog_file;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use File::Copy qw(copy); use File::Copy qw(copy);
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::copyright_file; package Lintian::coll::copyright_file;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Lintian::Util qw(fail gunzip_file is_ancestor_of touch_file); use Lintian::Util qw(fail gunzip_file is_ancestor_of touch_file);
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::debian_readme; package Lintian::coll::debian_readme;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Lintian::Util qw(fail gunzip_file touch_file is_ancestor_of); use Lintian::Util qw(fail gunzip_file touch_file is_ancestor_of);
......
...@@ -27,10 +27,11 @@ ...@@ -27,10 +27,11 @@
package Lintian::coll::diffstat; package Lintian::coll::diffstat;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Lintian::Util qw(fail get_dsc_info gunzip_file); use Lintian::Util qw(fail get_dsc_info gunzip_file);
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::file_info; package Lintian::coll::file_info;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
......
...@@ -28,10 +28,11 @@ ...@@ -28,10 +28,11 @@
package Lintian::coll::hardening_info; package Lintian::coll::hardening_info;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::java_info; package Lintian::coll::java_info;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use FileHandle; use FileHandle;
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::md5sums; package Lintian::coll::md5sums;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
package Lintian::coll::objdump_info; package Lintian::coll::objdump_info;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
package Lintian::coll::override_file; package Lintian::coll::override_file;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Lintian::Util qw(fail gunzip_file is_ancestor_of); use Lintian::Util qw(fail gunzip_file is_ancestor_of);
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::scripts; package Lintian::coll::scripts;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use lib "$ENV{'LINTIAN_ROOT'}/lib/"; use lib "$ENV{'LINTIAN_ROOT'}/lib/";
use Lintian::Collect; use Lintian::Collect;
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::src_orig_index; package Lintian::coll::src_orig_index;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
# import perl libraries # import perl libraries
use lib "$ENV{'LINTIAN_ROOT'}/lib"; use lib "$ENV{'LINTIAN_ROOT'}/lib";
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
package Lintian::coll::strings; package Lintian::coll::strings;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
package Lintian::coll::unpacked; package Lintian::coll::unpacked;
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
# Read up to 40kB at the time. This happens to be 4096 "tar records" # Read up to 40kB at the time. This happens to be 4096 "tar records"
# (with a block-size of 512 and a block factor of 20, which appears to # (with a block-size of 512 and a block factor of 20, which appears to
......
...@@ -20,7 +20,7 @@ lintian (2.5.46) UNRELEASED; urgency=medium ...@@ -20,7 +20,7 @@ lintian (2.5.46) UNRELEASED; urgency=medium
+ [JW] Fix typo. + [JW] Fix typo.
* collection/*: * collection/*:
+ [JW] Remove "." from Perl's module search path. (Mitigates: #588017) + [JW,NT] Remove "." from Perl's search path. (Mitigates: #588017)
* commands/lintian: * commands/lintian:
+ [NT,JW] Remove "." from Perl's search path. (Mitigates: #588017) + [NT,JW] Remove "." from Perl's search path. (Mitigates: #588017)
...@@ -41,10 +41,10 @@ lintian (2.5.46) UNRELEASED; urgency=medium ...@@ -41,10 +41,10 @@ lintian (2.5.46) UNRELEASED; urgency=medium
+ [JW] Fix typo. + [JW] Fix typo.
* frontend/dplint: * frontend/dplint:
+ [JW] Remove "." from Perl's search path. (Mitigates: #588017) + [JW,NT] Remove "." from Perl's search path. (Mitigates: #588017)
* helpers/coll/*: * helpers/coll/*:
+ [JW] Remove "." from Perl's search path. (Mitigates: #588017) + [JW,NT] Remove "." from Perl's search path. (Mitigates: #588017)
* lib/Lintian/*.pm: * lib/Lintian/*.pm:
+ [JW] Fix typos. + [JW] Fix typos.
......
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA. # MA 02110-1301, USA.
no lib '.';
# In main scope, need an unnamed sub to avoid tainting the "main" namespace # In main scope, need an unnamed sub to avoid tainting the "main" namespace
# in case we need to run a ".pm" tool. # in case we need to run a ".pm" tool.
use strict; use strict;
use warnings; use warnings;
no lib '.';
my $TOOL_RUNNER = sub { my $TOOL_RUNNER = sub {
my ($tool_pm_path) = @_; my ($tool_pm_path) = @_;
......
#!/usr/bin/perl #!/usr/bin/perl
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
while (my $line = <>) { while (my $line = <>) {
my ($file, $type) = $line =~ (m/^(.*?)\x00(.*)$/o); my ($file, $type) = $line =~ (m/^(.*?)\x00(.*)$/o);
......
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA. # MA 02110-1301, USA.
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use FileHandle; use FileHandle;
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA. # MA 02110-1301, USA.
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
my (@sections, @symbol_versions); my (@sections, @symbol_versions);
my @dyn_symbols; my @dyn_symbols;
......
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA. # MA 02110-1301, USA.
no lib '.';
use strict; use strict;
use warnings; use warnings;
use autodie; use autodie;
no lib '.';
use File::Basename qw(dirname); use File::Basename qw(dirname);
use IO::Handle; use IO::Handle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment