]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/service
Fix default user for usertags
[debbugs.git] / scripts / service
index c62e3d59e7c632d1457dbf26fd4dce8831ddd146..77165f88bc7265efa83700cae1749164a47854ab 100755 (executable)
@@ -32,7 +32,7 @@ use Debbugs::Versions::Dpkg;
 use Debbugs::Status qw(splitpackages);
 
 use Debbugs::CGI qw(html_escape);
-use Debbugs::Control qw(:all);
+use Debbugs::Control qw(:all valid_usertag);
 use Debbugs::Control::Service qw(:all);
 use Debbugs::Log qw(:misc);
 use Debbugs::Text qw(:templates);
@@ -425,7 +425,7 @@ END
            my %chtags;
            if (defined $tags and length $tags) {
                 for my $t (split /[,\s]+/, $tags) {
-                     if ($t =~ m/^[a-zA-Z0-9.+\@-]+$/) {
+                     if (valid_usertag($t)) {
                           $chtags{$t} = 1;
                      } else {
                           push @badtags, $t;
@@ -455,7 +455,11 @@ END
            } else {
                print {$transcript} "Usertags were: " . join(" ", @oldtags) . ".\n";
            }
-           print {$transcript} "Usertags are now: " . join(" ", @newtags) . ".\n";
+           if (@newtags == 0) {
+               print {$transcript} "There are now no usertags set.\n";
+           } else {
+               print {$transcript} "Usertags are now: " . join(" ", @newtags) . ".\n";
+           }
            Debbugs::User::write_usertags(\%ut, $user);
        }
     } elsif (!$control) {
@@ -518,7 +522,7 @@ eval{
     $temp_transcript = decode("utf8",$temp_transcript,Encode::FB_CROAK);
 };
 my $reply =
-    create_mime_message([From          => "$gMaintainerEmail ($gProject $gBug Tracking System)",
+    create_mime_message([From          => qq("$gProject $gBug Tracking System" <$gMaintainerEmail>),
                         To            => $replyto,
                         @maintccs ? (Cc => join(', ',@maintccs)):(),
                         Subject       => "Processed${error_text}: $header{subject}",
@@ -884,7 +888,7 @@ sub sendtxthelpraw {
     close(D);
     print {$transcript} "Sending $description in separate message.\n";
     &sendmailmessage(<<END.$doc,$replyto);
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
+From: "$gProject $gBug Tracking System" <$gMaintainerEmail>
 To: $replyto
 Subject: $gProject $gBug help: $description
 References: $header{'message-id'}
@@ -900,9 +904,12 @@ END
 sub sendlynxdocraw {
     my ($relpath,$description) = @_;
     $doc='';
-    open(L,"lynx -nolist -dump $gCGIDomain/\Q$relpath\E 2>&1 |") || die "fork for lynx: $!";
+    # work around DSA cert setup
+    $ENV{SSL_CERT_FILE}='/etc/ssl/ca-debian/ca-certificates.crt';
+    open(L,"lynx -nolist -dump https://$gCGIDomain/\Q$relpath\E 2>&1 |") || die "fork for lynx: $!";
     while(<L>) { $doc.=$_; }
     $!=0; close(L);
+    delete $ENV{SSL_CERT_FILE};
     if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {
         print {$transcript} "Information ($description) is not available -\n".
             "perhaps the $gBug does not exist or is not on the WWW yet.\n";
@@ -912,7 +919,7 @@ sub sendlynxdocraw {
     } else {
         print {$transcript} "Sending $description.\n";
         &sendmailmessage(<<END.$doc,$replyto);
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
+From: "$gProject $gBug Tracking System" <$gMaintainerEmail>
 To: $replyto
 Subject: $gProject $gBugs information: $description
 References: $header{'message-id'}
@@ -949,7 +956,7 @@ sub sendinfo {
     }
     print {$transcript} "Sending $description.\n";
     &sendmailmessage(<<END.$doc,$replyto);
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
+From: "$gProject $gBug Tracking System" <$gMaintainerEmail>
 To: $replyto
 Subject: $gProject $gBugs information: $description
 References: $header{'message-id'}