]> git.donarmstrong.com Git - debbugs.git/commitdiff
merge changes from dla source
authorDebian BTS <debbugs@rietz>
Thu, 4 Dec 2008 07:55:39 +0000 (07:55 +0000)
committerDebian BTS <debbugs@rietz>
Thu, 4 Dec 2008 07:55:39 +0000 (07:55 +0000)
17 files changed:
Debbugs/Bugs.pm
Debbugs/CGI.pm
Debbugs/CGI/Bugreport.pm
Debbugs/CGI/Pkgreport.pm
Debbugs/Config.pm
Debbugs/Control.pm
Debbugs/MIME.pm
cgi/bugreport.cgi
cgi/pkgreport.cgi
cgi/soap.cgi
debian/changelog
scripts/process
scripts/service
t/09_soap.t
templates/en_US/cgi/bugreport.tmpl
templates/en_US/cgi/pkgreport_options_search_key.tmpl
templates/en_US/html/html_tail.tmpl

index dfcb0c52ba805383593e00335ce79269cf590248..f7a6fbb52f1b7870423bab84e25f02ada6ddb5ec 100644 (file)
@@ -711,10 +711,14 @@ sub __handle_pkg_src_and_maint{
          # We only want to increment the number of keys if there is
          # something to match
          my $key_inc = 0;
-         for my $package ((map { getsrcpkgs($_)} make_list($param{src})),make_list($param{src})) {
+         for my $package ((map { getsrcpkgs($_)} make_list($param{src}))) {
               $packages{$package}++;
               $key_inc=1;
          }
+         for my $package (make_list($param{src})) {
+              $packages{"src:$package"}++;
+              $key_inc=1;
+         }
          $package_keys += $key_inc;
      }
      if (exists $param{maint}) {
index cceeb36cdddf8df589536e2c24bf604be3c5a7b4..eef564992b3d16ed4e91bf960f3f8387f198ae4b 100644 (file)
@@ -35,12 +35,16 @@ use warnings;
 use strict;
 use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT);
 use base qw(Exporter);
+
 use Debbugs::URI;
 use HTML::Entities;
 use Debbugs::Common qw(getparsedaddrs make_list);
 use Params::Validate qw(validate_with :types);
+
 use Debbugs::Config qw(:config);
 use Debbugs::Status qw(splitpackages isstrongseverity);
+use Debbugs::User qw();
+
 use Mail::Address;
 use POSIX qw(ceil);
 use Storable qw(dclone);
@@ -70,6 +74,7 @@ BEGIN{
                     util   => [qw(cgi_parameters quitcgi),
                               ],
                     forms  => [qw(option_form form_options_and_normal_param)],
+                    usertags => [qw(add_user)],
                     misc   => [qw(maint_decode)],
                     package_search => [qw(@package_search_key_order %package_search_keys)],
                     #status => [qw(getbugstatus)],
@@ -530,6 +535,11 @@ the split links with commas and spaces.
 
 sub maybelink {
     my ($links,$regex,$join) = @_;
+    if (not defined $regex and not defined $join) {
+        $links =~ s{((?:ftp|http|https)://[\S~-]+?/?)([\)\'\:\.\,]?(?:\s|\.<|$))}
+                   {q(<a href=\").html_escape($1).q(\">).html_escape($1).q(</a>).$2}geimo;
+        return $links;
+    }
     $join = ' ' if not defined $join;
     my @return;
     my @segments;
@@ -630,6 +640,38 @@ sub bug_linklist{
 }
 
 
+sub add_user {
+     my ($user,$usertags,$bug_usertags,$seen_users,$cats,$hidden) = @_;
+     $seen_users = {} if not defined $seen_users;
+     $bug_usertags = {} if not defined $bug_usertags;
+     $usertags = {} if not defined $usertags;
+     $cats = {} if not defined $cats;
+     $hidden = {} if not defined $hidden;
+     return if exists $seen_users->{$user};
+     $seen_users->{$user} = 1;
+
+     my $u = Debbugs::User::get_user($user);
+
+     my %vis = map { $_, 1 } @{$u->{"visible_cats"}};
+     for my $c (keys %{$u->{"categories"}}) {
+         $cats->{$c} = $u->{"categories"}->{$c};
+         $hidden->{$c} = 1 unless defined $vis{$c};
+     }
+     for my $t (keys %{$u->{"tags"}}) {
+         $usertags->{$t} = [] unless defined $usertags->{$t};
+         push @{$usertags->{$t}}, @{$u->{"tags"}->{$t}};
+     }
+
+     %{$bug_usertags} = ();
+     for my $t (keys %{$usertags}) {
+         for my $b (@{$usertags->{$t}}) {
+              $bug_usertags->{$b} = [] unless defined $bug_usertags->{$b};
+              push @{$bug_usertags->{$b}}, $t;
+         }
+     }
+}
+
+
 
 =head1 Forms
 
@@ -825,7 +867,8 @@ sub option_form{
               if (defined $value and $o_value eq $value) {
                    $selected = ' selected';
               }
-              $output .= qq(<option value="$o_value"$selected>$name</option>\n);
+              $output .= q(<option value=").html_escape($o_value).qq("$selected>).
+                  html_escape($name).qq(</option>\n);
          }
          return $output;
      };
@@ -835,6 +878,8 @@ sub option_form{
      return Debbugs::Text::fill_in_template(template=>$param{template},
                                            (exists $param{language}?(language=>$param{language}):()),
                                            variables => $variables,
+                                           hole_var  => {'&html_escape' => \&html_escape,
+                                                        },
                                           );
 }
 
index a01c2de4ff568a318aa18a62a2555581923f7077..90cf5272e1d7f5d73f20a005ac57d46759b21eb7 100644 (file)
@@ -314,7 +314,7 @@ sub handle_record{
      local $_ = $record->{type};
      if (/html/) {
          my ($time) = $record->{text} =~ /<!--\s+time:(\d+)\s+-->/;
-         my $class = $record->{text} =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/ ? 'infmessage':'msgreceived';
+         my $class = $record->{text} =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/m ? 'infmessage':'msgreceived';
          $output .= decode_rfc1522($record->{text});
          # Link to forwarded http:// urls in the midst of the report
          # (even though these links already exist at the top)
index beba95a89694f563b6085fccf20664d66ee9b800..feb85a91280da6bc05d61cc4b82dea91ae179d0e 100644 (file)
@@ -110,7 +110,8 @@ sub generate_package_info{
          print {$output} ".</p>\n";
      }
      else {
-         print {$output} "<p>No maintainer for $showpkg. Please do not report new bugs against this package.</p>\n";
+         print {$output} "<p>There is no maintainer for $showpkg. ".
+              "Please do not report new bugs against this package.</p>\n";
      }
      my @pkgs = getsrcpkgs($srcforpkg);
      @pkgs = grep( !/^\Q$package\E$/, @pkgs );
@@ -132,6 +133,11 @@ sub generate_package_info{
          push @references, "to the <a href=\"http://$config{web_domain}/pseudo-packages$config{html_suffix}\">".
               "list of other pseudo-packages</a>";
      }
+     elsif (not defined $maint and not @{$param{bugs}}) {
+         print {$output} "<p>There is no record of the " . html_escape($package) .
+              ($param{binary} ? " package" : " source package") .
+                   ", and no bugs have been filed against it.</p>";
+     }
      else {
          if ($package and defined $config{package_pages} and length $config{package_pages}) {
               push @references, sprintf "to the <a href=\"%s\">%s package page</a>",
@@ -160,11 +166,6 @@ sub generate_package_info{
          printf {$output} "<a href=\"%s\">report it</a>.</p>\n",
               html_escape("http://$config{web_domain}/Reporting$config{html_suffix}");
      }
-     if (not defined $maint and not @{$param{bugs}}) {
-         print {$output} "<p>There is no record of the " . html_escape($package) .
-              ($param{binary} ? " package" : " source package") .
-                   ", and no bugs have been filed against it.</p>";
-     }
      return $output_scalar;
 }
 
index a212a799754112a1e56af4c64f9efd10ab083f18..2b34c664b0954a32b72bfa54decac34bae4930fe 100644 (file)
@@ -68,6 +68,7 @@ BEGIN {
                                 qw(@gPostProcessall @gRemovalDefaultDistributionTags @gRemovalDistributionTags @gRemovalArchitectures),
                                 qw(@gRemovalStrongSeverityDefaultDistributionTags),
                                 qw(@gDefaultArchitectures),
+                                qw($gMachineName),
                                 qw($gTemplateDir),
                                 qw($gDefaultPackage),
                                 qw($gSpamMaxThreads $gSpamSpamsPerThread $gSpamKeepRunning $gSpamScan $gSpamCrossassassinDb),
@@ -276,6 +277,22 @@ Default: $config{maintainer_email}
 
 set_default(\%config,'unknown_maintainer_email',$config{maintainer_email});
 
+=item machine_name
+
+The name of the machine that this instance of debbugs is running on
+(currently used for debbuging purposes and web page output.)
+
+Default: qx(hostname --fqdn)
+
+=back
+
+=cut
+
+my $_old_path = $ENV{PATH};
+$ENV{PATH} = '/bin:/usr/bin:/usr/local/bin';
+set_default(\%config,'machine_name',qx(hostname --fqdn));
+$ENV{PATH} = $_old_path;
+
 =head2 BTS Mailing Lists
 
 
@@ -299,6 +316,8 @@ set_default(\%config,'unknown_maintainer_email',$config{maintainer_email});
 
 =item mirror_list
 
+=item strong_list
+
 =cut
 
 set_default(\%config,   'submit_list',   'bug-submit-list');
index 7cb645ed4f4aa65cd9693b48a927f3b58f20aac2..bedc7d88a6f3445c67ee253ecd9e1a91dcea05b4 100644 (file)
@@ -826,7 +826,7 @@ sub bug_unarchive {
         die "No bug found for $param{bug}";
      }
      print {$debug} "$param{bug} read done\n";
-     my @bugs = map {$_->{bug_num}} @data;
+     my @bugs = map {(defined $_ and exists $_->{bug_num} and defined $_->{bug_num})?$_->{bug_num}:()} @data;
      print {$debug} "$param{bug} bugs ".join(' ',@bugs)."\n";
      print {$debug} "$param{bug} unarchiving\n";
      my @files_to_remove;
@@ -974,6 +974,7 @@ sub __handle_affected_packages{
                               allow_extra => 1,
                              );
      for my $data (make_list($param{data})) {
+         next unless exists $data->{package} and defined $data->{package};
          $param{affected_packages}{$data->{package}} = 1;
      }
 }
index 785997477ce9a3e2af44051f6a76595d02e61155..0d35b0fb85e8b259fdf37d3faad373dc5f51087f 100644 (file)
@@ -24,6 +24,9 @@ BEGIN {
 use File::Path;
 use MIME::Parser;
 
+use POSIX qw(strftime);
+use List::MoreUtils qw(apply);
+
 # for decode_rfc1522
 use MIME::WordDecoder qw();
 use Encode qw(decode encode encode_utf8 decode_utf8 is_utf8);
@@ -114,13 +117,17 @@ sub parse
 
 =head2 create_mime_message
 
-     create_mime_message([To=>'don@debian.org'],$body,[$attach1, $attach2]);
+     create_mime_message([To=>'don@debian.org'],$body,[$attach1, $attach2],$include_date);
 
 Creates a MIME encoded message with headers given by the first
 argument, and a message given by the second.
 
 Optional attachments can be specified in the third arrayref argument.
 
+Whether to include the date in the header is the final argument; it
+defaults to true, setting the Date header if one is not already
+present.
+
 Headers are passed directly to MIME::Entity::build, the message is the
 first attachment.
 
@@ -132,12 +139,23 @@ MIME::Entity::attach
 =cut
 
 sub create_mime_message{
-     my ($headers,$body,$attachments) = @_;
+     my ($headers,$body,$attachments,$include_date) = @_;
      $attachments = [] if not defined $attachments;
+     $include_date = 1 if not defined $include_date;
 
      die "The first argument to create_mime_message must be an arrayref" unless ref($headers) eq 'ARRAY';
      die "The third argument to create_mime_message must be an arrayref" unless ref($attachments) eq 'ARRAY';
 
+     if ($include_date) {
+        my %headers = apply {lc($_)} @{$headers};
+        if (not exists $headers{date}) {
+            push @{$headers},
+                ('Date',
+                 strftime("%a, %d %b %Y %H:%M:%S +0000",gmtime)
+                );
+        }
+     }
+
      # Build the message
      # MIME::Entity is stupid, and doesn't rfc1522 encode its headers, so we do it for it.
      my $msg = MIME::Entity->build('Content-Type' => 'text/plain; charset=utf-8',
index 456bd69e9091d7264dc0de750e3bc0b36b50d8e3..c50d58604722280f86924e3333ae30b8ed4193bf 100755 (executable)
@@ -15,7 +15,7 @@ use Debbugs::Config qw(:globals :text);
 use Debbugs::Log qw(read_log_records);
 use Debbugs::CGI qw(:url :html :util);
 use Debbugs::CGI::Bugreport qw(:all);
-use Debbugs::Common qw(buglog getmaintainers);
+use Debbugs::Common qw(buglog getmaintainers make_list);
 use Debbugs::Packages qw(getpkgsrc);
 use Debbugs::Status qw(splitpackages get_bug_status isstrongseverity);
 
@@ -23,6 +23,7 @@ use Scalar::Util qw(looks_like_number);
 
 use Debbugs::Text qw(:templates);
 
+
 use CGI::Simple;
 my $q = new CGI::Simple;
 
@@ -58,6 +59,29 @@ my $reverse = $param{'reverse'} eq 'yes';
 my $mbox = $param{'mbox'} eq 'yes';
 my $mime = $param{'mime'} eq 'yes';
 
+my %bugusertags;
+my %ut;
+my %seen_users;
+
+for my $user (map {split /[\s*,\s*]+/} make_list($param{users}||[])) {
+    next unless length($user);
+    add_user($user,\%ut,\%bugusertags,\%seen_users);
+}
+
+if (defined $param{usertag}) {
+     for my $usertag (make_list($param{usertag})) {
+         my %select_ut = ();
+         my ($u, $t) = split /:/, $usertag, 2;
+         Debbugs::User::read_usertags(\%select_ut, $u);
+         unless (defined $t && $t ne "") {
+              $t = join(",", keys(%select_ut));
+         }
+         add_user($u,\%ut,\%bugusertags,\%seen_users);
+         push @{$param{tag}}, split /,/, $t;
+     }
+}
+
+
 my $trim_headers = ($param{trim} || ((defined $msg and $msg)?'no':'yes')) eq 'yes';
 
 my $mbox_status_message = $param{mboxstat} eq 'yes';
@@ -110,7 +134,9 @@ if ($buglog =~ m/\.gz$/) {
 }
 
 
-my %status = %{get_bug_status(bug=>$ref)};
+my %status = %{get_bug_status(bug=>$ref,
+                             bugusertags => \%bugusertags,
+                            )};
 
 my @records;
 eval{
@@ -133,13 +159,17 @@ my @log;
 if ( $mbox ) {
      my $date = strftime "%a %b %d %T %Y", localtime;
      if (@records > 1) {
-         print qq(Content-Disposition: attachment; filename="bug_${ref}.mbox"\n);
-         print "Content-Type: text/plain\n\n";
+        print $q->header(-type => "text/plain",
+                         content_disposition => qq(attachment; filename="bug_${ref}.mbox"),
+                         (length $mtime)?(-last_modified => $mtime):(),
+                        );
      }
      else {
          $msg_num++;
-         print qq(Content-Disposition: attachment; filename="bug_${ref}_message_${msg_num}.mbox"\n);
-         print "Content-Type: message/rfc822\n\n";
+         print $q->header(-type => "message/rfc822",
+                          content_disposition => qq(attachment; filename="bug_${ref}_message_${msg_num}.mbox"),
+                          (length $mtime)?(-last_modified => $mtime):(),
+                         );
      }
      if ($mbox_status_message and @records > 1) {
          my $status_message='';
@@ -328,6 +358,7 @@ print fill_in_template(template => 'cgi/bugreport',
                                     log           => $log,
                                     bug_num       => $ref,
                                     version_graph => $version_graph,
+                                    msg           => $msg,
                                     isstrongseverity => \&Debbugs::Status::isstrongseverity,
                                     html_escape   => \&Debbugs::CGI::html_escape,
                                     looks_like_number => \&Scalar::Util::looks_like_number,
index 3ddad9bf17431dc1f97cd5cc192d5104a5448fe0..f8eb6a44aecb0091f54120f037f850826c8ded95 100755 (executable)
@@ -236,11 +236,13 @@ if (exists $param{pkg}) {
      delete $param{pkg};
 }
 
-our %bugusertags;
-our %ut;
+my %bugusertags;
+my %ut;
+my %seen_users;
+
 for my $user (map {split /[\s*,\s*]+/} make_list($param{users}||[])) {
     next unless length($user);
-    add_user($user);
+    add_user($user,\%ut,\%bugusertags,\%seen_users,\%cats,\%hidden);
 }
 
 if (defined $param{usertag}) {
@@ -251,7 +253,7 @@ if (defined $param{usertag}) {
          unless (defined $t && $t ne "") {
               $t = join(",", keys(%select_ut));
          }
-         add_user($u);
+         add_user($u,\%ut,\%bugusertags,\%seen_users,\%cats,\%hidden);
          push @{$param{tag}}, split /,/, $t;
      }
 }
@@ -268,42 +270,6 @@ my $this = munge_url('pkgreport.cgi?',
 my %indexentry;
 my %strings = ();
 
-my $dtime = strftime "%a, %e %b %Y %T UTC", gmtime;
-my $tail_html = $gHTMLTail;
-$tail_html = $gHTMLTail;
-$tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
-
-our %seen_users;
-sub add_user {
-    my $ut = \%ut;
-    my $u = shift;
-
-    return if $seen_users{$u};
-    $seen_users{$u} = 1;
-
-    my $user = Debbugs::User::get_user($u);
-
-    my %vis = map { $_, 1 } @{$user->{"visible_cats"}};
-    for my $c (keys %{$user->{"categories"}}) {
-        $cats{$c} = $user->{"categories"}->{$c};
-       $hidden{$c} = 1 unless defined $vis{$c};
-    }
-
-    for my $t (keys %{$user->{"tags"}}) {
-        $ut->{$t} = [] unless defined $ut->{$t};
-        push @{$ut->{$t}}, @{$user->{"tags"}->{$t}};
-    }
-
-    %bugusertags = ();
-    for my $t (keys %{$ut}) {
-        for my $b (@{$ut->{$t}}) {
-            $bugusertags{$b} = [] unless defined $bugusertags{$b};
-            push @{$bugusertags{$b}}, $t;
-        }
-    }
-#    set_option("bugusertags", \%bugusertags);
-}
-
 my @bugs;
 
 # addusers for source and binary packages being searched for
@@ -323,7 +289,8 @@ for my $package (# For binary packages, add the binary package
                 ),
                ) {
      next unless defined $package;
-     add_user($package.'@'.$config{usertag_package_domain})
+     add_user($package.'@'.$config{usertag_package_domain},
+             \%ut,\%bugusertags,\%seen_users,\%cats,\%hidden)
          if defined $config{usertag_package_domain};
 }
 
@@ -486,24 +453,6 @@ if (exists $param{submitter}) {
     print "different addresses.\n";
 }
 
-# my $archive_links;
-# my @archive_links;
-# my %archive_values = (both => 'archived and unarchived',
-#                    0    => 'not archived',
-#                    1    => 'archived',
-#                   );
-# while (my ($key,$value) = each %archive_values) {
-#      next if $key eq lc($param{archive});
-#      push @archive_links, qq(<a href=").
-#        html_escape(pkg_url((
-#                     map {
-#                          $_ eq 'archive'?():($_,$param{$_})
-#                     } keys %param),
-#                          archive => $key
-#                         )).qq(">$value reports </a>);
-# }
-# print '<p>See the '.join (' or ',@archive_links)."</p>\n";
-
 print $result;
 
 print pkg_javascript() . "\n";
@@ -516,115 +465,10 @@ print option_form(template => 'cgi/pkgreport_options',
                  variables => $form_option_variables,
                 );
 
-# print "<h2 class=\"outstanding\"><a class=\"options\" href=\"javascript:toggle(1)\">Options</a></h2>\n";
-# print "<div id=\"a_1\">\n";
-# printf "<form action=\"%s\" method=POST>\n", myurl();
-# 
-# print "<table class=\"forms\">\n";
-# 
-# my ($checked_any, $checked_sui, $checked_ver) = ("", "", "");
-# if (defined $dist) {
-#   $checked_sui = "CHECKED";
-# } elsif (defined $version) {
-#   $checked_ver = "CHECKED";
-# } else {
-#   $checked_any = "CHECKED";
-# }
-# 
-# print "<tr><td>Show bugs applicable to</td>\n";
-# print "    <td><input id=\"b_1_1\" name=vt value=none type=radio onchange=\"enable(1);\" $checked_any>anything</td></tr>\n";
-# print "<tr><td></td>";
-# print "    <td><input id=\"b_1_2\" name=vt value=bysuite type=radio onchange=\"enable(1);\" $checked_sui>" . pkg_htmlselectsuite(1,2,1) . " for " . pkg_htmlselectarch(1,2,2) . "</td></tr>\n";
-# 
-# if (defined $pkg) {
-#     my $v = html_escape($version) || "";
-#     my $pkgsane = html_escape($pkg->[0]);
-#     print "<tr><td></td>";
-#     print "    <td><input id=\"b_1_3\" name=vt value=bypkg type=radio onchange=\"enable(1);\" $checked_ver>$pkgsane version <input id=\"b_1_3_1\" name=version value=\"$v\"></td></tr>\n";
-# } elsif (defined $src) {
-#     my $v = html_escape($version) || "";
-#     my $srcsane = html_escape($src->[0]);
-#     print "<tr><td></td>";
-#     print "    <td><input name=vt value=bysrc type=radio onchange=\"enable(1);\" $checked_ver>$srcsane version <input id=\"b_1_3_1\" name=version value=\"$v\"></td></tr>\n";
-# }
-# print "<tr><td>&nbsp;</td></tr>\n";
-# 
-# my $includetags = html_escape(join(" ", grep { !m/^subj:/i } map {split /[\s,]+/} ref($include)?@{$include}:$include));
-# my $excludetags = html_escape(join(" ", grep { !m/^subj:/i } map {split /[\s,]+/} ref($exclude)?@{$exclude}:$exclude));
-# my $includesubj = html_escape(join(" ", map { s/^subj://i; $_ } grep { m/^subj:/i } map {split /[\s,]+/} ref($include)?@{$include}:$include));
-# my $excludesubj = html_escape(join(" ", map { s/^subj://i; $_ } grep { m/^subj:/i } map {split /[\s,]+/} ref($exclude)?@{$exclude}:$exclude));
-# my $vismindays = ($mindays == 0 ? "" : $mindays);
-# my $vismaxdays = ($maxdays == -1 ? "" : $maxdays);
-# 
-# my $sel_rmy = ($param{repeatmerged} ? " selected" : "");
-# my $sel_rmn = ($param{repeatmerged} ? "" : " selected");
-# my $sel_ordraw = ($ordering eq "raw" ? " selected" : "");
-# my $sel_ordold = ($ordering eq "oldview" ? " selected" : "");
-# my $sel_ordnor = ($ordering eq "normal" ? " selected" : "");
-# my $sel_ordage = ($ordering eq "age" ? " selected" : "");
-# 
-# my $chk_bugrev = ($bug_rev ? " checked" : "");
-# my $chk_pendrev = ($pend_rev ? " checked" : "");
-# my $chk_sevrev = ($sev_rev ? " checked" : "");
-# 
-# print <<EOF;
-# <tr><td>Only include bugs tagged with </td><td><input name=include value="$includetags"> or that have <input name=includesubj value="$includesubj"> in their subject</td></tr>
-# <tr><td>Exclude bugs tagged with </td><td><input name=exclude value="$excludetags"> or that have <input name=excludesubj value="$excludesubj"> in their subject</td></tr>
-# <tr><td>Only show bugs older than</td><td><input name=mindays value="$vismindays" size=5> days, and younger than <input name=maxdays value="$vismaxdays" size=5> days</td></tr>
-# 
-# <tr><td>&nbsp;</td></tr>
-# 
-# <tr><td>Merged bugs should be</td><td>
-# <select name=repeatmerged>
-# <option value=yes$sel_rmy>displayed separately</option>
-# <option value=no$sel_rmn>combined</option>
-# </select>
-# <tr><td>Categorise bugs by</td><td>
-# <select name=ordering>
-# <option value=raw$sel_ordraw>bug number only</option>
-# <option value=old$sel_ordold>status and severity</option>
-# <option value=normal$sel_ordnor>status, severity and classification</option>
-# <option value=age$sel_ordage>status, severity, classification, and age</option>
-# EOF
-# 
-# {
-# my $any = 0;
-# my $o = $param{"ordering"} || "";
-# for my $n (keys %cats) {
-#     next if ($n eq "normal" || $n eq "oldview");
-#     next if defined $hidden{$n};
-#     unless ($any) {
-#         $any = 1;
-#      print "<option disabled>------</option>\n";
-#     }
-#     my @names = map { ref($_) eq "HASH" ? $_->{"nam"} : $_ } @{$cats{$n}};
-#     my $name;
-#     if (@names == 1) { $name = $names[0]; }
-#     else { $name = " and " . pop(@names); $name = join(", ", @names) . $name; }
-# 
-#     printf "<option value=\"%s\"%s>%s</option>\n",
-#         $n, ($o eq $n ? " selected" : ""), $name;
-# }
-# }
-# 
-# print "</select></td></tr>\n";
-# 
-# printf "<tr><td>Order bugs by</td><td>%s</td></tr>\n",
-#     pkg_htmlselectyesno("pend-rev", "outstanding bugs first", "done bugs first", $pend_rev);
-# printf "<tr><td></td><td>%s</td></tr>\n",
-#     pkg_htmlselectyesno("sev-rev", "highest severity first", "lowest severity first", $sev_rev);
-# printf "<tr><td></td><td>%s</td></tr>\n",
-#     pkg_htmlselectyesno("bug-rev", "oldest bugs first", "newest bugs first", $bug_rev);
-# 
-# print <<EOF;
-# <tr><td>&nbsp;</td></tr>
-# <tr><td colspan=2><input value="Reload page" type="submit"> with new settings</td></tr>
-# EOF
-# 
-# print "</table></form></div>\n";
-
 print "<hr>\n";
-print "<p>$tail_html";
-
+print fill_in_template(template=>'html/html_tail',
+                      hole_var => {'&strftime' => \&POSIX::strftime,
+                                  },
+                     );
 print "</body></html>\n";
 
index f6b0d0410c4daeeb5f29dbd4a6a7e3ae9e0615fc..2b68ddd2f89850698edfdff45de6fffe0770ad74 100755 (executable)
@@ -1,4 +1,7 @@
-#!/usr/bin/perl -wT
+#!/usr/bin/perl -T
+
+use warnings;
+use strict;
 
 #use SOAP::Transport::HTTP;
 
@@ -24,5 +27,13 @@ for my $key (keys %{$typelookup}) {
      next unless defined $_ and /Month|Day|Year|date|time|duration/i;
      delete $typelookup->{$key};
 }
-$soap->handle;
 
+our $warnings = '';
+eval {
+    # Ignore stupid warning because elements (hashes) can't start with
+    # numbers
+    local $SIG{__WARN__} = sub {$warnings .= $_[0] unless $_[0] =~ /Cannot encode unnamed element/};
+    $soap->handle;
+};
+die $@ if $@;
+warn $warnings if length $warnings;
index 7e3d7685a70aeffe5058d0ae9b9a380b34af8487..09f23e173e9804662073f1a4ad41eebf9a7ee0a4 100644 (file)
@@ -208,12 +208,12 @@ debbugs (2.4.2) UNRELEASED; urgency=low
   * Fix casing of versions (closes: #441022)
   * Output last-modified in bugreport.cgi (closes: #459709)
   * Fix various html syntax errors in pkgreport.cgi (closes: #462322)
-  * Make search case insensitive (closes: #448861)
+  * Make search case insensitive (closes: #448861, #444416)
   * Add the ability to return source/package mapping
     (closes: #465332,#458822)
   * Deal properly with \r line endings (closes: #467190)
   * Distinguish between reports and followups (closes: #459866)
-  * Allow for the archiving of bugs in removed packages (closes: #475622)
+  * Allow for the archiving of bugs in removed packages (closes: #475622, #470146)
   * Add Text::Template based templating system (closes: #36814)
   * Add new uservalue feature to Debbugs::User
   * Don't serialize things as date/time in soap (closes: #484789)
@@ -226,6 +226,18 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     (closes: #499997)
   * Comment out CGI::Alert use for the time being (closes: #499681)
   * No longer hard-code paths in age-1 (closes: #499682)
+  * Change how maybelink links links (closes: #501757)
+  * Use bug_subscription_domain in process (closes: #499680)
+  * Clean up links when there is no information about a package
+    (closes: #452905)
+  * Deal properly with leading spaces in query arguments (closes: #158375)
+  * Only send out control help when control is mailed (closes: #499941)
+  * Resolve two XSS (closes: #504608)
+  * Strip BOM before regexes involving spaces (closes: #488554)
+  * Display link to full log again (closes: #507506)
+  * Add Last-Modified: header support to mbox download (closes: #456786)
+  * Add Date headers if missing (closes: #458757)
+  * Indiciate what machine has built webpages (closes: #507022)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100
index 9c5d38a861d1d6ba7bf8b2ea6edb825b82d1ac2d..1bcc940f98a5117e386ecce7f78a4070d58efcf3 100755 (executable)
@@ -170,6 +170,9 @@ my %pheader;
 # extract pseudo-headers
 for my $phline (@bodylines)
 {
+    # Remove BOM markers from UTF-8 strings
+    # Fixes #488554
+    $phline =~ s/\xef\xbb\xbf//g;
     last if $phline !~ m/^([\w-]+):\s*(\S.*)/;
     my ($fn, $fv) = ($1, $2);
     $fv =~ s/\s*$//;
@@ -1128,9 +1131,18 @@ sub bug_list_forward{
      my ($bug_fn) = @_;
      # Read the bug information and package information for passing to
      # the mailing list
+     my $bug_fh = IO::File->new("incoming/P$bug_fn",'r') or
+         die "Unable to open incoming/P$bug_fn $!";
+
+     if (not defined $config{bug_subscription_domain} or not
+        length $config{bug_subscription_domain}) {
+         unlink("incoming/P$bug_fn") or
+              die "unlinking incoming/P$bug_fn: $!";
+         exit 0;
+     }
+
      my ($bug_number) = $bug_fn =~ /^L(\d+)\./;
-     my ($bfound, $data)= lockreadbugmerge($bug_number);
-     my $bug_fh = IO::File->new("incoming/P$bug_fn",'r') or die "Unable to open incoming/P$bug_fn $!";
+     my $data = read_bug(bug => $bug_number);
 
      local $/ = undef;
      my $bug_message = <$bug_fh>;
@@ -1155,10 +1167,10 @@ sub bug_list_forward{
      # If we don't have a bug address, something has gone horribly wrong.
      print STDERR "Doesn't match: $bug_address\n" and exit 1 unless defined $bug_address;
      $bug_address =~ s/\@.+//;
-     print DEBUG "Sending message to bugs=$bug_address\@$gListDomain\n";
+     print DEBUG "Sending message to bugs=$bug_address\@$config{bug_subscription_domain}\n";
      print DEBUG $header.qq(\n\n).$body;
      send_mail_message(message        => $header.qq(\n\n).$body,
-                      recipients     => ["bugs=$bug_address\@$gListDomain"],
+                      recipients     => ["bugs=$bug_address\@$config{bug_subscription_domain}"],
                       envelope_from  => $envelope_from,
                       encode_headers => 0,
                      );
index ccdd0f778af34b6e42e1520a84a634e2a33dbeaf..94b2571b5a08dca6fdc121b47f8bba4c68fb81e2 100755 (executable)
@@ -84,6 +84,7 @@ for (@headerlines) {
     }
 }
 $header{'message-id'} ||= '';
+$header{subject} ||= '';
 
 grep(s/\s+$//,@bodylines);
 
@@ -175,6 +176,9 @@ for ($procline=0; $procline<=$#bodylines; $procline++) {
         last;
     }
     $_= $bodylines[$procline]; s/\s+$//;
+    # Remove BOM markers from UTF-8 strings
+    # Fixes #488554
+    s/\xef\xbb\xbf//g;
     next unless m/\S/;
     print {$transcript} "> $_\n";
     next if m/^\s*\#/;
@@ -1528,9 +1532,12 @@ sub message_body_template{
 }
 
 sub sendhelp {
-        &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
-        &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
-            if $control;
+     if ($control) {
+         &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
+     }
+     else {
+         &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
+     }
 }
 
 #sub unimplemented {
index 2a04c60e07da530176262ced80b81d4150a16690..4967a9c8a15baff7cf123fd935eb97929754b756 100644 (file)
@@ -81,20 +81,33 @@ else {
      eval q(
      use Debbugs::SOAP::Server;
      @Debbugs::SOAP::Server::ISA = qw(SOAP::Transport::HTTP::Daemon);
-     Debbugs::SOAP::Server
+     our $warnings = '';
+     eval {
+       # Ignore stupid warning because elements (hashes) can't start with
+       # numbers
+       local $SIG{__WARN__} = sub {$warnings .= $_[0] unless $_[0] =~ /Cannot encode unnamed element/};
+       Debbugs::SOAP::Server
               ->new(LocalAddr => 'localhost', LocalPort => $port)
                    ->dispatch_to('/','Debbugs::SOAP')
                         ->handle;
+      };
+      die $@ if $@;
+      warn $warnings if length $warnings;
+
      );
 }
 
 use SOAP::Lite;
 my $soap = SOAP::Lite->uri('Debbugs/SOAP')->proxy('http://localhost:'.$port.'/');
 #ok($soap->get_soap_version->result == 1,'Version set and got correctly');
-my $bugs = $soap->get_bugs(package => 'foo')->result;
+my $bugs_result = $soap->get_bugs(package => 'foo');
+my $bugs = $bugs_result->result;
 use Data::Dumper;
+#print STDERR Dumper($bugs_result);
 ok(@{$bugs} == 1 && $bugs->[0] == 1, 'get_bugs returns bug number 1') or fail(Dumper($bugs));
-my $status = $soap->get_status(1)->result;
+my $status_result = $soap->get_status(1);
+#print STDERR Dumper($status_result);
+my $status = $status_result->result;
 ok($status->{1}{package} eq 'foo','get_status thinks that bug 1 belongs in foo') or fail(Dumper($status));
 
 # Test the usertags at some point
index 18bc5fdb77e2fe92a071bf27aec9e5bb8ecbd934..cc8d57ddd5282c71fab93b91cb3ccec7e8b293b4 100644 (file)
@@ -24,7 +24,7 @@ function toggle_infmessages()
 {include(q(cgi/bugreport_buginfo))}
 { my $output = '';
   if (looks_like_number($msg)) {
-     $output .= sprintf qq(<p><a href="%s">Full log</a></p>),html_escape(bug_links(bug=>$ref,links_only=>1));
+     $output .= sprintf qq(<p><a href="%s">Full log</a></p>),html_escape(bug_links(bug=>$bug_num,links_only=>1));
   }
   else {
      $output .=  qq(<p><a href="mailto:$bug_num\@$config{email_domain}">Reply</a> ).
index 1c2ecd9df0421086cf050980b7afd34f5402e7d8..e09fdff3f889374336598897e6303658f49e4a2f 100644 (file)
@@ -1,6 +1,6 @@
 <nobr><select name="_fo_searchkey">
 {output_select_options(\@search_key_order,$search||'')}
 </select>
-<input type="text" name="_fo_searchvalue" value ="{$search_value||''}">
+<input type="text" name="_fo_searchvalue" value ="{html_escape($search_value||'')}">
 <!-- {$value_index} -->
 </nobr>
index d7eb979e82d5c1cc031cc89aac6bb056717ba522..59e671f73c4e85ac02c1a49ba0af0b294ffecbe0 100644 (file)
@@ -3,6 +3,10 @@ Last modified:
 <!--timestamp-->
 {$last_modified||strftime('%c',gmtime)}
 <!--timestamp-->
+Machine Name:
+<!--machinename-->
+{$config{machine_name}||'Unknown'}
+<!--machinename-->
 <P>
 <A HREF="http://{$config{web_domain}}/">{$config{project}} {$config{bug}} tracking system</A><BR>
 Copyright (C) 1999 Darren O. Benham,