Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
04a0f6e7
Commit
04a0f6e7
authored
Feb 03, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 630750: Don't let "." and "lib" get into @INC when running under
mod_perl r=dkl, a=mkanat
parent
02d24f0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
mod_perl.pl
mod_perl.pl
+17
-0
No files found.
mod_perl.pl
View file @
04a0f6e7
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
Bugzilla::
ModPerl
;
package
Bugzilla::
ModPerl
;
use
strict
;
use
strict
;
use
warnings
;
# This sets up our libpath without having to specify it in the mod_perl
# This sets up our libpath without having to specify it in the mod_perl
# configuration.
# configuration.
...
@@ -90,6 +91,14 @@ my $rl = new ModPerl::RegistryLoader();
...
@@ -90,6 +91,14 @@ my $rl = new ModPerl::RegistryLoader();
# Bugzilla/ModPerl/ResponseHandler.pm
# Bugzilla/ModPerl/ResponseHandler.pm
$rl
->
{
package
}
=
'Bugzilla::ModPerl::ResponseHandler'
;
$rl
->
{
package
}
=
'Bugzilla::ModPerl::ResponseHandler'
;
my
$feature_files
=
Bugzilla::Install::Requirements::
map_files_to_features
();
my
$feature_files
=
Bugzilla::Install::Requirements::
map_files_to_features
();
# Prevent "use lib" from doing anything when the .cgi files are compiled.
# This is important to prevent the current directory from getting into
# @INC and messing things up. (See bug 630750.)
no
warnings
'redefine'
;
local
*
lib::
import
=
sub
{};
use
warnings
;
foreach
my
$file
(
glob
"$cgi_path/*.cgi"
)
{
foreach
my
$file
(
glob
"$cgi_path/*.cgi"
)
{
my
$base_filename
=
File::Basename::
basename
(
$file
);
my
$base_filename
=
File::Basename::
basename
(
$file
);
if
(
my
$feature
=
$feature_files
->
{
$base_filename
})
{
if
(
my
$feature
=
$feature_files
->
{
$base_filename
})
{
...
@@ -111,6 +120,14 @@ sub handler : method {
...
@@ -111,6 +120,14 @@ sub handler : method {
# here explicitly or init_page's shutdownhtml code won't work right.
# here explicitly or init_page's shutdownhtml code won't work right.
$0
=
$ENV
{
'SCRIPT_FILENAME'
};
$0
=
$ENV
{
'SCRIPT_FILENAME'
};
# Prevent "use lib" from modifying @INC in the case where a .cgi file
# is being automatically recompiled by mod_perl when Apache is
# running. (This happens if a file changes while Apache is already
# running.)
no
warnings
'redefine'
;
local
*
lib::
import
=
sub
{};
use
warnings
;
Bugzilla::
init_page
();
Bugzilla::
init_page
();
return
$class
->
SUPER::
handler
(
@_
);
return
$class
->
SUPER::
handler
(
@_
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment