Closed Bug 306760 Opened 19 years ago Closed 19 years ago

Bugzilla:Util is used (missing colon) - bz_crypt won't work

Categories

(Bugzilla :: Installation & Upgrading, defect)

2.20
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: robzilla, Assigned: mkanat)

Details

Attachments

(1 file, 2 obsolete files)

checksetup.pl uses bz_crypt in certain situations, which makes use of the line

   eval("use Bugzilla:Util");

However, this line fails silently, and if bz_crypt needs to be called, an error
will occur.

The fix is easy - just add the missing colon between Bugzilla and Util, but I'm
worried that we got this far without noticing.  Is there any way to see if the
"use" command failed?
Flags: blocking2.20?
I'm surprised that test-checksetup didn't catch that... Ah well, it's easy
enough to fix.
Flags: blocking2.20? → blocking2.20+
Target Milestone: --- → Bugzilla 2.20
Attached patch Fix the use and add a die (obsolete) β€” β€” Splinter Review
OK, here's a one-line patch that fixes the issue.
Assignee: installation → mkanat
Status: NEW → ASSIGNED
Attachment #194601 - Flags: review?(LpSolit)
Attachment #194601 - Flags: review?(LpSolit) → review+
When I apply this patch, checksetup dies (even with the correct "use"):

  Checking user setup ...
  Died at ./checksetup.pl line 1453.

Attachment #194601 - Flags: review-
Comment on attachment 194601 [details] [diff] [review]
Fix the use and add a die

Died at ./checksetup.pl line 1453.

Yup, sorry, right. checksetup.pl dies.
Attachment #194601 - Flags: review+ → review-
Attached patch Change it to a "require" (obsolete) β€” β€” Splinter Review
OK, I've changed it to use a "require" instead. I have no idea why it was
dying, but it was. ($! contained "Bad File Descriptor" but that might have been
from fixPerms or something else.)
Attachment #194601 - Attachment is obsolete: true
Attachment #194717 - Flags: review?(LpSolit)
Comment on attachment 194717 [details] [diff] [review]
Change it to a "require"

>-eval("use Bugzilla:Util");
>+require Bugzilla::Util;
>+import Bugzilla::Util qw(bz_crypt);

1491:	 (my $dbd_name = trim($my_db_driver)) =~ s/(\w+)/\u\L$1/g;
2003:	 $buffer = trim($buffer);
3441:		 $query_prod = "product=" . html_quote($product) . "&";

You have to import trim() and html_quote() too. Actually, globals.pl at line
1466 uses Bugzilla::Util, explaining why this syntax error has never been
caught and why bz_crypt() always worked as expected. But globals.pl is going to
die, and this problem will appear sooner or later. So let fix it now. My r+
with these two additional routines added.
Attachment #194717 - Flags: review?(LpSolit) → review-
Attached patch v3 β€” β€” Splinter Review
Thanks for catching that. :-) OK, all fixed.
Attachment #194717 - Attachment is obsolete: true
Attachment #195179 - Flags: review?(LpSolit)
Comment on attachment 195179 [details] [diff] [review]
v3

r=LpSolit for both tip and 2.20
Attachment #195179 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval2.20?
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
tip:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.436; previous revision: 1.435
done

2.20rc2:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.412.2.9; previous revision: 1.412.2.8
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: