summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Chart.pm1
-rw-r--r--Bugzilla/Constants.pm1
-rw-r--r--Bugzilla/Install/Filesystem.pm5
-rw-r--r--Bugzilla/Series.pm1
-rw-r--r--admin.cgi2
-rwxr-xr-xattachment.cgi2
-rwxr-xr-xbuglist.cgi2
-rwxr-xr-xchart.cgi2
-rwxr-xr-xchecksetup.pl2
-rwxr-xr-xcolchange.cgi2
-rwxr-xr-xcollectstats.pl2
-rwxr-xr-xconfig.cgi2
-rwxr-xr-xcontrib/bz_webservice_demo.pl1
-rwxr-xr-xcontrib/bzdbcopy.pl2
-rw-r--r--contrib/merge-users.pl2
-rwxr-xr-xcontrib/recode.pl3
-rw-r--r--contrib/sendbugmail.pl4
-rw-r--r--contrib/sendunsentbugmail.pl2
-rwxr-xr-xcontrib/syncLDAP.pl2
-rwxr-xr-xcreateaccount.cgi2
-rwxr-xr-xdescribecomponents.cgi2
-rwxr-xr-xdescribekeywords.cgi2
-rw-r--r--docs/makedocs.pl2
-rw-r--r--docs/xml/installation.xml4
-rwxr-xr-xduplicates.cgi2
-rwxr-xr-xeditclassifications.cgi2
-rwxr-xr-xeditcomponents.cgi2
-rw-r--r--editfields.cgi2
-rwxr-xr-xeditflagtypes.cgi2
-rwxr-xr-xeditgroups.cgi2
-rwxr-xr-xeditkeywords.cgi2
-rwxr-xr-xeditmilestones.cgi2
-rwxr-xr-xeditparams.cgi2
-rwxr-xr-xeditproducts.cgi2
-rwxr-xr-xeditsettings.cgi2
-rwxr-xr-xeditusers.cgi2
-rwxr-xr-xeditvalues.cgi2
-rwxr-xr-xeditversions.cgi2
-rwxr-xr-xeditwhines.cgi2
-rw-r--r--editworkflow.cgi2
-rw-r--r--email_in.pl2
-rwxr-xr-xenter_bug.cgi2
-rwxr-xr-ximportxml.pl20
-rwxr-xr-xindex.cgi2
-rw-r--r--lib/README4
-rwxr-xr-xlong_list.cgi2
-rwxr-xr-xpage.cgi2
-rwxr-xr-xpost_bug.cgi2
-rwxr-xr-xprocess_bug.cgi2
-rwxr-xr-xquery.cgi2
-rwxr-xr-xquips.cgi2
-rwxr-xr-xrelogin.cgi2
-rwxr-xr-xreport.cgi2
-rwxr-xr-xreports.cgi2
-rwxr-xr-xrequest.cgi2
-rwxr-xr-xruntests.pl1
-rwxr-xr-xsanitycheck.cgi2
-rw-r--r--sanitycheck.pl2
-rw-r--r--search_plugin.cgi2
-rwxr-xr-xshow_activity.cgi2
-rwxr-xr-xshow_bug.cgi2
-rwxr-xr-xshowattachment.cgi2
-rwxr-xr-xshowdependencygraph.cgi2
-rwxr-xr-xshowdependencytree.cgi2
-rwxr-xr-xsidebar.cgi2
-rwxr-xr-xsummarize_time.cgi2
-rwxr-xr-xtestserver.pl2
-rwxr-xr-xtoken.cgi2
-rwxr-xr-xuserprefs.cgi2
-rwxr-xr-xvotes.cgi2
-rwxr-xr-xwhine.pl2
-rwxr-xr-xwhineatnews.pl2
-rwxr-xr-xxml.cgi2
-rwxr-xr-xxmlrpc.cgi2
74 files changed, 88 insertions, 83 deletions
diff --git a/Bugzilla/Chart.pm b/Bugzilla/Chart.pm
index 9701f7b32..a119e4b7c 100644
--- a/Bugzilla/Chart.pm
+++ b/Bugzilla/Chart.pm
@@ -22,7 +22,6 @@
# A. Karl Kornel <karl@kornel.name>
use strict;
-use lib ".";
# This module represents a chart.
#
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index f84ece006..827bb2d4b 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -445,6 +445,7 @@ sub bz_locations {
# That means that if you modify these paths, they must be absolute paths.
return {
'libpath' => $libpath,
+ 'ext_libpath' => "$libpath/lib",
# If you put the libraries in a different location than the CGIs,
# make sure this still points to the CGIs.
'cgi_path' => $libpath,
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 8387d0173..127fe0b58 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -62,6 +62,7 @@ sub FILESYSTEM {
my $webdotdir = bz_locations()->{'webdotdir'};
my $templatedir = bz_locations()->{'templatedir'};
my $libdir = bz_locations()->{'libpath'};
+ my $extlib = bz_locations()->{'ext_libpath'};
my $skinsdir = bz_locations()->{'skinsdir'};
my $ws_group = Bugzilla->localconfig->{'webservergroup'};
@@ -152,6 +153,8 @@ sub FILESYSTEM {
dirs => $ws_dir_readable },
"$libdir/Bugzilla" => { files => $ws_readable,
dirs => $ws_dir_readable },
+ $extlib => { files => $ws_readable,
+ dirs => $ws_dir_readable },
$templatedir => { files => $ws_readable,
dirs => $ws_dir_readable },
images => { files => $ws_readable,
@@ -251,6 +254,8 @@ EOT
contents => $ht_default_deny },
"$libdir/Bugzilla/.htaccess" => { perms => $ws_readable,
contents => $ht_default_deny },
+ "$extlib/.htaccess" => { perms => $ws_readable,
+ contents => $ht_default_deny },
"$templatedir/.htaccess" => { perms => $ws_readable,
contents => $ht_default_deny },
diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm
index 877f69866..d6fd7a08a 100644
--- a/Bugzilla/Series.pm
+++ b/Bugzilla/Series.pm
@@ -21,7 +21,6 @@
# Lance Larsh <lance.larsh@oracle.com>
use strict;
-use lib ".";
# This module implements a series - a set of data to be plotted on a chart.
#
diff --git a/admin.cgi b/admin.cgi
index 3edff1338..83cc55d8b 100644
--- a/admin.cgi
+++ b/admin.cgi
@@ -21,7 +21,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/attachment.cgi b/attachment.cgi
index 82f650f3c..cc6408f2b 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -35,7 +35,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/buglist.cgi b/buglist.cgi
index 71b6fd14f..0f98a3811 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -32,7 +32,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/chart.cgi b/chart.cgi
index db4874570..97bf9e77d 100755
--- a/chart.cgi
+++ b/chart.cgi
@@ -43,7 +43,7 @@
# Offer subscription when you get a "series already exists" error?
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/checksetup.pl b/checksetup.pl
index 81d4a819f..f1cf9e224 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -51,7 +51,7 @@ use POSIX qw(setlocale LC_CTYPE);
use Safe;
BEGIN { chdir dirname($0); }
-use lib ".";
+use lib qw(. lib);
use Bugzilla::Constants;
use Bugzilla::Install::Requirements;
use Bugzilla::Install::Util qw(install_string get_version_and_os);
diff --git a/colchange.cgi b/colchange.cgi
index b2deb3274..c580547ce 100755
--- a/colchange.cgi
+++ b/colchange.cgi
@@ -24,7 +24,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/collectstats.pl b/collectstats.pl
index a1ab9b2d1..1e5c5fd9d 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -34,7 +34,7 @@ use AnyDBM_File;
use strict;
use IO::Handle;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/config.cgi b/config.cgi
index 84bcb9038..ad8dbf0fe 100755
--- a/config.cgi
+++ b/config.cgi
@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl
index 70fb6c294..72dd78a19 100755
--- a/contrib/bz_webservice_demo.pl
+++ b/contrib/bz_webservice_demo.pl
@@ -29,6 +29,7 @@ C<bz_webservice_demo.pl --help> for detailed help
=cut
use strict;
+use lib qw(lib);
use Getopt::Long;
use Pod::Usage;
use File::Basename qw(dirname);
diff --git a/contrib/bzdbcopy.pl b/contrib/bzdbcopy.pl
index 489909882..9edf585af 100755
--- a/contrib/bzdbcopy.pl
+++ b/contrib/bzdbcopy.pl
@@ -19,7 +19,7 @@
# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::DB;
use Bugzilla::Util;
diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl
index f071f7c2c..ac689abfd 100644
--- a/contrib/merge-users.pl
+++ b/contrib/merge-users.pl
@@ -44,7 +44,7 @@ merge-users.pl - Merge two user accounts.
=cut
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/contrib/recode.pl b/contrib/recode.pl
index 49e824f6d..713465be7 100755
--- a/contrib/recode.pl
+++ b/contrib/recode.pl
@@ -20,8 +20,7 @@
# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
-# Allow the script to be run from contrib or as contrib/recode.pl
-use lib '..';
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/contrib/sendbugmail.pl b/contrib/sendbugmail.pl
index ae282ca4a..4fd1c8374 100644
--- a/contrib/sendbugmail.pl
+++ b/contrib/sendbugmail.pl
@@ -4,7 +4,7 @@
#
# Nick Barnes, Ravenbrook Limited, 2004-04-01.
#
-# $Id: sendbugmail.pl,v 1.7 2006/07/03 21:42:47 mkanat%bugzilla.org Exp $
+# $Id: sendbugmail.pl,v 1.8 2007/10/19 06:46:17 mkanat%bugzilla.org Exp $
#
# Bugzilla email script for Bugzilla 2.17.4 and later. Invoke this to send
# bugmail for a bug which has been changed directly in the database.
@@ -14,7 +14,7 @@
#
# Usage: perl -T contrib/sendbugmail.pl bug_id user_email
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
diff --git a/contrib/sendunsentbugmail.pl b/contrib/sendunsentbugmail.pl
index 5ed49b22e..ec92a97a0 100644
--- a/contrib/sendunsentbugmail.pl
+++ b/contrib/sendunsentbugmail.pl
@@ -23,7 +23,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/contrib/syncLDAP.pl b/contrib/syncLDAP.pl
index 72ea91798..07fa6f46b 100755
--- a/contrib/syncLDAP.pl
+++ b/contrib/syncLDAP.pl
@@ -22,7 +22,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Net::LDAP;
use Bugzilla;
diff --git a/createaccount.cgi b/createaccount.cgi
index 1ec7ec31d..c10c9b378 100755
--- a/createaccount.cgi
+++ b/createaccount.cgi
@@ -26,7 +26,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/describecomponents.cgi b/describecomponents.cgi
index b282040c5..806183783 100755
--- a/describecomponents.cgi
+++ b/describecomponents.cgi
@@ -23,7 +23,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/describekeywords.cgi b/describekeywords.cgi
index 70c0ba4e0..5ff5c5089 100755
--- a/describekeywords.cgi
+++ b/describekeywords.cgi
@@ -22,7 +22,7 @@
# Contributor(s): Gervase Markham <gerv@gerv.net>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/docs/makedocs.pl b/docs/makedocs.pl
index b636a2f37..1b9a44296 100644
--- a/docs/makedocs.pl
+++ b/docs/makedocs.pl
@@ -34,7 +34,7 @@ BEGIN {
chdir dirname($0);
}
-use lib qw(.. lib);
+use lib qw(.. ../lib lib);
# We only compile our POD if Pod::Simple is installed. We do the checks
# this way so that if there's a compile error in Pod::Simple::HTML::Bugzilla,
diff --git a/docs/xml/installation.xml b/docs/xml/installation.xml
index 57b004e3c..58b7d33aa 100644
--- a/docs/xml/installation.xml
+++ b/docs/xml/installation.xml
@@ -1,5 +1,5 @@
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
-<!-- $Id: installation.xml,v 1.146 2007/10/16 09:56:07 justdave%bugzilla.org Exp $ -->
+<!-- $Id: installation.xml,v 1.147 2007/10/19 06:46:18 mkanat%bugzilla.org Exp $ -->
<chapter id="installing-bugzilla">
<title>Installing Bugzilla</title>
@@ -1123,7 +1123,7 @@
</warning>
<programlisting>
- PerlSwitches -I/var/www/html/bugzilla -w -T
+ PerlSwitches -I/var/www/html/bugzilla -I/var/www/html/bugzilla/lib -w -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
</programlisting>
</step>
diff --git a/duplicates.cgi b/duplicates.cgi
index e393d7c25..32553a39d 100755
--- a/duplicates.cgi
+++ b/duplicates.cgi
@@ -27,7 +27,7 @@ use strict;
use AnyDBM_File;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editclassifications.cgi b/editclassifications.cgi
index cacc47fb6..03d3af81c 100755
--- a/editclassifications.cgi
+++ b/editclassifications.cgi
@@ -21,7 +21,7 @@
# Direct any questions on this source code to mozilla.org
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editcomponents.cgi b/editcomponents.cgi
index dd693c05f..46b319edd 100755
--- a/editcomponents.cgi
+++ b/editcomponents.cgi
@@ -24,7 +24,7 @@
# Akamai Technologies <bugzilla-dev@akamai.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editfields.cgi b/editfields.cgi
index e57e1952c..50564c190 100644
--- a/editfields.cgi
+++ b/editfields.cgi
@@ -16,7 +16,7 @@
# Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index e32b7f509..47eac753e 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -27,7 +27,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib ".";
+use lib qw(. lib);
# Use Bugzilla's flag modules for handling flag types.
use Bugzilla;
diff --git a/editgroups.cgi b/editgroups.cgi
index 19db870ec..b7223e08d 100755
--- a/editgroups.cgi
+++ b/editgroups.cgi
@@ -25,7 +25,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editkeywords.cgi b/editkeywords.cgi
index 3aca22e43..7ded21471 100755
--- a/editkeywords.cgi
+++ b/editkeywords.cgi
@@ -21,7 +21,7 @@
# Contributor(s): Terry Weissman <terry@mozilla.org>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editmilestones.cgi b/editmilestones.cgi
index 777625326..0be0f6c7f 100755
--- a/editmilestones.cgi
+++ b/editmilestones.cgi
@@ -16,7 +16,7 @@
#
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editparams.cgi b/editparams.cgi
index 819c8c645..39faa16c6 100755
--- a/editparams.cgi
+++ b/editparams.cgi
@@ -23,7 +23,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editproducts.cgi b/editproducts.cgi
index 5a937db9d..7c6c52f7d 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -32,7 +32,7 @@
# Holger Schurig <holgerschurig@nikocity.de>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editsettings.cgi b/editsettings.cgi
index a4a85710f..cf87e6326 100755
--- a/editsettings.cgi
+++ b/editsettings.cgi
@@ -17,7 +17,7 @@
#
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editusers.cgi b/editusers.cgi
index e452eea01..b996c139e 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -21,7 +21,7 @@
# Gavin Shelley <bugzilla@chimpychompy.org>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editvalues.cgi b/editvalues.cgi
index 520c0797b..f60ab634e 100755
--- a/editvalues.cgi
+++ b/editvalues.cgi
@@ -19,7 +19,7 @@
# with some cleanup.
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
diff --git a/editversions.cgi b/editversions.cgi
index 223f1f555..ac7b2c7a0 100755
--- a/editversions.cgi
+++ b/editversions.cgi
@@ -29,7 +29,7 @@
# Holger Schurig <holgerschurig@nikocity.de>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editwhines.cgi b/editwhines.cgi
index ba39b543d..7da598dd8 100755
--- a/editwhines.cgi
+++ b/editwhines.cgi
@@ -27,7 +27,7 @@
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/editworkflow.cgi b/editworkflow.cgi
index d599a97fd..eddf845f2 100644
--- a/editworkflow.cgi
+++ b/editworkflow.cgi
@@ -21,7 +21,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/email_in.pl b/email_in.pl
index ea5082844..7b8232192 100644
--- a/email_in.pl
+++ b/email_in.pl
@@ -29,6 +29,8 @@ BEGIN {
chdir(File::Basename::dirname($0));
}
+use lib qw(. lib);
+
use Data::Dumper;
use Email::Address;
use Email::Reply qw(reply);
diff --git a/enter_bug.cgi b/enter_bug.cgi
index d4ee73bfb..dc2680473 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -35,7 +35,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/importxml.pl b/importxml.pl
index 9ef8150f6..80506971c 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -54,22 +54,16 @@ use strict;
#
#####################################################################
-# figure out which path this script lives in. Set the current path to
-# this and add it to @INC so this will work when run as part of mail
-# alias by the mailer daemon
-# since "use lib" is run at compile time, we need to enclose the
-# $::path declaration in a BEGIN block so that it is executed before
-# the rest of the file is compiled.
+use File::Basename qw(dirname);
+# MTAs may call this script from any directory, but it should always
+# run from this one so that it can find its modules.
BEGIN {
- $::path = $0;
- $::path =~ m#(.*)/[^/]+#;
- $::path = $1;
- $::path ||= '.'; # $0 is empty at compile time. This line will
- # have no effect on this script at runtime.
+ require File::Basename;
+ my $dir = $0; $dir =~ /(.*)/; $dir = $1; # trick taint
+ chdir(File::Basename::dirname($dir));
}
-chdir $::path;
-use lib ($::path);
+use lib qw(. lib);
# Data dumber is used for debugging, I got tired of copying it back in
# and then removing it.
#use Data::Dumper;
diff --git a/index.cgi b/index.cgi
index 7d1525b58..100941765 100755
--- a/index.cgi
+++ b/index.cgi
@@ -29,7 +29,7 @@
use strict;
# Include the Bugzilla CGI and general utility library.
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/lib/README b/lib/README
new file mode 100644
index 000000000..5778a9a3f
--- /dev/null
+++ b/lib/README
@@ -0,0 +1,4 @@
+This directory contains the Perl modules that Bugzilla requires to run.
+
+If you would rather have Bugzilla use the Perl modules installed on your
+system, you can delete everything in this directory.
diff --git a/long_list.cgi b/long_list.cgi
index c02c8deda..7e1f69534 100755
--- a/long_list.cgi
+++ b/long_list.cgi
@@ -22,7 +22,7 @@
# Gervase Markham <gerv@gerv.net>
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
my $cgi = Bugzilla->cgi;
diff --git a/page.cgi b/page.cgi
index 43a826590..290a4acb6 100755
--- a/page.cgi
+++ b/page.cgi
@@ -30,7 +30,7 @@
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/post_bug.cgi b/post_bug.cgi
index 8ce7f0723..2ef2dcde5 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -25,7 +25,7 @@
# Marc Schumann <wurblzap@gmail.com>
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Attachment;
diff --git a/process_bug.cgi b/process_bug.cgi
index 56931c293..d7fee8199 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -43,7 +43,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/query.cgi b/query.cgi
index bd69330e9..aaabc1529 100755
--- a/query.cgi
+++ b/query.cgi
@@ -26,7 +26,7 @@
# Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Bug;
diff --git a/quips.cgi b/quips.cgi
index bb0e5afff..295b6c83f 100755
--- a/quips.cgi
+++ b/quips.cgi
@@ -25,7 +25,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/relogin.cgi b/relogin.cgi
index 5aa187490..e2182699a 100755
--- a/relogin.cgi
+++ b/relogin.cgi
@@ -23,7 +23,7 @@
# A. Karl Kornel <karl@kornel.name>
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Mailer;
diff --git a/report.cgi b/report.cgi
index 10c532163..9ee5df287 100755
--- a/report.cgi
+++ b/report.cgi
@@ -22,7 +22,7 @@
# <rdean@cambianetworks.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/reports.cgi b/reports.cgi
index 7ed396935..40bbc82bb 100755
--- a/reports.cgi
+++ b/reports.cgi
@@ -37,7 +37,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/request.cgi b/request.cgi
index 186b42e1c..6c3ff48ee 100755
--- a/request.cgi
+++ b/request.cgi
@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
diff --git a/runtests.pl b/runtests.pl
index ad6898b23..092d8069b 100755
--- a/runtests.pl
+++ b/runtests.pl
@@ -23,6 +23,7 @@
# Make it harder for us to do dangerous things in Perl.
use diagnostics;
use strict;
+use lib qw(lib);
use Test::Harness qw(&runtests $verbose);
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 3d718a0dc..b1a48b16a 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -26,7 +26,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/sanitycheck.pl b/sanitycheck.pl
index 5c383e67d..5f158cb3b 100644
--- a/sanitycheck.pl
+++ b/sanitycheck.pl
@@ -21,7 +21,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/search_plugin.cgi b/search_plugin.cgi
index e3384fcce..5048f7ce6 100644
--- a/search_plugin.cgi
+++ b/search_plugin.cgi
@@ -16,7 +16,7 @@
# Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/show_activity.cgi b/show_activity.cgi
index e12787230..d2570f8b1 100755
--- a/show_activity.cgi
+++ b/show_activity.cgi
@@ -24,7 +24,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/show_bug.cgi b/show_bug.cgi
index 6aa314565..4e3aac982 100755
--- a/show_bug.cgi
+++ b/show_bug.cgi
@@ -22,7 +22,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/showattachment.cgi b/showattachment.cgi
index f535d5c9d..e90a01533 100755
--- a/showattachment.cgi
+++ b/showattachment.cgi
@@ -23,7 +23,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 30d7ebac1..f7977446e 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -23,7 +23,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use File::Temp;
diff --git a/showdependencytree.cgi b/showdependencytree.cgi
index 070986d5e..80e67716a 100755
--- a/showdependencytree.cgi
+++ b/showdependencytree.cgi
@@ -26,7 +26,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/sidebar.cgi b/sidebar.cgi
index 5619d6b40..35c4e64ad 100755
--- a/sidebar.cgi
+++ b/sidebar.cgi
@@ -17,7 +17,7 @@
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
diff --git a/summarize_time.cgi b/summarize_time.cgi
index df1297e5e..071f89a67 100755
--- a/summarize_time.cgi
+++ b/summarize_time.cgi
@@ -19,7 +19,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Date::Parse; # strptime
diff --git a/testserver.pl b/testserver.pl
index 6169a77e0..9b649277c 100755
--- a/testserver.pl
+++ b/testserver.pl
@@ -19,7 +19,7 @@
# issues as possible.
use strict;
-use lib ".";
+use lib qw(. lib);
BEGIN {
my $envpath = $ENV{'PATH'};
diff --git a/token.cgi b/token.cgi
index dd41e4665..a880d3294 100755
--- a/token.cgi
+++ b/token.cgi
@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/userprefs.cgi b/userprefs.cgi
index efe07921b..e2cc2e0ce 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -24,7 +24,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/votes.cgi b/votes.cgi
index 9805ae48e..9fe94484a 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -25,7 +25,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/whine.pl b/whine.pl
index a809025c0..963805be6 100755
--- a/whine.pl
+++ b/whine.pl
@@ -26,7 +26,7 @@
use strict;
-use lib ".";
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
diff --git a/whineatnews.pl b/whineatnews.pl
index 12a86cb6b..5c1ec655d 100755
--- a/whineatnews.pl
+++ b/whineatnews.pl
@@ -29,7 +29,7 @@
# touched for more than the number of days specified in the whinedays param.
use strict;
-use lib '.';
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Mailer;
diff --git a/xml.cgi b/xml.cgi
index 8316971c9..ce6a7c39b 100755
--- a/xml.cgi
+++ b/xml.cgi
@@ -24,7 +24,7 @@
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
my $cgi = Bugzilla->cgi;
diff --git a/xmlrpc.cgi b/xmlrpc.cgi
index c17cab86c..227815d26 100755
--- a/xmlrpc.cgi
+++ b/xmlrpc.cgi
@@ -16,7 +16,7 @@
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
use strict;
-use lib qw(.);
+use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;