Closed Bug 313255 Opened 19 years ago Closed 18 years ago

Move $::ENV{foo} and $::SIG{foo} out of globals.pl

Categories

(Bugzilla :: Bugzilla-General, defect)

2.21
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

I think we should move these variables in Bugzilla/CGI.pm, in the "BEGIN" block.
This module is called by Bugzilla.pm anyway, so there is no need to add "use
Bugzilla::CGI" in each .cgi scripts.
Target Milestone: --- → Bugzilla 2.22
The ENV stuff probably needs to go into Bugzilla.pm, since that's stuff for
dealing with taint mode.

The SIG stuff can definitely go into Bugzilla::CGI. But we need to avoid the
BEGIN block, since that doesn't work properly in mod_perl.
ENV stuff wants to go away :)

The SIG stuff is technically CGI specific - the response we want from a
commandline client may be different, in theory. Maybe.
Is this a bug you, mkanat or bbaetz, would like to fix? ;)
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Attached patch patch, v1Splinter Review
Is it as simple as that? AFAIK, $::ENV{'PATH'} is (was?) only needed by File::Find in checksetup.pl around lines 1270 and 1290 to compile templates. With $::ENV{'PATH'} being now undefined (Bugzilla.pm is called in the BEGIN block of checksetup.pl), it still seems to work correctly. Maybe this was only required in a old version of File::Find?
Attachment #225502 - Flags: review?(mkanat)
Comment on attachment 225502 [details] [diff] [review]
patch, v1

Yeah, this looks fine for now. When we actually implement mod_perl, setting those global variables probably won't work, but we can fix that then.
Attachment #225502 - Flags: review?(mkanat) → review+
Assignee: general → LpSolit
Flags: approval?
Flags: approval? → approval+
Checking in Bugzilla.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla.pm,v  <--  Bugzilla.pm
new revision: 1.34; previous revision: 1.33
done
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.485; previous revision: 1.484
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.368; previous revision: 1.367
done
Checking in Bugzilla/CGI.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/CGI.pm,v  <--  CGI.pm
new revision: 1.22; previous revision: 1.21
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
We should relnote that the $ENV{PATH}-deletion code has moved, because that could affect some contrib stuff or some other scripts. (For example, it affected test-checksetup.pl.)
Keywords: relnote
We should also relnote that PATH-deletion happens now at compile-time, instead of at runtime.
Blocks: 341454
Added to the release notes on bug 349423.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: