diff --git a/CGI.pl b/CGI.pl
index a4c94a868b2fc2c5c46232b813ee7e57b338d19b..6dd9e7ee73800b076997c059b9b01731742c1da5 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -109,10 +109,10 @@ sub ParseUrlString {
 	my $name;
 	my $value;
 	if ($item =~ /^([^=]*)=(.*)$/) {
-	    $name = $1;
+	    $name = url_decode($1);
 	    $value = url_decode($2);
 	} else {
-	    $name = $item;
+	    $name = url_decode($item);
 	    $value = "";
 	}
 	if ($value ne "") {
@@ -656,16 +656,13 @@ sub quietly_check_login() {
     if (defined $::COOKIE{"Bugzilla_login"} &&
 	defined $::COOKIE{"Bugzilla_logincookie"}) {
         ConnectToDatabase();
-        if (!defined $ENV{'REMOTE_HOST'}) {
-            $ENV{'REMOTE_HOST'} = $ENV{'REMOTE_ADDR'};
-        }
         SendSQL("SELECT profiles.userid, profiles.groupset, " .
                 "profiles.login_name, " .
                 "profiles.login_name = " .
 		SqlQuote($::COOKIE{"Bugzilla_login"}) .
 		" AND profiles.cryptpassword = logincookies.cryptpassword " .
-		"AND logincookies.hostname = " .
-		SqlQuote($ENV{"REMOTE_HOST"}) .
+		" AND logincookies.ipaddr = " .
+		SqlQuote($ENV{"REMOTE_ADDR"}) .
                 ", profiles.disabledtext " .
 		" FROM profiles, logincookies WHERE logincookies.cookie = " .
 		SqlQuote($::COOKIE{"Bugzilla_logincookie"}) .
@@ -945,10 +942,7 @@ sub confirm_login {
      # the cookies.
      if($enteredlogin ne "") {
        $::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("insert into logincookies (userid,cryptpassword,ipaddr) values (@{[DBNameToIdAndCheck($enteredlogin)]}, @{[SqlQuote($realcryptpwd)]}, @{[SqlQuote($ENV{'REMOTE_ADDR'})]})");
        SendSQL("select LAST_INSERT_ID()");
        my $logincookie = FetchOneColumn();
 
diff --git a/CVS/Entries b/CVS/Entries
index 31642fd230d293acfc337c906f164f5fa1cff5e3..5143a408f07dffb01f5fea02322d56204856f5b2 100644
--- a/CVS/Entries
+++ b/CVS/Entries
@@ -1,78 +1,78 @@
-/.cvsignore/1.4/Wed Jul 25 07:26:42 2001//TBUGZILLA-2_14_1
-/1x1.gif/1.1/Wed Aug 26 06:14:15 1998/-kb/TBUGZILLA-2_14_1
-/Bug.pm/1.6.6.1/Sat Nov 17 07:41:52 2001//TBUGZILLA-2_14_1
-/CGI.pl/1.100.2.1/Sun Dec  9 16:02:46 2001//TBUGZILLA-2_14_1
-/README/1.50/Sat Aug 11 19:56:40 2001//TBUGZILLA-2_14_1
-/RelationSet.pm/1.5/Fri Jun  1 02:14:23 2001//TBUGZILLA-2_14_1
-/Token.pm/1.3/Fri Aug 17 08:38:54 2001//TBUGZILLA-2_14_1
-/UPGRADING/1.1/Fri Aug 10 22:35:21 2001//TBUGZILLA-2_14_1
-/UPGRADING-pre-2.8/1.1/Fri Aug 10 22:35:22 2001//TBUGZILLA-2_14_1
-/ant.jpg/1.2/Wed Aug 26 22:36:05 1998/-kb/TBUGZILLA-2_14_1
-/booleanchart.html/1.3/Wed Aug 16 23:07:37 2000//TBUGZILLA-2_14_1
-/bug_form.pl/1.70.2.2/Sun Dec  9 20:23:31 2001//TBUGZILLA-2_14_1
-/bug_status.html/1.11/Mon Aug 28 17:48:56 2000//TBUGZILLA-2_14_1
-/buglist.cgi/1.139.2.2/Sun Dec 30 05:41:44 2001//TBUGZILLA-2_14_1
-/bugwritinghelp.html/1.1/Tue Mar  7 17:59:38 2000//TBUGZILLA-2_14_1
-/bugzilla.dtd/1.2/Fri May 26 06:34:45 2000//TBUGZILLA-2_14_1
-/changepassword.cgi/1.19/Tue Jan 25 07:53:29 2000//TBUGZILLA-2_14_1
-/checksetup.pl/1.99/Sun Aug 19 18:26:21 2001//TBUGZILLA-2_14_1
-/colchange.cgi/1.17/Fri Jun  1 02:07:28 2001//TBUGZILLA-2_14_1
-/collectstats.pl/1.20/Wed Jun  6 21:17:40 2001//TBUGZILLA-2_14_1
-/confirmhelp.html/1.2/Mon Aug 28 17:48:58 2000//TBUGZILLA-2_14_1
-/createaccount.cgi/1.11/Wed Jul 11 05:29:18 2001//TBUGZILLA-2_14_1
-/createattachment.cgi/1.13/Tue Apr  3 20:42:58 2001//TBUGZILLA-2_14_1
-/defparams.pl/1.56/Sat Aug 25 00:12:12 2001//TBUGZILLA-2_14_1
-/describecomponents.cgi/1.6/Wed Jun  6 04:32:45 2001//TBUGZILLA-2_14_1
-/describekeywords.cgi/1.4/Sat Jan 22 16:51:49 2000//TBUGZILLA-2_14_1
-/doeditparams.cgi/1.15/Mon Aug 13 19:11:33 2001//TBUGZILLA-2_14_1
-/doeditvotes.cgi/1.12.2.1/Mon Nov 26 04:53:28 2001//TBUGZILLA-2_14_1
-/duplicates.cgi/1.13/Tue Aug 21 00:36:54 2001//TBUGZILLA-2_14_1
-/editcomponents.cgi/1.17/Sat Jun 16 14:51:15 2001//TBUGZILLA-2_14_1
-/editgroups.cgi/1.12/Wed Jun  6 03:16:49 2001//TBUGZILLA-2_14_1
-/editkeywords.cgi/1.7/Mon Feb 26 23:25:22 2001//TBUGZILLA-2_14_1
-/editmilestones.cgi/1.5/Sat Jun 16 14:51:16 2001//TBUGZILLA-2_14_1
-/editparams.cgi/1.12/Mon Aug 13 19:11:33 2001//TBUGZILLA-2_14_1
-/editproducts.cgi/1.18/Sat Jun 16 14:51:16 2001//TBUGZILLA-2_14_1
-/editusers.cgi/1.23.2.1/Sat Nov 17 08:18:33 2001//TBUGZILLA-2_14_1
-/editversions.cgi/1.8/Tue Jun 19 01:37:02 2001//TBUGZILLA-2_14_1
-/enter_bug.cgi/1.50/Sun Jul  1 02:00:56 2001//TBUGZILLA-2_14_1
-/globals.pl/1.110.2.2/Thu Jan  3 06:15:55 2002//TBUGZILLA-2_14_1
-/help.html/1.4/Fri Jan 21 22:01:11 2000//TBUGZILLA-2_14_1
-/helpemailquery.html/1.1/Tue Jan 19 00:07:45 1999//TBUGZILLA-2_14_1
-/how_to_mail.html/1.2/Mon Nov  1 23:33:16 1999//TBUGZILLA-2_14_1
-/importxml.pl/1.18/Wed Jul 25 20:12:00 2001//TBUGZILLA-2_14_1
-/index.html/1.12/Wed Feb 28 23:07:24 2001//TBUGZILLA-2_14_1
-/localconfig.js/1.1/Wed Feb 28 23:07:25 2001//TBUGZILLA-2_14_1
-/long_list.cgi/1.15.2.1/Sat Nov 17 08:34:46 2001//TBUGZILLA-2_14_1
-/move.pl/1.6/Fri Jul 20 15:18:30 2001//TBUGZILLA-2_14_1
-/new_comment.cgi/1.5/Thu Jul 27 20:10:16 2000//TBUGZILLA-2_14_1
-/notargetmilestone.html/1.2/Mon Aug 28 17:48:59 2000//TBUGZILLA-2_14_1
-/post_bug.cgi/1.34.2.1/Sat Nov 17 08:01:54 2001//TBUGZILLA-2_14_1
-/process_bug.cgi/1.96.2.1/Sat Nov 17 07:54:18 2001//TBUGZILLA-2_14_1
-/processmail/1.68/Mon Aug 13 17:06:38 2001//TBUGZILLA-2_14_1
-/query.cgi/1.85/Mon Aug 13 19:11:35 2001//TBUGZILLA-2_14_1
-/queryhelp.cgi/1.4/Mon Apr 23 22:16:12 2001//TBUGZILLA-2_14_1
-/quicksearch.html/1.1/Wed Feb 28 23:07:26 2001//TBUGZILLA-2_14_1
-/quicksearch.js/1.7/Fri Jul 20 08:25:30 2001//TBUGZILLA-2_14_1
-/quicksearchhack.html/1.2/Wed Feb 28 23:08:52 2001//TBUGZILLA-2_14_1
-/quips.cgi/1.1/Tue May 29 04:01:48 2001//TBUGZILLA-2_14_1
-/relogin.cgi/1.10/Tue Jan 18 14:41:00 2000//TBUGZILLA-2_14_1
-/reports.cgi/1.47/Sun Jul  1 19:09:29 2001//TBUGZILLA-2_14_1
-/robots.txt/1.1/Fri Jul 28 21:28:39 2000//TBUGZILLA-2_14_1
-/runtests.sh/1.4.6.1/Sat Nov 17 07:41:52 2001//TBUGZILLA-2_14_1
-/sanitycheck.cgi/1.33/Wed Jul 11 05:29:20 2001//TBUGZILLA-2_14_1
-/show_activity.cgi/1.6/Fri Jun  1 13:38:01 2001//TBUGZILLA-2_14_1
-/show_bug.cgi/1.15/Sat Jun  2 22:02:02 2001//TBUGZILLA-2_14_1
-/showattachment.cgi/1.7/Wed Jun  6 18:36:25 2001//TBUGZILLA-2_14_1
-/showdependencygraph.cgi/1.10/Thu May 31 15:52:24 2001//TBUGZILLA-2_14_1
-/showdependencytree.cgi/1.8/Thu May 31 15:52:24 2001//TBUGZILLA-2_14_1
-/showvotes.cgi/1.9/Thu May 31 15:52:25 2001//TBUGZILLA-2_14_1
-/syncshadowdb/1.12/Sun Jun 10 17:38:15 2001//TBUGZILLA-2_14_1
-/token.cgi/1.2/Fri Aug 17 12:42:34 2001//TBUGZILLA-2_14_1
-/userprefs.cgi/1.20.2.1/Sat Nov 17 08:24:08 2001//TBUGZILLA-2_14_1
-/votehelp.html/1.5/Thu Jan 25 04:56:14 2001//TBUGZILLA-2_14_1
-/whineatnews.pl/1.4/Mon Nov  1 23:33:22 1999//TBUGZILLA-2_14_1
-/xml.cgi/1.2/Mon Jun 12 06:52:41 2000//TBUGZILLA-2_14_1
+/.cvsignore/1.4/Wed Jul 25 07:26:42 2001//TBUGZILLA-2_14_2
+/1x1.gif/1.1/Wed Aug 26 06:14:15 1998/-kb/TBUGZILLA-2_14_2
+/Bug.pm/1.6.6.1/Sat Nov 17 07:41:52 2001//TBUGZILLA-2_14_2
+/CGI.pl/1.100.2.3/Mon Jun  3 23:04:44 2002//TBUGZILLA-2_14_2
+/README/1.50/Sat Aug 11 19:56:40 2001//TBUGZILLA-2_14_2
+/RelationSet.pm/1.5/Fri Jun  1 02:14:23 2001//TBUGZILLA-2_14_2
+/Token.pm/1.3/Fri Aug 17 08:38:54 2001//TBUGZILLA-2_14_2
+/UPGRADING/1.1/Fri Aug 10 22:35:21 2001//TBUGZILLA-2_14_2
+/UPGRADING-pre-2.8/1.1/Fri Aug 10 22:35:22 2001//TBUGZILLA-2_14_2
+/ant.jpg/1.2/Wed Aug 26 22:36:05 1998/-kb/TBUGZILLA-2_14_2
+/booleanchart.html/1.3/Wed Aug 16 23:07:37 2000//TBUGZILLA-2_14_2
+/bug_form.pl/1.70.2.4/Tue May 28 04:01:20 2002//TBUGZILLA-2_14_2
+/bug_status.html/1.11/Mon Aug 28 17:48:56 2000//TBUGZILLA-2_14_2
+/buglist.cgi/1.139.2.3/Fri Jun  7 23:31:40 2002//TBUGZILLA-2_14_2
+/bugwritinghelp.html/1.1/Tue Mar  7 17:59:38 2000//TBUGZILLA-2_14_2
+/bugzilla.dtd/1.2/Fri May 26 06:34:45 2000//TBUGZILLA-2_14_2
+/changepassword.cgi/1.19/Tue Jan 25 07:53:29 2000//TBUGZILLA-2_14_2
+/checksetup.pl/1.99.2.1/Mon May 13 15:05:41 2002//TBUGZILLA-2_14_2
+/colchange.cgi/1.17/Fri Jun  1 02:07:28 2001//TBUGZILLA-2_14_2
+/collectstats.pl/1.20/Wed Jun  6 21:17:40 2001//TBUGZILLA-2_14_2
+/confirmhelp.html/1.2/Mon Aug 28 17:48:58 2000//TBUGZILLA-2_14_2
+/createaccount.cgi/1.11/Wed Jul 11 05:29:18 2001//TBUGZILLA-2_14_2
+/createattachment.cgi/1.13/Tue Apr  3 20:42:58 2001//TBUGZILLA-2_14_2
+/defparams.pl/1.56.2.1/Sat May 25 20:43:49 2002//TBUGZILLA-2_14_2
+/describecomponents.cgi/1.6/Wed Jun  6 04:32:45 2001//TBUGZILLA-2_14_2
+/describekeywords.cgi/1.4/Sat Jan 22 16:51:49 2000//TBUGZILLA-2_14_2
+/doeditparams.cgi/1.15/Mon Aug 13 19:11:33 2001//TBUGZILLA-2_14_2
+/doeditvotes.cgi/1.12.2.1/Mon Nov 26 04:53:28 2001//TBUGZILLA-2_14_2
+/duplicates.cgi/1.13/Tue Aug 21 00:36:54 2001//TBUGZILLA-2_14_2
+/editcomponents.cgi/1.17/Sat Jun 16 14:51:15 2001//TBUGZILLA-2_14_2
+/editgroups.cgi/1.12/Wed Jun  6 03:16:49 2001//TBUGZILLA-2_14_2
+/editkeywords.cgi/1.7/Mon Feb 26 23:25:22 2001//TBUGZILLA-2_14_2
+/editmilestones.cgi/1.5/Sat Jun 16 14:51:16 2001//TBUGZILLA-2_14_2
+/editparams.cgi/1.12/Mon Aug 13 19:11:33 2001//TBUGZILLA-2_14_2
+/editproducts.cgi/1.18/Sat Jun 16 14:51:16 2001//TBUGZILLA-2_14_2
+/editusers.cgi/1.23.2.3/Wed May 29 18:13:34 2002//TBUGZILLA-2_14_2
+/editversions.cgi/1.8/Tue Jun 19 01:37:02 2001//TBUGZILLA-2_14_2
+/enter_bug.cgi/1.50/Sun Jul  1 02:00:56 2001//TBUGZILLA-2_14_2
+/globals.pl/1.110.2.7/Mon Jun  3 13:34:29 2002//TBUGZILLA-2_14_2
+/help.html/1.4/Fri Jan 21 22:01:11 2000//TBUGZILLA-2_14_2
+/helpemailquery.html/1.1/Tue Jan 19 00:07:45 1999//TBUGZILLA-2_14_2
+/how_to_mail.html/1.2/Mon Nov  1 23:33:16 1999//TBUGZILLA-2_14_2
+/importxml.pl/1.18.2.1/Sat May 25 20:43:51 2002//TBUGZILLA-2_14_2
+/index.html/1.12/Wed Feb 28 23:07:24 2001//TBUGZILLA-2_14_2
+/localconfig.js/1.1/Wed Feb 28 23:07:25 2001//TBUGZILLA-2_14_2
+/long_list.cgi/1.15.2.1/Sat Nov 17 08:34:46 2001//TBUGZILLA-2_14_2
+/move.pl/1.6.10.1/Sat May 25 20:43:51 2002//TBUGZILLA-2_14_2
+/new_comment.cgi/1.5/Thu Jul 27 20:10:16 2000//TBUGZILLA-2_14_2
+/notargetmilestone.html/1.2/Mon Aug 28 17:48:59 2000//TBUGZILLA-2_14_2
+/post_bug.cgi/1.34.2.1/Sat Nov 17 08:01:54 2001//TBUGZILLA-2_14_2
+/process_bug.cgi/1.96.2.2/Tue May 28 04:32:38 2002//TBUGZILLA-2_14_2
+/processmail/1.68/Mon Aug 13 17:06:38 2001//TBUGZILLA-2_14_2
+/query.cgi/1.85/Mon Aug 13 19:11:35 2001//TBUGZILLA-2_14_2
+/queryhelp.cgi/1.4.2.1/Sat May 11 10:01:29 2002//TBUGZILLA-2_14_2
+/quicksearch.html/1.1/Wed Feb 28 23:07:26 2001//TBUGZILLA-2_14_2
+/quicksearch.js/1.7/Fri Jul 20 08:25:30 2001//TBUGZILLA-2_14_2
+/quicksearchhack.html/1.2/Wed Feb 28 23:08:52 2001//TBUGZILLA-2_14_2
+/quips.cgi/1.1/Tue May 29 04:01:48 2001//TBUGZILLA-2_14_2
+/relogin.cgi/1.10/Tue Jan 18 14:41:00 2000//TBUGZILLA-2_14_2
+/reports.cgi/1.47/Sun Jul  1 19:09:29 2001//TBUGZILLA-2_14_2
+/robots.txt/1.1/Fri Jul 28 21:28:39 2000//TBUGZILLA-2_14_2
+/runtests.sh/1.4.6.1/Sat Nov 17 07:41:52 2001//TBUGZILLA-2_14_2
+/sanitycheck.cgi/1.33/Wed Jul 11 05:29:20 2001//TBUGZILLA-2_14_2
+/show_activity.cgi/1.6/Fri Jun  1 13:38:01 2001//TBUGZILLA-2_14_2
+/show_bug.cgi/1.15/Sat Jun  2 22:02:02 2001//TBUGZILLA-2_14_2
+/showattachment.cgi/1.7/Wed Jun  6 18:36:25 2001//TBUGZILLA-2_14_2
+/showdependencygraph.cgi/1.10/Thu May 31 15:52:24 2001//TBUGZILLA-2_14_2
+/showdependencytree.cgi/1.8/Thu May 31 15:52:24 2001//TBUGZILLA-2_14_2
+/showvotes.cgi/1.9/Thu May 31 15:52:25 2001//TBUGZILLA-2_14_2
+/syncshadowdb/1.12/Sun Jun 10 17:38:15 2001//TBUGZILLA-2_14_2
+/token.cgi/1.2/Fri Aug 17 12:42:34 2001//TBUGZILLA-2_14_2
+/userprefs.cgi/1.20.2.1/Sat Nov 17 08:24:08 2001//TBUGZILLA-2_14_2
+/votehelp.html/1.5/Thu Jan 25 04:56:14 2001//TBUGZILLA-2_14_2
+/whineatnews.pl/1.4/Mon Nov  1 23:33:22 1999//TBUGZILLA-2_14_2
+/xml.cgi/1.2/Mon Jun 12 06:52:41 2000//TBUGZILLA-2_14_2
 D/contrib////
 D/docs////
 D/t////
diff --git a/CVS/Entries.Log b/CVS/Entries.Log
new file mode 100644
index 0000000000000000000000000000000000000000..469788113d83d1766813f6ee07f353b98b41b4af
--- /dev/null
+++ b/CVS/Entries.Log
@@ -0,0 +1,8 @@
+A D/Conf////
+A D/css////
+A D/oracle////
+A D/template////
+R D/template////
+R D/oracle////
+R D/css////
+R D/Conf////
diff --git a/CVS/Tag b/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/CVS/Tag
+++ b/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/bug_form.pl b/bug_form.pl
index 4ffb82f757d5588db56ca1f66b30517dd0b86e91..1100ba9b047c7f593486c8562b261a73433cb1b0 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -202,7 +202,7 @@ print "
     <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></TD>
     <TD><SELECT NAME=rep_platform>$platform_popup</SELECT></TD>
   <TD>&nbsp;</TD>
-    <TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'}</TD>
+    <TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>" . html_quote($bug{'reporter'}) . "</TD>
 </TR><TR>
     <TD ALIGN=RIGHT><B>Product:</B></TD>
     <TD>$product_popup</TD>
@@ -243,7 +243,7 @@ print "
 </TR><TR>
     <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To:
         </A></B></TD>
-      <TD>$bug{'assigned_to'}</TD>
+      <TD>" . html_quote($bug{'assigned_to'}) . "</TD>
   <TD>&nbsp;</TD>";
 
 if (Param("usetargetmilestone")) {
diff --git a/buglist.cgi b/buglist.cgi
index 0a6aa2b3a2c1676aa6581500a21e137f6d46650f..d6e98fdd1cfb0e5beefd9370aa0f3b37332e0c9e 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -1051,10 +1051,11 @@ ReconnectToShadowDatabase();
 my $query = GenerateSQL(\@fields, undef, undef, $::buffer);
 
 
-
+my $order_from_cookie = 0;
 if ($::COOKIE{'LASTORDER'}) {
     if ((!$::FORM{'order'}) || $::FORM{'order'} =~ /^reuse/i) {
         $::FORM{'order'} = url_decode($::COOKIE{'LASTORDER'});
+        $order_from_cookie = 1;
     }
 }
 
@@ -1068,7 +1069,21 @@ if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
 
     ORDER: for ($::FORM{'order'}) {
         /\./ && do {
-            # This (hopefully) already has fieldnames in it, so we're done.
+            # A custom list of columns.  Make sure each column is valid.
+            foreach my $fragment (split(/,/, $::FORM{'order'})) {
+                my $ident_iregexp = "[a-z_][0-9a-z_]*";
+                if (trim($fragment) !~ /^${ident_iregexp}\.${ident_iregexp}(\s+(asc|desc))?$/i) {
+                    my $qfragment = html_quote($fragment);
+                    my $error = "The custom sort order you specified in your "
+                              . "form submission contains an invalid column "
+                              . "descriptor <em>$qfragment</em>.";
+                    if ($order_from_cookie) {
+                        $error =~ s/form submission/cookie/;
+                    }
+                    DisplayError($error);
+                    exit;
+                }
+            }
             last ORDER;
         };
         /Number/ && do {
diff --git a/checksetup.pl b/checksetup.pl
index 4c3ab81d3cec8b4ab9427a135d990b1ce9659b1a..64a275d8bb9ee9c974038da1668a3a0864ad80af 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -992,7 +992,7 @@ $table{logincookies} =
    'cookie mediumint not null auto_increment primary key,
     userid mediumint not null,
     cryptpassword varchar(34),
-    hostname varchar(128),
+    ipaddr varchar(40) NOT NULL,
     lastused timestamp,
 
     index(lastused)';
@@ -2470,6 +2470,18 @@ AddField("bugs", "assignee_accessible", "tinyint not null default 1");
 AddField("bugs", "qacontact_accessible", "tinyint not null default 1");
 AddField("bugs", "cclist_accessible", "tinyint not null default 1");
 
+# 2002-03-15 bbaetz@student.usyd.edu.au - bug 129466; 
+# 2002-05-13 2_14_1-BRANCH backport - preed@sigkill.com
+# Use the ip, not the hostname, in the logincookies table
+if (GetFieldDef("logincookies", "hostname")) {
+    # We've changed what we match against, so all entries are now invalid
+    $dbh->do("DELETE FROM logincookies");
+
+    # Now update the logincookies schema
+    DropField("logincookies", "hostname");
+    AddField("logincookies", "ipaddr", "varchar(40) NOT NULL");
+}
+
 # If you had to change the --TABLE-- definition in any way, then add your
 # differential change code *** A B O V E *** this comment.
 #
diff --git a/contrib/CVS/Entries b/contrib/CVS/Entries
index e5ac2507a5bd5a0b77924c7188012239113d822d..3f1ac68e641163dc5c4a7477e6fa923fb5bcbaed 100644
--- a/contrib/CVS/Entries
+++ b/contrib/CVS/Entries
@@ -1,12 +1,12 @@
-/BugzillaEmail.pm/1.1/Wed Mar 15 22:29:44 2000//TBUGZILLA-2_14_1
-/README/1.4/Sun Apr 22 18:13:40 2001//TBUGZILLA-2_14_1
-/README.Mailif/1.3/Wed Mar 15 23:39:03 2000//TBUGZILLA-2_14_1
-/bug_email.pl/1.9/Fri May 25 12:48:47 2001//TBUGZILLA-2_14_1
-/bugmail_help.html/1.1/Tue Mar  7 17:36:48 2000//TBUGZILLA-2_14_1
-/bugzilla.procmailrc/1.1/Wed Mar 15 23:39:09 2000//TBUGZILLA-2_14_1
-/bugzilla_email_append.pl/1.2/Wed Mar 15 23:39:11 2000//TBUGZILLA-2_14_1
-/cvs-update.sh/1.1/Wed Apr 18 18:01:28 2001//TBUGZILLA-2_14_1
-/gnats2bz.pl/1.5/Thu Nov 18 17:29:58 1999//TBUGZILLA-2_14_1
-/mysqld-watcher.pl/1.2/Fri Jun  1 08:34:45 2001//TBUGZILLA-2_14_1
-/yp_nomail.sh/1.1/Tue Sep 12 23:50:31 2000//TBUGZILLA-2_14_1
+/BugzillaEmail.pm/1.1/Wed Mar 15 22:29:44 2000//TBUGZILLA-2_14_2
+/README/1.4/Sun Apr 22 18:13:40 2001//TBUGZILLA-2_14_2
+/README.Mailif/1.3/Wed Mar 15 23:39:03 2000//TBUGZILLA-2_14_2
+/bug_email.pl/1.9/Fri May 25 12:48:47 2001//TBUGZILLA-2_14_2
+/bugmail_help.html/1.1/Tue Mar  7 17:36:48 2000//TBUGZILLA-2_14_2
+/bugzilla.procmailrc/1.1/Wed Mar 15 23:39:09 2000//TBUGZILLA-2_14_2
+/bugzilla_email_append.pl/1.2/Wed Mar 15 23:39:11 2000//TBUGZILLA-2_14_2
+/cvs-update.sh/1.1/Wed Apr 18 18:01:28 2001//TBUGZILLA-2_14_2
+/gnats2bz.pl/1.5/Thu Nov 18 17:29:58 1999//TBUGZILLA-2_14_2
+/mysqld-watcher.pl/1.2/Fri Jun  1 08:34:45 2001//TBUGZILLA-2_14_2
+/yp_nomail.sh/1.1/Tue Sep 12 23:50:31 2000//TBUGZILLA-2_14_2
 D
diff --git a/contrib/CVS/Tag b/contrib/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/contrib/CVS/Tag
+++ b/contrib/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/defparams.pl b/defparams.pl
index 46a00b78f149b2470ac055e691fbb780bea14929..071d41c8de6b4333ff8192548c5e30ba24ca1909 100644
--- a/defparams.pl
+++ b/defparams.pl
@@ -54,8 +54,6 @@ sub WriteParams {
             }
 	}
     }
-    mkdir("data", 0777);
-    chmod 0777, "data";
     my $tmpname = "data/params.$$";
     open(FID, ">$tmpname") || die "Can't create $tmpname";
     my $v = $::param{'version'};
@@ -66,7 +64,7 @@ sub WriteParams {
     print FID "1;\n";
     close FID;
     rename $tmpname, "data/params" || die "Can't rename $tmpname to data/params";
-    chmod 0666, "data/params";
+    ChmodDataFile('data/params', 0666);
 }
     
 
diff --git a/docs/CVS/Entries b/docs/CVS/Entries
index f633eb61d9a3e88846e69282358e7a4e79ef7fec..5e60886a3ab423bc7a86779047843d9ac28192bd 100644
--- a/docs/CVS/Entries
+++ b/docs/CVS/Entries
@@ -1,6 +1,6 @@
-/README.docs/1.3/Wed Aug 22 03:44:14 2001//TBUGZILLA-2_14_1
+/README.docs/1.3/Wed Aug 22 03:44:14 2001//TBUGZILLA-2_14_2
+/rel_notes.txt/1.5.10.6/Fri Jun  7 23:45:33 2002//TBUGZILLA-2_14_2
 D/html////
 D/images////
 D/sgml////
 D/txt////
-/rel_notes.txt/1.5.10.1/Sat Jan  5 20:00:50 2002//TBUGZILLA-2_14_1
diff --git a/docs/CVS/Tag b/docs/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/docs/CVS/Tag
+++ b/docs/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/docs/html/CVS/Entries b/docs/html/CVS/Entries
index 7c8ef0531f9432cb754646849794b196de823299..dd87c980c7e7c2504f68c13c9011bb1606f1e8b5 100644
--- a/docs/html/CVS/Entries
+++ b/docs/html/CVS/Entries
@@ -1,70 +1,70 @@
-/Bugzilla-Guide.html/1.9/Wed Aug 29 18:13:38 2001//TBUGZILLA-2_14_1
-/about.html/1.4/Fri Aug 10 22:26:40 2001//TBUGZILLA-2_14_1
-/aboutthisguide.html/1.6/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_1
-/administration.html/1.5/Wed Aug 22 03:44:17 2001//TBUGZILLA-2_14_1
-/bonsai.html/1.5/Wed Aug 22 03:44:17 2001//TBUGZILLA-2_14_1
-/bsdinstall.html/1.1/Fri Aug 10 22:26:42 2001//TBUGZILLA-2_14_1
-/bzhacking.html/1.1/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_1
-/cmdline.html/1.5/Wed Aug 22 03:44:18 2001//TBUGZILLA-2_14_1
-/contributors.html/1.5/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_1
-/conventions.html/1.5/Wed Aug 22 03:44:18 2001//TBUGZILLA-2_14_1
-/copyright.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_1
-/credits.html/1.5/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_1
-/cvs.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_1
-/database.html/1.4/Fri Aug 10 22:26:44 2001//TBUGZILLA-2_14_1
-/dbdoc.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_1
-/dbschema.html/1.5/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_1
-/disclaimer.html/1.4/Fri Aug 10 22:26:46 2001//TBUGZILLA-2_14_1
-/downloadlinks.html/1.3/Fri Aug 10 22:26:46 2001//TBUGZILLA-2_14_1
-/errata.html/1.1/Fri Aug 10 22:26:47 2001//TBUGZILLA-2_14_1
-/faq.html/1.7/Wed Aug 29 17:25:27 2001//TBUGZILLA-2_14_1
-/feedback.html/1.4/Fri Aug 10 22:26:48 2001//TBUGZILLA-2_14_1
-/future.html/1.6/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/geninstall.html/1.3/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/gfdl.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/gfdl_0.html/1.4/Fri Aug 10 22:26:49 2001//TBUGZILLA-2_14_1
-/gfdl_1.html/1.4/Fri Aug 10 22:26:49 2001//TBUGZILLA-2_14_1
-/gfdl_10.html/1.4/Fri Aug 10 22:26:50 2001//TBUGZILLA-2_14_1
-/gfdl_2.html/1.4/Fri Aug 10 22:26:50 2001//TBUGZILLA-2_14_1
-/gfdl_3.html/1.4/Fri Aug 10 22:26:51 2001//TBUGZILLA-2_14_1
-/gfdl_4.html/1.4/Fri Aug 10 22:26:51 2001//TBUGZILLA-2_14_1
-/gfdl_5.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_1
-/gfdl_6.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_1
-/gfdl_7.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_1
-/gfdl_8.html/1.4/Fri Aug 10 22:26:53 2001//TBUGZILLA-2_14_1
-/gfdl_9.html/1.4/Fri Aug 10 22:26:53 2001//TBUGZILLA-2_14_1
-/gfdl_howto.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/glossary.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/granttables.html/1.6/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_1
-/how.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/index.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/init4me.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_1
-/installation.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/integration.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_1
-/newversions.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_1
-/osx.html/1.1/Fri Aug 10 22:26:58 2001//TBUGZILLA-2_14_1
-/patches.html/1.6/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/postinstall-check.html/1.5/Wed Aug 22 03:44:21 2001//TBUGZILLA-2_14_1
-/programadmin.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/quicksearch.html/1.6/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_1
-/rewrite.html/1.1/Wed Aug 22 03:44:21 2001//TBUGZILLA-2_14_1
-/rhbugzilla.html/1.5/Wed Aug 22 03:44:22 2001//TBUGZILLA-2_14_1
-/scm.html/1.5/Wed Aug 22 03:44:22 2001//TBUGZILLA-2_14_1
-/security.html/1.6/Fri Aug 10 22:27:01 2001//TBUGZILLA-2_14_1
-/setperl.html/1.7/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_1
-/stepbystep.html/1.4/Wed Aug 29 18:13:39 2001//TBUGZILLA-2_14_1
-/tinderbox.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_1
-/translations.html/1.4/Fri Aug 10 22:27:03 2001//TBUGZILLA-2_14_1
-/useradmin.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_1
-/using.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_1
-/usingbz-conc.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_1
-/variant_fenris.html/1.1/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_1
-/variant_issuezilla.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_1
-/variant_perforce.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_1
-/variant_scarab.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_1
-/variant_sourceforge.html/1.2/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_1
-/variants.html/1.5/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_1
-/whatis.html/1.5/Wed Aug 22 03:44:25 2001//TBUGZILLA-2_14_1
-/why.html/1.5/Wed Aug 22 03:44:26 2001//TBUGZILLA-2_14_1
-/win32.html/1.3/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_1
+/Bugzilla-Guide.html/1.9/Wed Aug 29 18:13:38 2001//TBUGZILLA-2_14_2
+/about.html/1.4/Fri Aug 10 22:26:40 2001//TBUGZILLA-2_14_2
+/aboutthisguide.html/1.6/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_2
+/administration.html/1.5/Wed Aug 22 03:44:17 2001//TBUGZILLA-2_14_2
+/bonsai.html/1.5/Wed Aug 22 03:44:17 2001//TBUGZILLA-2_14_2
+/bsdinstall.html/1.1/Fri Aug 10 22:26:42 2001//TBUGZILLA-2_14_2
+/bzhacking.html/1.1/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_2
+/cmdline.html/1.5/Wed Aug 22 03:44:18 2001//TBUGZILLA-2_14_2
+/contributors.html/1.5/Wed Aug 29 17:25:25 2001//TBUGZILLA-2_14_2
+/conventions.html/1.5/Wed Aug 22 03:44:18 2001//TBUGZILLA-2_14_2
+/copyright.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_2
+/credits.html/1.5/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_2
+/cvs.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_2
+/database.html/1.4/Fri Aug 10 22:26:44 2001//TBUGZILLA-2_14_2
+/dbdoc.html/1.6/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_2
+/dbschema.html/1.5/Wed Aug 29 17:25:26 2001//TBUGZILLA-2_14_2
+/disclaimer.html/1.4/Fri Aug 10 22:26:46 2001//TBUGZILLA-2_14_2
+/downloadlinks.html/1.3/Fri Aug 10 22:26:46 2001//TBUGZILLA-2_14_2
+/errata.html/1.1/Fri Aug 10 22:26:47 2001//TBUGZILLA-2_14_2
+/faq.html/1.7/Wed Aug 29 17:25:27 2001//TBUGZILLA-2_14_2
+/feedback.html/1.4/Fri Aug 10 22:26:48 2001//TBUGZILLA-2_14_2
+/future.html/1.6/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/geninstall.html/1.3/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/gfdl.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/gfdl_0.html/1.4/Fri Aug 10 22:26:49 2001//TBUGZILLA-2_14_2
+/gfdl_1.html/1.4/Fri Aug 10 22:26:49 2001//TBUGZILLA-2_14_2
+/gfdl_10.html/1.4/Fri Aug 10 22:26:50 2001//TBUGZILLA-2_14_2
+/gfdl_2.html/1.4/Fri Aug 10 22:26:50 2001//TBUGZILLA-2_14_2
+/gfdl_3.html/1.4/Fri Aug 10 22:26:51 2001//TBUGZILLA-2_14_2
+/gfdl_4.html/1.4/Fri Aug 10 22:26:51 2001//TBUGZILLA-2_14_2
+/gfdl_5.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_2
+/gfdl_6.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_2
+/gfdl_7.html/1.4/Fri Aug 10 22:26:52 2001//TBUGZILLA-2_14_2
+/gfdl_8.html/1.4/Fri Aug 10 22:26:53 2001//TBUGZILLA-2_14_2
+/gfdl_9.html/1.4/Fri Aug 10 22:26:53 2001//TBUGZILLA-2_14_2
+/gfdl_howto.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/glossary.html/1.7/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/granttables.html/1.6/Wed Aug 29 17:25:28 2001//TBUGZILLA-2_14_2
+/how.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/index.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/init4me.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_2
+/installation.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/integration.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_2
+/newversions.html/1.5/Wed Aug 22 03:44:20 2001//TBUGZILLA-2_14_2
+/osx.html/1.1/Fri Aug 10 22:26:58 2001//TBUGZILLA-2_14_2
+/patches.html/1.6/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/postinstall-check.html/1.5/Wed Aug 22 03:44:21 2001//TBUGZILLA-2_14_2
+/programadmin.html/1.7/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/quicksearch.html/1.6/Wed Aug 29 17:25:29 2001//TBUGZILLA-2_14_2
+/rewrite.html/1.1/Wed Aug 22 03:44:21 2001//TBUGZILLA-2_14_2
+/rhbugzilla.html/1.5/Wed Aug 22 03:44:22 2001//TBUGZILLA-2_14_2
+/scm.html/1.5/Wed Aug 22 03:44:22 2001//TBUGZILLA-2_14_2
+/security.html/1.6/Fri Aug 10 22:27:01 2001//TBUGZILLA-2_14_2
+/setperl.html/1.7/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_2
+/stepbystep.html/1.4/Wed Aug 29 18:13:39 2001//TBUGZILLA-2_14_2
+/tinderbox.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_2
+/translations.html/1.4/Fri Aug 10 22:27:03 2001//TBUGZILLA-2_14_2
+/useradmin.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_2
+/using.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_2
+/usingbz-conc.html/1.5/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_2
+/variant_fenris.html/1.1/Wed Aug 22 03:44:23 2001//TBUGZILLA-2_14_2
+/variant_issuezilla.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_2
+/variant_perforce.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_2
+/variant_scarab.html/1.1/Wed Aug 22 03:44:24 2001//TBUGZILLA-2_14_2
+/variant_sourceforge.html/1.2/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_2
+/variants.html/1.5/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_2
+/whatis.html/1.5/Wed Aug 22 03:44:25 2001//TBUGZILLA-2_14_2
+/why.html/1.5/Wed Aug 22 03:44:26 2001//TBUGZILLA-2_14_2
+/win32.html/1.3/Wed Aug 29 17:25:30 2001//TBUGZILLA-2_14_2
 D
diff --git a/docs/html/CVS/Tag b/docs/html/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/docs/html/CVS/Tag
+++ b/docs/html/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/docs/images/CVS/Entries b/docs/images/CVS/Entries
index 02f07acab9ea7bc0b72f461f22821bfb097f1c27..48e51e60be2c69898de67951e5466166a2bd4422 100644
--- a/docs/images/CVS/Entries
+++ b/docs/images/CVS/Entries
@@ -1,7 +1,7 @@
-/caution.gif/1.1/Thu Aug 23 14:30:18 2001/-kb/TBUGZILLA-2_14_1
-/dbschema.jpg/1.1/Wed Aug 29 17:25:34 2001/-kb/TBUGZILLA-2_14_1
-/dbschema.ps/1.1/Wed Aug 29 17:25:34 2001/-kb/TBUGZILLA-2_14_1
-/note.gif/1.1/Thu Aug 23 14:30:18 2001/-kb/TBUGZILLA-2_14_1
-/tip.gif/1.1/Thu Aug 23 14:30:19 2001/-kb/TBUGZILLA-2_14_1
-/warning.gif/1.1/Thu Aug 23 14:30:20 2001/-kb/TBUGZILLA-2_14_1
+/caution.gif/1.1/Thu Aug 23 14:30:18 2001/-kb/TBUGZILLA-2_14_2
+/dbschema.jpg/1.1/Wed Aug 29 17:25:34 2001/-kb/TBUGZILLA-2_14_2
+/dbschema.ps/1.1/Wed Aug 29 17:25:34 2001/-kb/TBUGZILLA-2_14_2
+/note.gif/1.1/Thu Aug 23 14:30:18 2001/-kb/TBUGZILLA-2_14_2
+/tip.gif/1.1/Thu Aug 23 14:30:19 2001/-kb/TBUGZILLA-2_14_2
+/warning.gif/1.1/Thu Aug 23 14:30:20 2001/-kb/TBUGZILLA-2_14_2
 D
diff --git a/docs/images/CVS/Tag b/docs/images/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/docs/images/CVS/Tag
+++ b/docs/images/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/docs/rel_notes.txt b/docs/rel_notes.txt
index 74b822652a5b68085381ecf83b38b4496b3d3e9c..baac142c4a8c110a247bc6fcc707858c13b71a0f 100644
--- a/docs/rel_notes.txt
+++ b/docs/rel_notes.txt
@@ -1,320 +1,522 @@
+The 2.14.2 release fixes several security issues that became known
+to us after the Bugzilla 2.14.1 release.  Please see the upgrade
+procedure below for details on how to upgrade to 2.14.2.
+
+Please note that the upcoming release of 2.16 will incorporate
+various rearchitectures that will make failure-to-validate
+and failure-to-filter errors harder to insert and easier to
+spot.  In particular this means there may be holes in the 2.14
+line that have not been discovered, yet are fixed in 2.16.  If
+such holes exist they probably won't be fixed in 2.14 point
+releases, unless they are discovered.
+
+There may be future point releases of 2.14, even after the
+release of 2.16, however support for 2.14 will likely be
+dropped at some stage after the 2.16 release.
+
 **************************
 *** ABOUT THIS VERSION ***
 **************************
 
-Bugs referenced in the following text are bug numbers on
-bugzilla.mozilla.org.
-
-The 2.14.1 release fixes several security issues that became known to us after 
-the Bugzilla 2.14 release. Please see the upgrade procedure below for details 
-on how to upgrade to 2.14.1.
-
-****************************
-*** Bugs fixed in 2.14.1 ***
-****************************
-
-Bugzilla user account hijacking exploits:
-
-Bug 54901: If LDAP Authentication was being used, Bugzilla would allow you
-to log in as anyone if you left the password blank.
-
-Bug 108385: It was possible to add comments as someone else by editing the
-HTML on the show_bug.cgi page before submitting the form.User identity is
-checked now, and the form values suggesting the username are now ignored.
-
-Bug 108516: It was possible to file a bug as someone else by editing the
-HTML on enter_bug.cgi before submitting the form. User identity is now
-checked and the form values giving user ID are now ignored.
-
-Bugzilla account security:
-
-Bug 102141: The Product popup menu on the show_bug form listed all
-products, even if the user didn't have access to all of them. It now only
-shows products the user has access to (and the product the bug is in, if
-the user is viewing it because of some other override)
-
-Bug 108821: If you had any blessgroupset privs (the ability to change only
-specific privileges for other users), it was possible to change your own
-groupset (privileges) by altering the page HTML before submitting on
-editusers.cgi.
-
-Untrusted variables:
-
-Bug 98146: An untrusted variable was echoed back to user in the HTML output
-if there was a login error while editing votes.
+Bug numbers referenced in this document are all on
+bugzilla.mozilla.org unless otherwise specified.
 
-Arbitrary SQL execution:
-
-Bug 108812: buglist.cgi had an undocumented parameter that allowed you to
-pass arbitrary SQL for the "WHERE" part of a query. This has been disabled.
-
-Bug 108822: It was possible for a user to send arbitrary SQL by inserting
-single quotes in the "mybugslink" field in the user preferences.
-
-Bug 109679: buglist.cgi was not validating that the field names being
-passed from the "boolean chart" query form were valid field names, thus
-allowing arbitrary SQL to be inserted if you edited the HTML by hand before
-submitting the form.
-
-Bug 109690: long_list.cgi was not validating that the bug ID parameter was
-actually a number, allowing arbitrary SQL to be inserted if you edited the
-HTML by hand.
-
-
-Recommended Practice For The Upgrade
-------------------------------------
+*** Recommended Practice For The Upgrade ***
 
 As always, please ensure you have ran checksetup.pl after
 replacing the files in your installation.
 
-If you are upgrading from a version prior to 2.14, it is
-recommended that you view the sanity check page
+It is recommended that you view the sanity check page
 (sanitycheck.cgi) both before the upgrade and after running
 checksetup.pl after the upgrade, to see if there are any
-problems with your installation.  Of course, it doesn't hurt
-to run it on occasion anyway.
+problems with your installation.
 
 It is also recommended that if you can, you immediately fix
-any problems you find. Be aware that if the sanity check page
+any problems you find.  Be aware that if the sanity check page
 contains more errors after an upgrade, it doesn't necessarily
 mean there are more errors in your database, as it is likely
 they weren't being checked for in the old version.
 
+Failure to do this may mean that bugzilla will not
+work correctly.
+
 Administrators must make sure that certain files are
 inaccessible or confidential information might become
-available to enterprising individuals. This includes the
-localconfig file and the entire data directory. Please
-see the Bugzilla Guide (in the docs/ directory of the bugzilla
-tree) for more information.
-
-
-***************************************
-*** Information on the 2.14 release ***
-***************************************
-
-If you are upgrading from a release earlier than 2.14, you 
-may find it helpful to know about these changes new to 2.14 and 
-2.14.1:
+available to enterprising individuals.  This includes the
+localconfig file and the entire data directory.  Please
+see the Bugzilla Guide for more information.
+
+*** Deprecated Features ***
+
+- The 2.16 line will possibly be the last stable release that will
+  work with MySQL version 3.22.  Soon Bugzilla will require at least
+  version 3.23.x.  The exact minimum version number required
+  has not yet been decided.
+  (bug 87958)
+
+- The 2.16 line will possibly be the last stable release to support
+  the shadow database.  The replacement (using MySQL's built in
+  replication) is not present in 2.14.2 or 2.16, but we expect
+  that very few sites use this feature, so we are not planning a
+  transition period.  If this would cause a
+  problem for you, please comment on the below bug.
+  (bug 124589)
+
+- Placing comments in localconfig is deprecated.  If you have done
+  this, they will likely get nuked with some post-2.16 version of
+  Bugzilla, as checksetup.pl will likely automatically rewrite localconfig
+  to automatically get the latest comments.
+  (bug 147776)
+
+*** Outstanding Issues Of Note ***
+
+These issues may have been fixed in later stable or development
+versions of Bugzilla.  If you are interested in tracking these
+bugs, please see the bug report numbers listed to find out the
+status of the fix for these bugs, or to obtain a patch that can
+fix the problem on your installation.
+
+- Bug counts (on reports.cgi) can be very slow if you have to
+  count a lot of bugs.  In this case the connection can time
+  out before thepage finishes loading.  Extending the cgi
+  timeout on your web server might help this situation.
+  (bug 63249)
+
+- Renaming or removing keywords that are in use will not update
+  the "keyword cache" on bugs, and queries on keywords may not work
+  properly, until you rebuild the cache on the sanity check page
+  (sanitycheck.cgi).  The changer will receive a warning to do
+  this when altering the keyword.
+  (bug 69621)
+
+- Email notifications will not work out of the box if you are
+  using Postfix, Exim or possibly other non-SendMail mail
+  transfer agents, as Bugzilla sends mail by default in
+  "deferred" mode using the "-ODeliveryMode=deferred" command
+  line option, which needs to be supported by the sendmail
+  program.  To fix this, you can turn on the "sendmailnow"
+  parameter on the Edit Parameters page (editparams.cgi).
+  (bug 37765)
+
+- The new options to let people see a bug when their name
+  is on it but who aren't in the groups the bug is restricted
+  to only allow people to view bugs if they know the bug number.
+  It still will not show up in these people's buglists and
+  they will not receive email about changes to the bugs.
+  (bugs 95024, 97469)
+
+- Users behind rotating transparent proxies or otherwise having
+  an IP that changes each URL fetch will find they need to log in
+  regularly.
+  (bug 20122)
+
+- If you search on any CC or added comments, as well as at least
+  one other of CC, added comments, assignee, reporter, etc, then
+  the search can be very slow.  This is because of limitations of
+  the MySQL optimiser.
+  (bug 96101)
+
+- Querying on CC takes too long on big databases.
+  (bug 127200)
+
+- The email preferences option "Priority, status, severity, and/or milestone
+  changes" does not actually report status changes.  You can however use the
+  option "The bug is resolved or verified" to achieve part of this.
+  (bug 130821)
+
+***********************************************
+*** USERS UPGRADING FROM 2.14.1 OR EARLIER  ***
+***********************************************
+
+*** SECURITY ISSUES RESOLVED ***
+
+- queryhelp.cgi no longer shows confidential products to
+  people it shouldn't.
+  (bug 126801)
+
+- It was possible for a user to bypass the IP check by
+  setting up a fake reverse DNS, if the Bugzilla web server
+  was configured to do reverse DNS lookups.  Apache is not
+  configured as such by default.  This is not a complete
+  exploit, as the user's login cookie would also need to
+  be divulged for this to be a problem.
+  (bug 129466)
+
+- In some situations the data directory became world writeable.
+  (bug 134575)
+
+- Any user with access to editusers.cgi could delete a user
+  regardless of whether 'allowuserdeletion' is on.
+  (bug 141557)
+
+- Real names were not HTML filtered, causing possible cross
+  site scripting attacks.
+  (bug 146447, 147486)
+
+- Mass change would set the groupset of every bug to be the
+  groupset of the first bug.
+  (bug 107718)
+
+- Some browsers (eg NetPositive) interacted with Bugzilla
+  badly and could have various form problems, including
+  removing group restrictions on bugs.
+  (bug 148674)
+
+- It was possible for random confidential information to be
+  divulged, if the shadow database was in use and became
+  corrupted.
+  (bug 92263)
+
+- The bug list sort order is now stricter about the SQL it will accept,
+  ensuring you use correct column name syntax.  Before this, there were
+  some syntax checks, so it is not known whether this problem was
+  exploitable.
+  (bug 130821)
+
+********************************************
+*** USERS UPGRADING FROM 2.14 OR EARLIER ***
+********************************************
+
+The 2.14.1 release fixes several security issues that became
+known to us after the Bugzilla 2.14 release.
+
+*** SECURITY ISSUES RESOLVED ***
+
+- If LDAP Authentication was being used, Bugzilla would allow
+  you to log in as anyone if you left the password blank.
+  (bug 54901)
+
+- It was possible to add comments or file a bug as someone else
+  by editing the HTML on the appropriate submission page before
+  submitting the form.  User identity is checked now, and the
+  form values suggesting the user are now ignored.
+  (bug 108385, 108516)
+
+- The Product popup menu on the show_bug form listed all
+  products, even if the user didn't have access to all of them.
+  It now only shows products the user has access to (and the
+  product the bug is in, if the user is viewing it because of
+  some other override).
+  (bug 102141)
+
+- If a user had any blessgroupset privileges (the ability to
+  change only specific privileges for other users), it was
+  possible to change your own groupset (privileges) by
+  altering the page HTML before submitting on editusers.cgi.
+  (bug 108821)
+
+- An untrusted variable was echoed back to user in the HTML
+  output if there was a login error while editing votes.
+  (bug 98146)
+
+- buglist.cgi had an undocumented parameter that allowed you
+  to pass arbitrary SQL for the "WHERE" part of a query.
+  This has been disabled.
+  (bug 108812)
+
+- It was possible for a user to send arbitrary SQL by inserting
+  single quotes in the "mybugslink" field in the user
+  preferences.
+  (bug 108822)
+
+- buglist.cgi was not validating that the field names being
+  passed from the "boolean chart" query form were valid field
+  names, thus allowing arbitrary SQL to be inserted if you 
+  edited the HTML by hand before submitting the form.
+  (bug 109679)
+
+- long_list.cgi was not validating that the bug ID parameter
+  was actually a number, allowing arbitrary SQL to be inserted
+  if you edited the HTML by hand.
+  (bug 109690)
+
+********************************************
+*** USERS UPGRADING FROM 2.12 OR EARLIER ***
+********************************************
+
+*** SECURITY ISSUES RESOLVED ***
+
+- Multiple instances of unauthorised access to confidential
+  bugs has been fixed.
+  (bug 39524, 39526, 39527, 39531, 39533, 70189, 82781)
+
+- Multiple instances of untrusted parameters not being
+  checked/escaped was fixed.  These included definite security
+  holes.
+  (bug 38854, 38855, 38859, 39536, 87701, 95235)
+
+- After logging in passwords no longer appear in the URL.
+  (bug 15980)
+
+- Procedures to prevent unauthorised access to confidential
+  files are now simpler.  In particular the shadow directory
+  no longer exists and the data/comments file no longer needs
+  to be directly accessible, so the entire data directory can
+  be blocked.  However, no changes are required here if you
+  have a properly secured 2.12 installation as no new files
+  must be protected.
+  (bug 71552, 73191)
+
+- If they do not already exist, checksetup.pl will attempt to
+  write Apache .htaccess files by default, to prevent
+  unauthorised access to confidential files.  You can turn this
+  off in the localconfig file.
+  (bug 76154)
+
+- Sanity check can now only be run by people in the 'editbugs'
+  group.  Although it would be better to have a separate
+  group, this is not possible until the limitation on the
+  number of groups allowed has been removed.
+  (bug 54556)
+
+- The password is no longer stored in plaintext form.  It will
+  be eradicated next time you run checksetup.pl.  A user must
+  now change their password via a password change request that
+  gets validated at their e-mail account, rather than have it
+  mailed to them.
+  (bug 74032)
+
+- When you are using product groups and you move a bug between
+  products (single or mass change), the bug will no longer be
+  restricted to the old product's group (if it was) and will
+  be restricted to the new product's group.
+  (bug 66235)
+
+- There are now options on a bug to choose whether the
+  reporter, and CCs can access a bug even if they aren't in
+  groups the bug it is restricted to.
+  (bug 39816)
+
+- You can no longer mark a bug as a duplicate of a bug you
+  can't see, and if you mark a bug a duplicate of a bug
+  the reporter cannot see you will be given options as to
+  what to do regarding adding the reporter of the resolved
+  bug to the CC of the open bug.
+  (bug 96085)
 
 *** IMPORTANT CHANGES ***
 
-- Bugzilla 2.14 no longer supports old email tech. Upon
-upgrading, all users will be moved over to new email tech.
-This should speed up upgrading for installations with
-a large number of bugs.
-(bug 71552)
+- Bugzilla 2.14 no longer supports old email tech.  Upon
+  upgrading, all users will be moved over to new email tech.
+  This should speed up upgrading for installations with
+  a large number of bugs.
+  (bug 71552)
 
 - There is new functionality for people to see why they are
-receiving notification mails.
+  receiving notification mails.
 
-Previously, some people filtered old email tech
-notifications depending on whether they were in the To or the
-CC header, in order to get a limited way of determining why
-they were receiving the notification for filtering purposes.
+  Previously, some people filtered old email tech
+  notifications depending on whether they were in the To or the
+  CC header, in order to get a limited way of determining why
+  they were receiving the notification for filtering purposes.
 
-Existing installations will need to make changes to support
-this feature.The receive reasons can be added to the
-notifications as a header and/or in the body.To add these
-you will need to modify your newchangedmail parameter on
-editparams.cgi, either by resetting it or appropriately
-modifying it.The header value is specified by
-%reasonsheader% and the body by %reasonsbody%.For example,
-the new default parameter is:
+  Existing installations will need to make changes to support
+  this feature.  The receive reasons can be added to the
+  notifications as a header and/or in the body.  To add these
+  you will need to modify your newchangedmail parameter on
+  editparams.cgi, either by resetting it or appropriately
+  modifying it.  The header value is specified by
+  %reasonsheader% and the body by %reasonsbody%.  For example,
+  the new default parameter is:
 
---------------------------------------------------
-From: bugzilla-daemon
-To: %to%
-Subject: [Bug %bugid%] %neworchanged%%summary%
-X-Bugzilla-Reason: %reasonsheader%
+  --------------------------------------------------
+  From: bugzilla-daemon
+  To: %to%
+  Subject: [Bug %bugid%] %neworchanged%%summary%
+  X-Bugzilla-Reason: %reasonsheader%
 
-%urlbase%show_bug.cgi?id=%bugid%
+  %urlbase%show_bug.cgi?id=%bugid%
 
-%diffs%
+  %diffs%
 
 
 
-%reasonsbody%
---------------------------------------------------
+  %reasonsbody%
+  --------------------------------------------------
 
-(bug 26194)
+  (bug 26194)
 
 - Very long fields (especially multi-valued fields like keywords,
-CCs, dependencies) on bug activity and notifications previously
-could get truncated, resulting in useless notifications and data
-loss on bug activity.Now the multi-valued fields only show
-changes, and very big changes are split into multiple lines.
-Where data loss has already occurred on bug activity, it is
-indicated using question marks.
-(bug 55161, 92266)
+  CCs, dependencies) on bug activity and notifications previously
+  could get truncated, resulting in useless notifications and data
+  loss on bug activity.  Now the multi-valued fields only show
+  changes, and very big changes are split into multiple lines.
+  Where data loss has already occurred on bug activity, it is
+  indicated using question marks.
+  (bug 55161, 92266)
 
 - Previously, when a product's voting preferences changed all
-votes were removed from all the bugs in the product.Also,
-when a bug was moved to another product, all of its votes
-were removed.This no longer occurs.
-
-Instead, if the action would leave one or more bugs with
-greater than the maximum number of votes per person per bug,
-the number of votes will be reduced to the maximum.The
-person will still be notified of this as before.
-
- If the action would leave a user with more votes in a product
- than is allowed, the limit will be breached so as to not lose
- votes.However the user will not be able to update their
- votes except to fix this situation.No further action is taken
- in this version to make sure that the user does this.
- (bug 28882, 92593)
-
- *** Other changes of note ***
- 
- - Groups can now be marked inactive, so you can't add a new
- restriction on that group to a bug, while leaving bugs that
- were previously restricted on that group alone.
- (bug 75482)
- - backdoor.cgi has been removed from the installation.It was
- old code that was Netscape-specific and its name was scaring
- people.
- (bug 87983)
- - You can now add or remove from CC on the bulk change page.
- (bug 12819)
- - New users created by administrators are now automatically
- inserted into groups according to the group's regular
- expression.Administrators must edit the user in a second
- step to override these choices.Previously the
- administrator specified these explicitly which could lead
- to incorrect settings.
- (bug 45164)
- - The userregexp of system groups can now be edited without
- resorting to direct database access.
- (bug 65290)
- 
- 
-
- *** Outstanding issues of note ***
- 
- - Bug counts (on reports.cgi) can be very slow if you have to
- count a lot of bugs.In this case the connection can time
- out before thepage finishes loading. Extending the cgi
- timeout on your web server might help this situation.
- (bug 63249)
- - Renaming or removing keywords will not update the "keyword
- cache", and queries on keywords may not work properly, until
- you rebuild the cache on the sanity check page
- (sanitycheck.cgi).The changer will receive a warning to do
- this when altering the keyword.
- (bug 69621)
- - Email notifications will not work out of the box if you are
- using Postfix, Exim or possibly other non-SendMail mail
- transfer agents, as Bugzilla sends mail by default in
- "deferred" mode using the "-ODeliveryMode=deferred" command
- line option, which needs to be supported by the sendmail
- program.To fix this, you can turn on the "sendmailnow"
- parameter on the Edit Parameters page (editparams.cgi).
- (bug 50159)
- - The new options to let people see a bug when their name
- is on it but who aren't in the groups the bug is restricted
- to only allow people to view bugs if they know the bug number.
- It still will not show up in these people's buglists and
- they will not receive email about changes to the bugs.
- (bugs 95024, 97469)
- 
- **********************************************************
- *** USERS UPGRADING FROM 2.10 OR EARLIER - 2.12 ISSUES ***
- **********************************************************
- 
- These release notes may be of use to those upgrading from a release earlier 
- than 2.12. 
- 
- *** IMPORTANT CHANGES ***
- 
- - There is now a facility for users to choose the sort of
- notifications they wish to receive.This facility will
- probably be improved in future versions.
- (bug 17464)
- 
- - "Changed" will no longer appear on the subject line of
- change notification emails.Because of this, you should
- change the subject line in your 'changedmail' and
- 'newchangedmail' params on editparams.cgi. The subject
- line needs to be changed from
- 
- Subject: [Bug %bugid%] %neworchanged% - %summary%
- 
- to
- 
- Subject: [Bug %bugid%] %neworchanged%%summary%
- 
- or whatever is appropriate for the subject you are using
- on your system. Note the removal of the " - " in the
- middle.
- (bug 29820)
- 
- - Some security holes have been fixed where shell escape characters
- could be passed to Bugzilla, allowing remote users to execute
- system commands on the web server.
- 
- *** Other changes of note ***
- 
- - Bug titles now appear in the page title, and will hence
- display in the user's browser's bookmarks and history.
- (bug 22041)
- - Edit groups functionality (editgroups.cgi).
- (bug 25010)
- - Support for moving bugs to other Bugzilla databases.
- (bug 36133)
- - Bugzilla now can generate a frequently reported bugs list
- based on what duplicates you receive.
- (bug 25693)
- - When installing Bugzilla fresh, the administrator account is
- now created in checksetup.pl.
- (bug 17773)
- - Stored queries now show their name above the bug list, which
- helps the user when they have multiple bug lists in multiple
- browser windows.It also appears in the page title, and will
- hence display in the user's browser's bookmarks and history.
- (bug 52228)
- - All states and resolutions can now be collected for charting.
- (bug 6682)
- - A new search-engine-like "quick search" feature appears on
- the front page to try and making searching easier.
- (bug 69793)
- - Querying on dependencies now works in the advanced query
- section of the query page.
- (bug 30823)
- - When a bug is marked as a duplicate, the reporter of the
- resolved bug is automatically added to the CC list of the
- open bug.
- (bug 28676)
- 
- 
- *** Bug fixes of note ***
- 
- - Notification emails will now always be sent to QA contacts.
- Previously they wouldn't if you were using new email tech.
- (bug 30826)
- - When marking a bug as a duplicate, the duplicate stamp marked
- on the open bug will no longer be written too early (such as
- on mid-air collisions).
- (bug 7873)
- - Various bug fixes were made to the initial assignee and QA
- of a component.It is no longer possible to enter an
- invalid address.They will also now properly update when
- a user's email address is changed.Sanity check will now
- check these.
- (bug 66876)
- - Administrators can no longer create an email accounts that do
- not match the global email regular expression parameter.
- Previously this could occur and would cause sanity check
- errors.
- (bug 32971)
- - The resolution field can no longer become empty when the
- bug is resolved.This occurred because of midair collisions.
- (bug 49306)
- 
- 
- *******************************************
- *** USERS UPGRADING FROM 2.8 OR EARLIER ***
- *******************************************
- 
- Release notes were not compiled for versions of Bugzilla before
- 2.12.
+  votes were removed from all the bugs in the product.  Also,
+  when a bug was moved to another product, all of its votes
+  were removed.  This no longer occurs.
+
+  Instead, if the action would leave one or more bugs with
+  greater than the maximum number of votes per person per bug,
+  the number of votes will be reduced to the maximum.  The
+  person will still be notified of this as before.
+
+  If the action would leave a user with more votes in a product
+  than is allowed, the limit will be breached so as to not lose
+  votes.  However the user will not be able to update their
+  votes except to fix this situation.  No further action is taken
+  in this version to make sure that the user does this.
+  (bug 28882, 92593)
+
+*** Other changes of note ***
+
+- Groups can now be marked inactive, so you can't add a new
+  restriction on that group to a bug, while leaving bugs that
+  were previously restricted on that group alone.
+  (bug 75482)
+- backdoor.cgi has been removed from the installation.  It was
+  old code that was Netscape-specific and its name was scaring
+  people.
+  (bug 87983)
+- You can now add or remove from CC on the bulk change page.
+  (bug 12819)
+- New users created by administrators are now automatically
+  inserted into groups according to the group's regular
+  expression.  Administrators must edit the user in a second
+  step to override these choices.  Previously the
+  administrator specified these explicitly which could lead
+  to incorrect settings.
+  (bug 45164)
+- The userregexp of system groups can now be edited without
+  resorting to direct database access.
+  (bug 65290)
+
+*** Bug fixes of note ***
+
+- The bug list page was sometimes bringing up a not logged in
+  footer when the user was logged in and the installation was
+  using a shadow database.
+  (bug 47914)
+- You can now view the bug summary in your browser title for
+  a group-restricted bug if you have proper permissions.
+  (bug 71767)
+- Quick search for search terms did not work in IE5.
+  This has been worked around.
+  (bug 77699)
+- Quick search for search terms crashed NN4.76/4.77 for Unix.
+  This has been worked around.
+  (bug 83619)
+- Queries on bugs you have commented on using the "added
+  comment" feature should be a lot faster and not time out
+  on large installations due to the addition of an index.
+  (bug 57350)
+- You can now alter group settings on bulk change for groups
+  that aren't on for all bugs or off for all bugs.
+  (bug 84714)
+- New bug notifications now include the CC and QA fields.
+  (bug 28458)
+- Bugzilla is now more Windows friendly, although it is still
+  not an official platform.
+  (bug 88179, 29064)
+- Passwords are now encrypted using Perl's encrypt function.
+  This makes Bugzilla more portable to more operating systems.
+  (bug 77473)
+- Bugzilla didn't properly shut down when told to - some
+  queries could still be sent to the database.
+  (bug 95082)
+
+********************************************
+*** USERS UPGRADING FROM 2.10 OR EARLIER ***
+********************************************
+
+*** SECURITY ISSUES RESOLVED ***
+
+- Some security holes have been fixed where shell escape characters
+  could be passed to Bugzilla, allowing remote users to execute
+  system commands on the web server.
+
+*** IMPORTANT CHANGES ***
 
+- There is now a facility for users to choose the sort of
+  notifications they wish to receive.  This facility will
+  probably be improved in future versions.
+  (bug 17464)
+
+- "Changed" will no longer appear on the subject line of
+  change notification emails.  Because of this, you should
+  change the subject line in your 'changedmail' and
+  'newchangedmail' params on editparams.cgi.  The subject
+  line needs to be changed from
+
+    Subject: [Bug %bugid%] %neworchanged% - %summary%
+
+  to:
+
+    Subject: [Bug %bugid%] %neworchanged%%summary%
+
+  or whatever is appropriate for the subject you are using
+  on your system.  Note the removal of the " - " in the
+  middle.
+  (bug 29820)
+
+*** Other changes of note ***
+
+- Bug titles now appear in the page title, and will hence
+  display in the user's browser's bookmarks and history.
+  (bug 22041)
+- Edit groups functionality (editgroups.cgi).
+  (bug 25010)
+- Support for moving bugs to other Bugzilla databases.
+  (bug 36133)
+- Bugzilla now can generate a frequently reported bugs list
+  based on what duplicates you receive.
+  (bug 25693)
+- When installing Bugzilla fresh, the administrator account is
+  now created in checksetup.pl.
+  (bug 17773)
+- Stored queries now show their name above the bug list, which
+  helps the user when they have multiple bug lists in multiple
+  browser windows.  It also appears in the page title, and will
+  hence display in the user's browser's bookmarks and history.
+  (bug 52228)
+- All states and resolutions can now be collected for charting.
+  (bug 6682)
+- A new search-engine-like "quick search" feature appears on
+  the front page to try and making searching easier.
+  (bug 69793)
+- Querying on dependencies now works in the advanced query
+  section of the query page.
+  (bug 30823)
+- When a bug is marked as a duplicate, the reporter of the
+  resolved bug is automatically added to the CC list of the
+  open bug.
+  (bug 28676)
+
+*** Bug fixes of note ***
+
+- Notification emails will now always be sent to QA contacts.
+  Previously they wouldn't if you were using new email tech.
+  (bug 30826)
+- When marking a bug as a duplicate, the duplicate stamp marked
+  on the open bug will no longer be written too early (such as
+  on mid-air collisions).
+  (bug 7873)
+- Various bug fixes were made to the initial assignee and QA
+  of a component.  It is no longer possible to enter an
+  invalid address.  They will also now properly update when
+  a user's email address is changed.  Sanity check will now
+  check these.
+  (bug 66876)
+- Administrators can no longer create an email accounts that do
+  not match the global email regular expression parameter.
+  Previously this could occur and would cause sanity check
+  errors.
+  (bug 32971)
+- The resolution field can no longer become empty when the
+  bug is resolved.  This occurred because of midair collisions.
+  (bug 49306)
+
+*******************************************
+*** USERS UPGRADING FROM 2.8 OR EARLIER ***
+*******************************************
+
+Release notes were not compiled for versions of Bugzilla before
+2.12.
+
+The file 'UPGRADING-pre-2.8' contains instructions you may
+need to perform in addition to running 'checksetup.pl' if you
+are running a pre 2.8 version.
diff --git a/docs/sgml/CVS/Entries b/docs/sgml/CVS/Entries
index b1573d6d9924711f8c5340b412bf031cb65054b6..187965d1573b8bbb8b718da639268ed246d81df0 100644
--- a/docs/sgml/CVS/Entries
+++ b/docs/sgml/CVS/Entries
@@ -1,18 +1,18 @@
-/Bugzilla-Guide.sgml/1.6/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_1
-/about.sgml/1.5/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_1
-/administration.sgml/1.7/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_1
-/conventions.sgml/1.2/Fri Aug 10 22:13:50 2001//TBUGZILLA-2_14_1
-/database.sgml/1.4/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_1
-/dbschema.mysql/1.1/Fri Aug 10 22:13:50 2001//TBUGZILLA-2_14_1
-/faq.sgml/1.6/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_1
-/future.sgml/1.5/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_1
-/gfdl.sgml/1.2/Fri Aug 10 22:13:52 2001//TBUGZILLA-2_14_1
-/glossary.sgml/1.3/Wed Aug 22 03:44:31 2001//TBUGZILLA-2_14_1
-/index.sgml/1.2/Fri Aug 10 22:13:53 2001//TBUGZILLA-2_14_1
-/installation.sgml/1.7/Wed Aug 29 18:13:41 2001//TBUGZILLA-2_14_1
-/integration.sgml/1.5/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_1
-/patches.sgml/1.5/Wed Aug 29 17:25:39 2001//TBUGZILLA-2_14_1
-/requiredsoftware.sgml/1.2/Fri Aug 10 22:13:54 2001//TBUGZILLA-2_14_1
-/using.sgml/1.5/Wed Aug 29 17:25:39 2001//TBUGZILLA-2_14_1
-/variants.sgml/1.4/Wed Aug 22 03:44:32 2001//TBUGZILLA-2_14_1
+/Bugzilla-Guide.sgml/1.6/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_2
+/about.sgml/1.5/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_2
+/administration.sgml/1.7/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_2
+/conventions.sgml/1.2/Fri Aug 10 22:13:50 2001//TBUGZILLA-2_14_2
+/database.sgml/1.4/Wed Aug 29 17:25:36 2001//TBUGZILLA-2_14_2
+/dbschema.mysql/1.1/Fri Aug 10 22:13:50 2001//TBUGZILLA-2_14_2
+/faq.sgml/1.6/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_2
+/future.sgml/1.5/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_2
+/gfdl.sgml/1.2/Fri Aug 10 22:13:52 2001//TBUGZILLA-2_14_2
+/glossary.sgml/1.3/Wed Aug 22 03:44:31 2001//TBUGZILLA-2_14_2
+/index.sgml/1.2/Fri Aug 10 22:13:53 2001//TBUGZILLA-2_14_2
+/installation.sgml/1.7/Wed Aug 29 18:13:41 2001//TBUGZILLA-2_14_2
+/integration.sgml/1.5/Wed Aug 29 17:25:38 2001//TBUGZILLA-2_14_2
+/patches.sgml/1.5/Wed Aug 29 17:25:39 2001//TBUGZILLA-2_14_2
+/requiredsoftware.sgml/1.2/Fri Aug 10 22:13:54 2001//TBUGZILLA-2_14_2
+/using.sgml/1.5/Wed Aug 29 17:25:39 2001//TBUGZILLA-2_14_2
+/variants.sgml/1.4/Wed Aug 22 03:44:32 2001//TBUGZILLA-2_14_2
 D
diff --git a/docs/sgml/CVS/Tag b/docs/sgml/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/docs/sgml/CVS/Tag
+++ b/docs/sgml/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/docs/txt/CVS/Entries b/docs/txt/CVS/Entries
index c878308c4bfa6aac0b1e62e0cf7f4d72c8534d4d..4e5e42e7c9afbc75c8fae6d71cec623c4cb3d900 100644
--- a/docs/txt/CVS/Entries
+++ b/docs/txt/CVS/Entries
@@ -1,2 +1,2 @@
-/Bugzilla-Guide.txt/1.8/Wed Aug 29 18:13:42 2001//TBUGZILLA-2_14_1
+/Bugzilla-Guide.txt/1.8/Wed Aug 29 18:13:42 2001//TBUGZILLA-2_14_2
 D
diff --git a/docs/txt/CVS/Tag b/docs/txt/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/docs/txt/CVS/Tag
+++ b/docs/txt/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/editusers.cgi b/editusers.cgi
index 188cd05b5d251b4363be02c21b4d3648748421cd..2db93e4acc4d68457e86193efb9b5a3ebfd73c28 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -336,7 +336,7 @@ if ($action eq 'list') {
             $s = "<STRIKE>";
             $e = "</STRIKE>";
         }
-	$realname ||= "<FONT COLOR=\"red\">missing</FONT>";
+	$realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
 	print "<TR>\n";
 	print "  <TD VALIGN=\"top\"><A HREF=\"editusers.cgi?action=edit&user=", url_quote($user), "\"><B>$s$user$e</B></A></TD>\n";
 	print "  <TD VALIGN=\"top\">$s$realname$e</TD>\n";
@@ -521,6 +521,7 @@ if ($action eq 'del') {
     if (!$candelete) {
         print "Sorry, deleting users isn't allowed.";
         PutTrailer();
+        exit;
     }
     if (!$editall) {
         print "Sorry, you don't have permissions to delete users.";
@@ -534,7 +535,7 @@ if ($action eq 'del') {
 	     WHERE login_name=" . SqlQuote($user));
     my ($realname, $groupset) = 
       FetchSQLData();
-    $realname ||= "<FONT COLOR=\"red\">missing</FONT>";
+    $realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
     
     print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
     print "<TR BGCOLOR=\"#6666FF\">\n";
@@ -650,6 +651,7 @@ if ($action eq 'delete') {
     if (!$candelete) {
         print "Sorry, deleting users isn't allowed.";
         PutTrailer();
+        exit;
     }
     if (!$editall) {
         print "Sorry, you don't have permissions to delete users.";
diff --git a/globals.pl b/globals.pl
index cfb03252497888889fc9ff67f9b2eb99cd1eced8..87d07d14cb685690cc58e8c391512b9859302ba4 100644
--- a/globals.pl
+++ b/globals.pl
@@ -76,7 +76,7 @@ use RelationSet;
 delete $ENV{PATH};
 
 # Contains the version string for the current running Bugzilla.
-$::param{'version'} = '2.14.1';
+$::param{'version'} = '2.14.2';
 
 $::dontchange = "--do_not_change--";
 $::chooseone = "--Choose_one:--";
@@ -95,6 +95,19 @@ $::superusergroupset = "9223372036854775807";
 #}
 #$::SIG{__DIE__} = \&die_with_dignity;
 
+# Some files in the data directory must be world readable iff we don't have
+# a webserver group. Call this function to do this.
+sub ChmodDataFile($$) {
+	my ($file, $mask) = @_;
+	my $perm = 0770;
+	if ((stat('data'))[2] & 0002) {
+		$perm = 0777;
+	}
+	$perm = $perm & $mask;
+	chmod $perm,$file;
+}
+
+
 sub ConnectToDatabase {
     my ($useshadow) = (@_);
     if (!defined $::db) {
@@ -128,6 +141,9 @@ sub SyncAnyPendingShadowChanges {
                 return;
             } elsif (defined $pid) {
                 # child process code runs here
+                my $redir = ($^O =~ /MSWin32/i) ? "NUL" : "/dev/null";
+                open STDOUT,">$redir";
+                open STDERR,">$redir";
                 exec("./syncshadowdb","--") or die "Unable to exec syncshadowdb: $!";
                 # the idea was that passing the second parameter tricks it into
                 # using execvp instead of running a shell. Not really necessary since
@@ -519,8 +535,6 @@ sub GenerateVersionTable {
 
     my @list = sort { uc($a) cmp uc($b)} keys(%::versions);
     @::legal_product = @list;
-    mkdir("data", 0777);
-    chmod 0777, "data";
     my $tmpname = "data/versioncache.$$";
     open(FID, ">$tmpname") || die "Can't create $tmpname";
 
@@ -582,7 +596,7 @@ sub GenerateVersionTable {
     print FID "1;\n";
     close FID;
     rename $tmpname, "data/versioncache" || die "Can't rename $tmpname to versioncache";
-    chmod 0666, "data/versioncache";
+    ChmodDataFile('data/versioncache', 0666);
 }
 
 
@@ -1044,7 +1058,7 @@ sub GetLongDescriptionAsHTML {
         if ($count) {
             $result .= "<BR><BR><I>------- Additional Comments From ";
               if ($who) {
-                  $result .= qq{<A HREF="mailto:$email">$who</A> } .
+                  $result .= "<A HREF=\"mailto:$email\">" . html_quote($who) . "</A> " .
                       time2str("%Y-%m-%d %H:%M", str2time($when)) .
                           " -------</I><BR>\n";
               } else {
@@ -1121,8 +1135,10 @@ sub UserInGroup {
         return 0;
     }
     ConnectToDatabase();
+    PushGlobalSQLState();
     SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname));
     my $bit = FetchOneColumn();
+    PopGlobalSQLState();
     if ($bit) {
         return 1;
     }
@@ -1142,8 +1158,10 @@ sub BugInGroup {
 sub GroupExists {
     my ($groupname) = (@_);
     ConnectToDatabase();
+    PushGlobalSQLState();
     SendSQL("select count(*) from groups where name=" . SqlQuote($groupname));
     my $count = FetchOneColumn();
+    PopGlobalSQLState();
     return $count;
 }
 
@@ -1167,8 +1185,10 @@ sub GroupIsActive {
     my ($groupbit) = (@_);
     $groupbit ||= 0;
     ConnectToDatabase();
+    PushGlobalSQLState();
     SendSQL("select isactive from groups where bit=$groupbit");
     my $isactive = FetchOneColumn();
+    PopGlobalSQLState();
     return $isactive;
 }
 
diff --git a/importxml.pl b/importxml.pl
index a11f116d9723b081288373b952a5a09101c99c81..83b14276333289e0ba345fe078d71e01fafc3c56 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -129,11 +129,7 @@ sub Log {
 sub Lock {
     if ($::lockcount <= 0) {
         $::lockcount = 0;
-        if (!open(LOCKFID, ">>data/maillock")) {
-            mkdir "data", 0777;
-            chmod 0777, "data";
-            open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
-        }
+        open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
         my $val = flock(LOCKFID,2);
         if (!$val) { # '2' is magic 'exclusive lock' const.
             print "Content-type: text/html\n\n";
diff --git a/move.pl b/move.pl
index 37b8cb7eff594fdce5b468525dcd38f354f19dd6..7254871d4f020a69ba9085e1383bc67d5744dc66 100755
--- a/move.pl
+++ b/move.pl
@@ -47,11 +47,7 @@ sub Log {
 sub Lock {
     if ($::lockcount <= 0) {
         $::lockcount = 0;
-        if (!open(LOCKFID, ">>data/maillock")) {
-            mkdir "data", 0777;
-            chmod 0777, "data";
-            open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
-        }
+        open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
         my $val = flock(LOCKFID,2);
         if (!$val) { # '2' is magic 'exclusive lock' const.
             print "Content-type: text/html\n\n";
diff --git a/process_bug.cgi b/process_bug.cgi
index 6c56f34cce0a252852442084cfec30f0032171e5..ee30b07d87e0880cb59a563ec1a1d1351074ade2 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -43,7 +43,8 @@ use vars %::versions,
     %::legal_platform,
     %::legal_priority,
     %::target_milestone,
-    %::legal_severity;
+    %::legal_severity,
+    %::superusergroupset;
 
 my $whoid = confirm_login();
 
@@ -553,45 +554,30 @@ sub CheckonComment( $ ) {
 # select lists.  This means that instead of looking for the bit-X values in
 # the form, we need to loop through all the bug groups this user has access
 # to, and for each one, see if it's selected.
-# In addition, adding a little extra work so that we don't clobber groupsets
-# for bugs where the user doesn't have access to the group, but does to the
-# bug (as with the proposed reporter access patch.)
+# In order to make mass changes work correctly, keep a sum of bits for groups
+# added, and another one for groups removed, and then let mysql do the bit
+# operations
+# If the form element isn't present, or the user isn't in the group, leave
+# it as-is
 if($::usergroupset ne '0') {
-  # We want to start from zero and build up, since if all boxes have been
-  # unchecked, we want to revert to 0.
-  DoComma();
-  $::query .= "groupset = 0";
-  my ($id) = (@idlist);
-  SendSQL(<<_EOQ_);
-    SELECT bit, bit & $::usergroupset != 0, bit & bugs.groupset != 0
-    FROM groups, bugs
-    WHERE isbuggroup != 0 AND bug_id = $id
-    ORDER BY bit
-_EOQ_
-  while (my ($b, $userhasgroup, $bughasgroup) = FetchSQLData()) {
-    if (!$::FORM{"bit-$b"}) {
-      # If we make it here, the item didn't exist on the form or the user
-      # said to clear it.  The only time we add this group back in is if
-      # the bug already has this group on it and the user can't access it.
-      if ($bughasgroup && !$userhasgroup) {
-        $::query .= " + $b";
-      }
-    } elsif ($::FORM{"bit-$b"} == -1) {
-      # If we get here, the user came from the change several bugs form, and
-      # said not to change this group restriction.  So we'll add this group
-      # back in only if the bug already has it.
-      if ($bughasgroup) {
-        $::query .= " + $b";
-      }
-    } else {
-      # If we get here, the user said to set this group.  If they don't have
-      # access to it, we'll use what's already on the bug, otherwise we'll
-      # add this one in.
-      if ($userhasgroup || $bughasgroup) {
-        $::query .= " + $b";
-      }
+    my $groupAdd = "0";
+    my $groupDel = "0";
+
+    SendSQL("SELECT bit, isactive FROM groups WHERE " .
+            "isbuggroup != 0 AND bit & $::usergroupset != 0 ORDER BY bit");
+    while (my ($b, $isactive) = FetchSQLData()) {
+        if (!$::FORM{"bit-$b"}) {
+            $groupDel .= "+$b";
+        } elsif ($::FORM{"bit-$b"} == 1 && $isactive) {
+            $groupAdd .= "+$b";
+        }
+    }
+    if ($groupAdd ne "0" || $groupDel ne "0") {
+        DoComma();
+        # mysql < 3.23.5 doesn't support the ~ operator, even though
+        # the docs say that it does
+        $::query .= "groupset = ((groupset & ($::superusergroupset - ($groupDel))) | ($groupAdd))";
     }
-  }
 }
 
 foreach my $field ("rep_platform", "priority", "bug_severity",          
diff --git a/queryhelp.cgi b/queryhelp.cgi
index b4638ca1441ed6e78d536fa2f663b837ff08dd00..6a2a6880f29cb3813af8d63a560d8d092d3d8be8 100755
--- a/queryhelp.cgi
+++ b/queryhelp.cgi
@@ -601,6 +601,7 @@ SendSQL("SELECT product,description FROM products ORDER BY product");
 	while (MoreSQLData()) {
 
 	my ($product, $productdesc) = FetchSQLData();
+	next if (Param("usebuggroups") && GroupExists($product) && !UserInGroup($product));
 	push (@products, $product);
 
 	$line_count++;
diff --git a/t/CVS/Entries b/t/CVS/Entries
index 1648ccf8c0fae134a819aa918f339f94c5ea4e6a..e947fbf19208e01ed2d7bace3022a6602d76873f 100644
--- a/t/CVS/Entries
+++ b/t/CVS/Entries
@@ -1,3 +1,3 @@
-/001compile.t/1.6.6.1/Sat Nov 17 07:41:55 2001//TBUGZILLA-2_14_1
-/003safesys.t/1.3.6.1/Sat Nov 17 07:41:57 2001//TBUGZILLA-2_14_1
+/001compile.t/1.6.6.1/Sat Nov 17 07:41:55 2001//TBUGZILLA-2_14_2
+/003safesys.t/1.3.6.1/Sat Nov 17 07:41:57 2001//TBUGZILLA-2_14_2
 D/Support////
diff --git a/t/CVS/Tag b/t/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/t/CVS/Tag
+++ b/t/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2
diff --git a/t/Support/CVS/Entries b/t/Support/CVS/Entries
index c759f7e10e88944e3e7dbf8f29961450a7bf5c73..1f6019bb20a0f4414bf4efec26aa3e189729c3d5 100644
--- a/t/Support/CVS/Entries
+++ b/t/Support/CVS/Entries
@@ -1,3 +1,3 @@
-/Files.pm/1.9.4.1/Sat Nov 17 07:41:59 2001//TBUGZILLA-2_14_1
-/Systemexec.pm/1.2.8.1/Sat Nov 17 07:41:59 2001//TBUGZILLA-2_14_1
+/Files.pm/1.9.4.1/Sat Nov 17 07:41:59 2001//TBUGZILLA-2_14_2
+/Systemexec.pm/1.2.8.1/Sat Nov 17 07:41:59 2001//TBUGZILLA-2_14_2
 D
diff --git a/t/Support/CVS/Tag b/t/Support/CVS/Tag
index 705dc0579c785225ce6f96af498f7679df64b43d..3695fbab36938aeff3cfcf4c872dde6b637f5d4d 100644
--- a/t/Support/CVS/Tag
+++ b/t/Support/CVS/Tag
@@ -1 +1 @@
-NBUGZILLA-2_14_1
+NBUGZILLA-2_14_2