Commit 3045a698 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Imported Bugzilla 2.6.

parent 44a0ae40
......@@ -192,7 +192,8 @@ sub value_quote {
}
sub navigation_header {
if (defined $::COOKIE{"BUGLIST"} && $::COOKIE{"BUGLIST"} ne "") {
if (defined $::COOKIE{"BUGLIST"} && $::COOKIE{"BUGLIST"} ne "" &&
defined $::FORM{'id'}) {
my @bugs = split(/:/, $::COOKIE{"BUGLIST"});
my $cur = lsearch(\@bugs, $::FORM{"id"});
print "<B>Bug List:</B> (@{[$cur + 1]} of @{[$#bugs + 1]})\n";
......@@ -220,6 +221,7 @@ sub make_options {
my $last = "";
my $popup = "";
my $found = 0;
$default = "" if !defined $default;
if ($src) {
foreach my $item (@$src) {
......@@ -281,7 +283,11 @@ sub quietly_check_login() {
if (defined $::COOKIE{"Bugzilla_login"} &&
defined $::COOKIE{"Bugzilla_logincookie"}) {
ConnectToDatabase();
SendSQL("select profiles.groupset, profiles.login_name = " .
if (!defined $ENV{'REMOTE_HOST'}) {
$ENV{'REMOTE_HOST'} = $ENV{'REMOTE_ADDR'};
}
SendSQL("select profiles.groupset, profiles.login_name, " .
"profiles.login_name = " .
SqlQuote($::COOKIE{"Bugzilla_login"}) .
" and profiles.cryptpassword = logincookies.cryptpassword " .
"and logincookies.hostname = " .
......@@ -291,9 +297,11 @@ sub quietly_check_login() {
" and profiles.userid = logincookies.userid");
my @row;
if (@row = FetchSQLData()) {
$loginok = $row[1];
$loginok = $row[2];
if ($loginok) {
$::usergroupset = $row[0];
$::COOKIE{"Bugzilla_login"} = $row[1]; # Makes sure case is in
# canonical form.
}
}
}
......@@ -308,16 +316,15 @@ sub quietly_check_login() {
sub CheckEmailSyntax {
my ($addr) = (@_);
if ($addr !~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
my $match = Param('emailregexp');
if ($addr !~ /$match/) {
print "Content-type: text/html\n\n";
print "<H1>Invalid e-mail address entered.</H1>\n";
print "The e-mail address you entered\n";
print "(<b>$addr</b>) didn't match our minimal\n";
print "syntax checking for a legal email address. A legal\n";
print "address must contain exactly one '\@', and at least one\n";
print "'.' after the \@, and may not contain any commas or.\n";
print "spaces.\n";
print "syntax checking for a legal email address.\n";
print Param('emailregexpdesc');
print "<p>Please click <b>back</b> and try again.\n";
exit;
}
......@@ -325,6 +332,40 @@ sub CheckEmailSyntax {
sub MailPassword {
my ($login, $password) = (@_);
my $urlbase = Param("urlbase");
my $template = "From: bugzilla-daemon
To: %s
Subject: Your bugzilla password.
To use the wonders of bugzilla, you can use the following:
E-mail address: %s
Password: %s
To change your password, go to:
${urlbase}changepassword.cgi
(Your bugzilla and CVS password, if any, are not currently synchronized.
Top hackers are working around the clock to fix this, as you read this.)
";
my $msg = sprintf($template, $login . Param('emailsuffix'),
$login, $password);
open SENDMAIL, "|/usr/lib/sendmail -t";
print SENDMAIL $msg;
close SENDMAIL;
print "Content-type: text/html\n\n";
print "<H1>Password has been emailed.</H1>\n";
print "The password for the e-mail address\n";
print "$login has been e-mailed to that address.\n";
print "<p>When the e-mail arrives, you can click <b>Back</b>\n";
print "and enter your password in the form there.\n";
}
sub confirm_login {
my ($nexturl) = (@_);
......@@ -344,41 +385,13 @@ sub confirm_login {
if (defined $::FORM{"PleaseMailAPassword"}) {
my $realpwd;
if ($realcryptpwd eq "") {
$realpwd = InsertNewUser($enteredlogin);
$realpwd = InsertNewUser($enteredlogin, "");
} else {
SendSQL("select password from profiles where login_name = " .
SqlQuote($enteredlogin));
$realpwd = FetchOneColumn();
}
my $urlbase = Param("urlbase");
my $template = "From: bugzilla-daemon
To: %s
Subject: Your bugzilla password.
To use the wonders of bugzilla, you can use the following:
E-mail address: %s
Password: %s
To change your password, go to:
${urlbase}changepassword.cgi
(Your bugzilla and CVS password, if any, are not currently synchronized.
Top hackers are working around the clock to fix this, as you read this.)
";
my $msg = sprintf($template, $enteredlogin, $enteredlogin,
$realpwd);
open SENDMAIL, "|/usr/lib/sendmail -t";
print SENDMAIL $msg;
close SENDMAIL;
print "Content-type: text/html\n\n";
print "<H1>Password has been emailed.</H1>\n";
print "The password for the e-mail address\n";
print "$enteredlogin has been e-mailed to that address.\n";
print "<p>When the e-mail arrives, you can click <b>Back</b>\n";
print "and enter your password in the form there.\n";
MailPassword($enteredlogin, $realpwd);
exit;
}
......@@ -391,6 +404,9 @@ To use the wonders of bugzilla, you can use the following:
exit;
}
$::COOKIE{"Bugzilla_login"} = $enteredlogin;
if (!defined $ENV{'REMOTE_HOST'}) {
$ENV{'REMOTE_HOST'} = $ENV{'REMOTE_ADDR'};
}
SendSQL("insert into logincookies (userid,cryptpassword,hostname) values (@{[DBNameToIdAndCheck($enteredlogin)]}, @{[SqlQuote($realcryptpwd)]}, @{[SqlQuote($ENV{'REMOTE_HOST'})]})");
SendSQL("select LAST_INSERT_ID()");
my $logincookie = FetchOneColumn();
......@@ -420,7 +436,7 @@ To use the wonders of bugzilla, you can use the following:
$nexturl = $&;
}
my $method = "POST";
if (defined $ENV{"REQUEST_METHOD"}) {
if (defined $ENV{"REQUEST_METHOD"} && length($::buffer) > 1) {
$method = $ENV{"REQUEST_METHOD"};
}
print "
......@@ -465,7 +481,7 @@ name=PleaseMailAPassword>
sub PutHeader {
my ($title, $h1, $h2) = (@_);
my ($title, $h1, $h2, $extra) = (@_);
if (!defined $h1) {
$h1 = $title;
......@@ -473,11 +489,14 @@ sub PutHeader {
if (!defined $h2) {
$h2 = "";
}
if (!defined $extra) {
$extra = "";
}
print "<HTML><HEAD>\n<TITLE>$title</TITLE>\n";
print Param("headerhtml") . "\n</HEAD>\n";
print "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"\n";
print "LINK=\"#0000EE\" VLINK=\"#551A8B\" ALINK=\"#FF0000\">\n";
print "LINK=\"#0000EE\" VLINK=\"#551A8B\" ALINK=\"#FF0000\" $extra>\n";
print PerformSubsts(Param("bannerhtml"), undef);
......@@ -500,6 +519,52 @@ sub PutHeader {
}
sub DumpBugActivity {
my ($id, $starttime) = (@_);
my $datepart = "";
if (defined $starttime) {
$datepart = "and bugs_activity.when >= $starttime";
}
my $query = "
select bugs_activity.field, bugs_activity.when,
bugs_activity.oldvalue, bugs_activity.newvalue,
profiles.login_name
from bugs_activity,profiles
where bugs_activity.bug_id = $id $datepart
and profiles.userid = bugs_activity.who
order by bugs_activity.when";
SendSQL($query);
print "<table border cellpadding=4>\n";
print "<tr>\n";
print " <th>Who</th><th>What</th><th>Old value</th><th>New value</th><th>When</th>\n";
print "</tr>\n";
my @row;
while (@row = FetchSQLData()) {
my ($field,$when,$old,$new,$who) = (@row);
$old = value_quote($old);
$new = value_quote($new);
if ($old eq "") {
$old = "&nbsp;";
}
if ($new eq "") {
$new = "&nbsp;";
}
print "<tr>\n";
print "<td>$who</td>\n";
print "<td>$field</td>\n";
print "<td>$old</td>\n";
print "<td>$new</td>\n";
print "<td>$when</td>\n";
print "</tr>\n";
}
print "</table>\n";
}
......
......@@ -10,6 +10,87 @@ query the CVS tree. For example,
will tell you what has been changed in the last week.
8/16/99 Added "OpenVMS" to the list of OS's. Feed this to mysql:
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "OpenVMS", "other") not null;
6/22/99 Added an entry to the attachments table to record who the submitter
was. Nothing uses this yet, but it still should be recorded.
alter table attachments add column submitter_id mediumint not null;
You should also run this script to populate the new field:
#!/usr/bonsaitools/bin/perl -w
use diagnostics;
use strict;
require "globals.pl";
$|=1;
ConnectToDatabase();
SendSQL("select bug_id, attach_id from attachments order by bug_id");
my @list;
while (MoreSQLData()) {
my @row = FetchSQLData();
push(@list, \@row);
}
foreach my $ref (@list) {
my ($bug, $attach) = (@$ref);
SendSQL("select long_desc from bugs where bug_id = $bug");
my $comment = FetchOneColumn() . "Created an attachment (id=$attach)";
if ($comment =~ m@-* Additional Comments From ([^ ]*)[- 0-9/:]*\nCreated an attachment \(id=$attach\)@) {
print "Found $1\n";
SendSQL("select userid from profiles where login_name=" .
SqlQuote($1));
my $userid = FetchOneColumn();
if (defined $userid && $userid > 0) {
SendSQL("update attachments set submitter_id=$userid where attach_id = $attach");
}
} else {
print "Bug $bug can't find comment for attachment $attach\n";
}
}
6/14/99 Added "BeOS" to the list of OS's. Feed this to mysql:
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "other") not null;
5/27/99 Added support for dependency information. You must run the new
"makedependenciestable.sh" script. You can turn off dependencies with the new
"usedependencies" param, but it defaults to being on. Also, read very
carefully the description for the new "webdotbase" param; you will almost
certainly need to tweak it.
5/24/99 Added "Mac System 8.6" and "Neutrino" to the list of OS's.
Feed this to mysql:
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "other") not null;
5/12/99 Added a pref to control how much email you get. This needs a new
column in the profiles table, so feed the following to mysql:
alter table profiles add column emailnotification enum("ExcludeSelfChanges", "CConly", "All") not null default "ExcludeSelfChanges";
5/5/99 Added the ability to search by creation date. To make this perform
well, you ought to do the following:
alter table bugs change column creation_ts creation_ts datetime not null, add index (creation_ts);
4/30/99 Added a new severity, "blocker". To get this into your running
Bugzilla, do the following:
alter table bugs change column bug_severity bug_severity enum("blocker", "critical", "major", "normal", "minor", "trivial", "enhancement") not null;
4/22/99 There was a bug where the long descriptions of bugs had a variety of
newline characters at the end, depending on the operating system of the browser
that submitted the text. This bug has been fixed, so that no further changes
......
/1x1.gif/1.1/Fri Apr 30 19:42:19 1999/-kb/
/CGI.pl/1.12/Fri Apr 30 19:42:19 1999//
/CHANGES/1.24/Fri Apr 30 19:42:20 1999//
/README/1.20/Fri Apr 30 19:42:20 1999//
/addcomponent.cgi/1.1/Fri Apr 30 19:42:20 1999//
/ant.jpg/1.2/Fri Apr 30 19:42:20 1999/-kb/
/backdoor.cgi/1.7/Fri Apr 30 19:42:20 1999//
/bug_form.pl/1.15/Fri Apr 30 19:42:20 1999//
/bug_status.html/1.4/Fri Apr 30 19:42:20 1999//
/buglist.cgi/1.28/Fri Apr 30 19:42:20 1999//
/changepassword.cgi/1.6/Fri Apr 30 19:42:20 1999//
/colchange.cgi/1.7/Fri Apr 30 19:42:20 1999//
/collectstats.pl/1.5/Fri Apr 30 19:42:20 1999//
/createaccount.cgi/1.1/Fri Apr 30 19:42:20 1999//
/createattachment.cgi/1.2/Fri Apr 30 19:42:20 1999//
/defparams.pl/1.8/Fri Apr 30 19:42:20 1999//
/describecomponents.cgi/1.1/Fri Apr 30 19:42:20 1999//
/doaddcomponent.cgi/1.1/Fri Apr 30 19:42:21 1999//
/doeditcomponents.cgi/1.1/Fri Apr 30 19:42:21 1999//
/doeditowners.cgi/1.4/Fri Apr 30 19:42:21 1999//
/doeditparams.cgi/1.6/Fri Apr 30 19:42:21 1999//
/editcomponents.cgi/1.2/Fri Apr 30 19:42:21 1999//
/editowners.cgi/1.4/Fri Apr 30 19:42:21 1999//
/editparams.cgi/1.8/Fri Apr 30 19:42:21 1999//
/enter_bug.cgi/1.17/Fri Apr 30 19:42:21 1999//
/help.html/1.1/Fri Apr 30 19:42:21 1999//
/helpemailquery.html/1.1/Fri Apr 30 19:42:21 1999//
/how_to_mail.html/1.1/Fri Apr 30 19:42:21 1999//
/index.html/1.4/Fri Apr 30 19:42:21 1999//
/long_list.cgi/1.6/Fri Apr 30 19:42:21 1999//
/makeactivitytable.sh/1.2/Fri Apr 30 19:42:22 1999//
/makeattachmenttable.sh/1.1/Fri Apr 30 19:42:22 1999//
/makebugtable.sh/1.9/Fri Apr 30 19:42:22 1999//
/makecctable.sh/1.2/Fri Apr 30 19:42:22 1999//
/makecomponenttable.sh/1.59/Fri Apr 30 19:42:22 1999//
/makegroupstable.sh/1.1/Fri Apr 30 19:42:22 1999//
/makelogincookiestable.sh/1.1/Fri Apr 30 19:42:22 1999//
/makeproducttable.sh/1.12/Fri Apr 30 19:42:22 1999//
/makeprofilestable.sh/1.3/Fri Apr 30 19:42:22 1999//
/makeversiontable.sh/1.13/Fri Apr 30 19:42:22 1999//
/new_comment.cgi/1.2/Fri Apr 30 19:42:23 1999//
/newquip.html/1.2/Fri Apr 30 19:42:23 1999//
/notargetmilestone.html/1.1/Fri Apr 30 19:42:23 1999//
/post_bug.cgi/1.6/Fri Apr 30 19:42:23 1999//
/process_bug.cgi/1.14/Fri Apr 30 19:42:23 1999//
/processmail/1.13/Fri Apr 30 19:42:23 1999//
/query.cgi/1.33/Fri Apr 30 19:42:23 1999//
/relogin.cgi/1.5/Fri Apr 30 19:42:23 1999//
/reports.cgi/1.10/Fri Apr 30 19:42:23 1999//
/sanitycheck.cgi/1.8/Fri Apr 30 19:42:23 1999//
/show_activity.cgi/1.2/Fri Apr 30 19:42:23 1999//
/show_bug.cgi/1.5/Fri Apr 30 19:42:23 1999//
/showattachment.cgi/1.1/Fri Apr 30 19:42:23 1999//
/whineatnews.pl/1.1/Fri Apr 30 19:42:23 1999//
/globals.pl/1.20/Fri Apr 30 19:42:25 1999//
/1x1.gif/1.1/Wed Aug 26 06:14:15 1998/-kb/
/CGI.pl/1.21/Fri Aug 27 17:17:29 1999//
/CHANGES/1.33/Mon Aug 16 23:54:50 1999//
/README/1.26/Tue Jun 29 00:24:40 1999//
/addcomponent.cgi/1.1/Wed Apr 28 22:23:04 1999//
/ant.jpg/1.2/Wed Aug 26 22:36:05 1998/-kb/
/backdoor.cgi/1.10/Wed May 12 05:22:34 1999//
/bug_form.pl/1.22/Mon Aug 30 14:26:09 1999//
/bug_status.html/1.6/Wed May 12 04:40:02 1999//
/buglist.cgi/1.41/Fri Aug 6 17:00:33 1999//
/changepassword.cgi/1.11/Fri Aug 27 17:17:43 1999//
/colchange.cgi/1.7/Wed Jan 27 21:17:07 1999//
/collectstats.pl/1.6/Tue May 4 00:01:57 1999//
/createaccount.cgi/1.3/Thu Aug 19 00:06:00 1999//
/createattachment.cgi/1.7/Wed Aug 4 17:36:43 1999//
/defparams.pl/1.16/Thu Aug 5 20:02:20 1999//
/describecomponents.cgi/1.2/Fri Jun 11 17:39:38 1999//
/doaddcomponent.cgi/1.2/Fri Jun 11 17:37:43 1999//
/doeditcomponents.cgi/1.1/Thu Mar 11 22:48:41 1999//
/doeditowners.cgi/1.4/Thu Mar 11 16:30:52 1999//
/doeditparams.cgi/1.6/Thu Mar 11 16:30:52 1999//
/editcomponents.cgi/1.2/Wed Apr 28 22:23:04 1999//
/editowners.cgi/1.4/Thu Mar 11 16:30:52 1999//
/editparams.cgi/1.8/Thu Mar 11 16:30:53 1999//
/enter_bug.cgi/1.23/Thu Jul 8 23:55:32 1999//
/help.html/1.2/Tue Jun 15 04:29:05 1999//
/helpemailquery.html/1.1/Tue Jan 19 00:07:45 1999//
/how_to_mail.html/1.1/Wed Aug 26 06:14:18 1998//
/index.html/1.6/Sun Jun 27 02:09:45 1999//
/long_list.cgi/1.7/Wed May 12 04:31:35 1999//
/makeactivitytable.sh/1.2/Tue Mar 23 22:32:21 1999//
/makeattachmenttable.sh/1.2/Tue Jun 22 23:44:22 1999//
/makebugtable.sh/1.15/Mon Aug 16 23:54:50 1999//
/makecctable.sh/1.2/Tue Jan 19 00:07:46 1999//
/makecomponenttable.sh/1.59/Fri Apr 30 19:40:51 1999//
/makedependenciestable.sh/1.1/Thu May 27 14:13:40 1999//
/makegroupstable.sh/1.1/Thu Mar 11 16:30:53 1999//
/makelogincookiestable.sh/1.1/Wed Sep 2 18:52:48 1998//
/makeproducttable.sh/1.12/Fri Apr 30 19:40:52 1999//
/makeprofilestable.sh/1.5/Tue May 25 17:59:39 1999//
/makeversiontable.sh/1.13/Fri Apr 30 19:40:53 1999//
/new_comment.cgi/1.2/Tue Sep 15 21:49:25 1998//
/newquip.html/1.2/Tue Sep 15 21:49:26 1998//
/notargetmilestone.html/1.1/Wed Feb 3 02:46:51 1999//
/post_bug.cgi/1.9/Thu Jul 8 00:21:33 1999//
/process_bug.cgi/1.21/Thu Jul 8 23:06:47 1999//
/processmail/1.22/Wed Aug 4 15:07:28 1999//
/query.cgi/1.42/Tue Aug 24 15:24:50 1999//
/relogin.cgi/1.6/Tue Jun 15 04:29:05 1999//
/reports.cgi/1.21/Sun Aug 29 15:42:12 1999//
/sanitycheck.cgi/1.9/Tue Jun 1 20:52:15 1999//
/show_activity.cgi/1.3/Tue May 25 19:22:31 1999//
/show_bug.cgi/1.8/Tue Jun 15 04:25:29 1999//
/showattachment.cgi/1.3/Mon May 24 19:08:59 1999//
/showdependencygraph.cgi/1.5/Thu May 27 20:20:57 1999//
/showdependencytree.cgi/1.3/Fri Aug 27 17:31:21 1999//
/showowners.cgi/1.2/Mon Jul 26 20:41:54 1999//
/whineatnews.pl/1.2/Fri Aug 13 17:10:01 1999//
/globals.pl/1.26/Mon Aug 30 23:02:02 1999//
D
/cvsroot/mozilla/webtools/bugzilla
mozilla/webtools/bugzilla
......@@ -52,13 +52,20 @@ build from sources you can easily set the dataDir as an option to configure.
you'll want to make sure to add mysqld to your init scripts so the server
daemon will come back up whenever your machine reboots.
You also may want to edit those init scripts, to make sure that mysqld will
accept large packets. By default, mysqld is set up to only accept packets up
to 64K long. This limits the size of attachments you may put on bugs. If you
add something like "-O max_allowed_packet=1M" to the command that starts mysqld
(or safe_mysqld), then you will be able to have attachments up to about 1
megabyte.
1.2. Perl (5.004 or greater)
Any machine that doesn't have perl on it is a sad machine indeed. Perl
for *nix systems can be gotten in source form from http://www.perl.com.
Perl is now a far cry from the the single compiler/interpreter binary it
once. It now includes a great many required modules and quite a few other
once was. It now includes a great many required modules and quite a few other
support files. If you're not up to or not inclined to build perl from source,
you'll want to install it on your machine using some sort of packaging system
(be it RPM, deb, or what have you) to ensure a sane install. In the subsequent
......@@ -125,11 +132,11 @@ provide backwards compatibility with the older MySQL packages; you must
answer YES to this question. The default will be no, and if you select it
things won't work later.
A host of 'localhost' should be fine and a testing user of 'test'
should find itself with sufficient access to run tests on the 'test'
database which MySQL created upon installation. If 'make test' and 'make
install' go through without errors you should be ready to go as far as
database connectivity is concerned.
A host of 'localhost' should be fine and a testing user of 'test' and
a null password should find itself with sufficient access to run tests on
the 'test' database which MySQL created upon installation. If 'make test'
and 'make install' go through without errors you should be ready to go as
far as database connectivity is concerned.
1.6. TimeDate Perl module collection
......@@ -164,10 +171,8 @@ listed in Appendix A.
1.9. HTTP server
You have a freedom of choice here - Apache, Netscape or any other server on
UNIX would do. The only thing - to make configuration easier you'd better run
HTTP daemon on the same machine that you run MySQL server on. (Theoretically,
it's possible to always use MySQL in a remote manner, but we don't know of
anyone who has done that with Bugzilla yet.)
UNIX would do. You can easily run the web server on a different machine than
MySQL, but that makes MySQL permissions harder to manage.
You'll want to make sure that your web server will run any file with the
.cgi extension as a cgi and not just display it. If you're using apache that
......@@ -199,12 +204,13 @@ directory writable by your webserver's user (which may require just
making it world writable). Inside this main bugzilla directory issue the
following commands:
mkdir data
cd data
touch comments
touch nomail
touch mail
Make sure the comments, nomail, and mail files are writable by the
webserver too.
Make sure the data directory and files are writable by the webserver.
Lastly, you'll need to set up a symbolic link from /usr/bonsaitools/bin
to the correct location of your perl executable (probably /usr/bin/perl). Or,
......@@ -223,20 +229,26 @@ that, too, then the magic is to do run "mysql mysql", and feed it commands like
this (replace all instances of HOSTNAME with the name of the machine mysql is
running on):
DELETE * FROM host;
DELETE * FROM user;
INSERT INTO host VALUES ('localhost','%','Y','Y','Y','Y','Y','Y');
INSERT INTO host VALUES (HOSTNAME,'%','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES (HOSTNAME,'','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES (HOSTNAME,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
DELETE FROM host;
DELETE FROM user;
INSERT INTO host VALUES ('localhost','%','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO host VALUES (HOSTNAME,'%','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES (HOSTNAME,'','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES (HOSTNAME,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
The number of 'Y' entries to use varies with the version of MySQL; they keep
adding columns. The list here should work with version 3.22.23b.
This run of "mysql mysql" may need some extra parameters to deal with whatever
database permissions were set up previously. In particular, you might have to say "mysql -uroot mysql", and give it an appropriate password.
For much more information about MySQL permissions, see the MySQL documentation.
After you've tweaked the permissions, run "mysqladmin reload" to make sure that
the database server knows to look at your new permission list.
Next we'll create the bugs database in MySQL. This is done using the
'mysql' command line client. This client allows one to funnel SQL
statements into the MySQL server directly. It's usage summary is
......@@ -253,29 +265,37 @@ should enter:
quit
To create the tables necessary for bug tracking and to minimally
populate the bug tracking system you'll need to run the eight shell
scripts found in your bugzilla directory that begin with 'make'. These
scripts load data into the database by piping input into the mysql
command.
When calling the eight scripts order doesn't matter, but this one is
fine:
command. Order does not matter, but this one is fine:
./makeactivitytable.sh
./makeattachmenttable.sh
./makebugtable.sh
./makecctable.sh
./makecomponenttable.sh
./makedependenciestable.sh
./makegroupstable.sh
./makelogincookiestable.sh
./makeproducttable.sh
./makeprofilestable.sh
./makeversiontable.sh
./makegroupstable.sh
After running those you've got a nearly empty copy of the mozilla bug
tracking setup.
You may want to edit the scripts; once bugs are entered it gets very hard to
make changes. Think carefully about how you want database users to describe bugs. Here's one
suggested alternative:
priority enum("P1", "P2", "P3", "P4", "defer") not null,
bug_severity enum("critical", "normal", "low", "---",
"enhancement", "requirement", "polish") not null,
op_sys enum("Unspecified", "Windows 3.1", "Windows 95", "Windows 98",
"Windows NT", "Mac System 7", "Mac System 8", "Linux",
"Solaris", "FreeBSD", "Other Unix", "other") not null,
rep_platform enum("Unspecified", "Apple", "PC Clone", "Sun", "other"),
After running the scripts you've got a nearly empty copy of the bug tracking setup.
4. Tweaking the Bugzilla->MySQL Connection Data
......@@ -286,7 +306,7 @@ code to connect appropriately.
In order for bugzilla to be able to connect to the MySQL database
you'll have to tell bugzilla where the database server is, what database
you're connecting to, and whom to connect as. Simply open up the
global.pl file in the bugzilla directory and find the line that begins
globals.pl file in the bugzilla directory and find the line that begins
like:
$::db = Mysql->Connect("
......@@ -300,7 +320,7 @@ takes four parameters which are (with appropriate values):
probably "nobody"
4. Password for the MySQL account in item 3.
Just fill in those values and close up global.pl
Just fill in those values and close up globals.pl
5. Setting up yourself as Maintainer
......@@ -313,9 +333,9 @@ mail, log in with it. Don't finish entering that new bug.
Now, bring up MySQL, and add yourself to every group. This will
effectively make you 'superuser'. The SQL to type is:
update profiles set groupset=0x7fffffffffffffff where login_name = XXX;
update profiles set groupset=0x7fffffffffffffff where login_name = 'XXX';
replacing XXX with your email address in quotes.
replacing XXX with your BugZilla email address.
Now, if you go to the query page (off of the bugzilla main menu) where you'll
now find a 'edit parameters' option which is filled with editable treats.
......@@ -341,6 +361,63 @@ command:
as a nightly entry to your crontab and after two days have passed you'll
be able to view bug graphs from the Bug Reports page.
8. Real security for MySQL
MySQL has "interesting" default security parameters:
mysqld defaults to running as root
it defaults to allowing external network connections
it has a known port number, and is easy to detect
it defaults to no passwords whatsoever
it defaults to allowing "File_Priv"
This means anyone from anywhere on the internet can not only drop the database
with one SQL command, and they can write as root to the system.
To see your permissions do:
> mysql -u root -p
use mysql;
show tables;