summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-04-05 08:57:47 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-04-05 08:57:47 -0700
commite14ddc9dc9188b8f92fb251d9a9c1a508a0427dd (patch)
treee73d5acfa9a253f2416077c3bfc72c466a3aa434
parenta434b2c3bb331f765b08b43fb58feab6bcb0cca4 (diff)
parenteb46ea661857465629e06e4ca3527a38de3aeea7 (diff)
downloadmailscripts-e14ddc9dc9188b8f92fb251d9a9c1a508a0427dd.tar.gz
Merge tag 'debian/0.7-1' into stretch-bpo
mailscripts release 0.7-1 for unstable (sid) [dgit] [dgit distro=debian] # gpg: Signature made Wed 06 Mar 2019 11:43:53 AM MST # gpg: using RSA key 9B917007AE030E36E4FC248B695B7AE4BF066240 # gpg: Good signature from "Sean Whitton <spwhitton@spwhitton.name>" [ultimate] # Primary key fingerprint: 8DC2 487E 51AB DD90 B5C4 753F 0F56 D055 3B6D 411B # Subkey fingerprint: 9B91 7007 AE03 0E36 E4FC 248B 695B 7AE4 BF06 6240
-rw-r--r--debian/changelog24
-rw-r--r--debian/control1
-rw-r--r--debian/copyright2
-rw-r--r--mailscripts.el2
-rwxr-xr-xnotmuch-slurp-debbug27
5 files changed, 41 insertions, 15 deletions
diff --git a/debian/changelog b/debian/changelog
index cd1a2f0..f69a0b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+mailscripts (0.7-1) unstable; urgency=high
+
+ * notmuch-slurp-debbug: Fix the --bts-server argument.
+ The 0.6 release broke use of this argument.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Wed, 06 Mar 2019 11:37:42 -0700
+
+mailscripts (0.6-1) unstable; urgency=high
+
+ * notmuch-slurp-debbug: Further ensure that superfluous shells are not
+ invoked by switching from system() and backticks to functions from
+ IPC::System::Simple.
+ - d/control: add runtime dependency on libipc-system-simple-perl.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Wed, 06 Mar 2019 11:14:30 -0700
+
+mailscripts (0.5-1) unstable; urgency=high
+
+ * notmuch-slurp-debbug: Avoid invoking entirely superfluous shells when
+ calling other tools. This is a security risk.
+ Thanks to Paul Wise for reporting that the code was doing that.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Tue, 05 Mar 2019 09:38:56 -0700
+
mailscripts (0.4-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
diff --git a/debian/control b/debian/control
index 8e7b8de..8bfe006 100644
--- a/debian/control
+++ b/debian/control
@@ -30,6 +30,7 @@ Package: mailscripts
Depends:
libconfig-tiny-perl,
libfile-which-perl,
+ libipc-system-simple-perl,
libmime-tools-perl,
python3,
${misc:Depends},
diff --git a/debian/copyright b/debian/copyright
index 83c2ca9..b3d860e 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,7 +2,7 @@ mailscripts
Collection of scripts for manipulating e-mail on Debian
Copyright (C)2017 Aurelien Aptel
-Copyright (C)2017-2018 Sean Whitton
+Copyright (C)2017-2019 Sean Whitton
These programs are free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/mailscripts.el b/mailscripts.el
index 249cb42..c68f7a9 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -1,7 +1,7 @@
;;; mailscripts.el --- functions to access tools in the mailscripts package
;; Author: Sean Whitton <spwhitton@spwhitton.name>
-;; Version: 0.4
+;; Version: 0.7
;; Package-Requires: (notmuch)
;; Copyright (C) 2018 Sean Whitton
diff --git a/notmuch-slurp-debbug b/notmuch-slurp-debbug
index d289e31..d424236 100755
--- a/notmuch-slurp-debbug
+++ b/notmuch-slurp-debbug
@@ -2,7 +2,7 @@
# notmuch-slurp-debbug -- add messages from a Debian bug to notmuch
-# Copyright (C) 2018 Sean Whitton
+# Copyright (C) 2018-2019 Sean Whitton
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,10 +21,11 @@ use strict;
use warnings;
use Config::Tiny;
-use File::Spec::Functions 'catfile';
+use File::Spec::Functions qw(catfile);
use File::Which;
use File::Temp;
use Getopt::Long;
+use IPC::System::Simple qw(systemx capturex);
use MIME::Head;
my $Config = Config::Tiny->new;
@@ -62,13 +63,14 @@ die "notmuch-slurp-debbug: $maildir does not look to be a maildir"
&& -d catfile($maildir, "new")
&& -d catfile($maildir, "tmp"));
-my $bts_server_arg = defined $bts_server
- ? "--bts-server $bts_server"
- : "";
+my @bts_server_args = defined $bts_server
+ ? ("--bts-server", $bts_server)
+ : undef;
-# see #904182 (try using this script ;))
-system("bts $bts_server_arg --mbox --mailreader 'true %s' show $bug") == 0
- or die "notmuch-slurp-debbug: bts failed";
+# see #904182 for why we have to do it like this
+my @bts_args = grep defined, @bts_server_args,
+ qw(--mbox --mailreader), "true %s", "show", $bug;
+systemx("bts", @bts_args);
my $dir = File::Temp->newdir();
mkdir catfile($dir, "cur");
@@ -83,8 +85,7 @@ my $mbox = catfile $devscripts_cache, "$bug.mbox";
# note that mb2md won't work; it thinks Debian BTS mboxes contain just
# a single message
-system("mbox2maildir $mbox $dir") == 0
- or die "notmuch-slurp-debbug: mbox2maildir failed";
+systemx("mbox2maildir", $mbox, $dir);
foreach my $message (glob "$dir/*/*") {
my $message_head = MIME::Head->from_file($message);
@@ -93,9 +94,9 @@ foreach my $message (glob "$dir/*/*") {
# that is asking for trouble
next unless defined $mid;
$mid =~ s/(<|>)//g;
- my $match = `notmuch search id:$mid`;
+ my $match = capturex(qw(notmuch search), "id:$mid");
my $match_lines = $match =~ tr/\n//;
- system "mdmv $message $maildir" if ($match_lines == 0);
+ systemx("mdmv", $message, $maildir) if ($match_lines == 0);
}
-system "notmuch new";
+systemx(qw(notmuch new));