[PATCH v1] emacs: `with-current-notmuch-show-message' should not leak `coding-system...
authorDavid Edmondson <dme@dme.org>
Tue, 18 Nov 2014 07:03:17 +0000 (07:03 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:45 +0000 (14:46 -0700)
54/f8d65166f3c7f88b3a50c56240641a1dfa8671 [new file with mode: 0644]

diff --git a/54/f8d65166f3c7f88b3a50c56240641a1dfa8671 b/54/f8d65166f3c7f88b3a50c56240641a1dfa8671
new file mode 100644 (file)
index 0000000..2ad1889
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8650D431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 17 Nov 2014 23:03:25 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id qDgqLi8+-QzZ for <notmuch@notmuchmail.org>;\r
+       Mon, 17 Nov 2014 23:03:20 -0800 (PST)\r
+Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
+       [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7DAE7431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 17 Nov 2014 23:03:20 -0800 (PST)\r
+Received: by mail-wi0-f169.google.com with SMTP id r20so4641800wiv.2\r
+       for <notmuch@notmuchmail.org>; Mon, 17 Nov 2014 23:03:19 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:user-agent:from:to:subject:date:message-id;\r
+       bh=nTcUTeONsIoHZg90ncFBFtegIMwiRGe1mFxIndP7uts=;\r
+       b=OZbQlA0+dUw4xxSu0tmPyQhdMT5QU/D3AN1KgKb6Z0Uct0e6Als/yZM3ff86FrejKx\r
+       qvJ60KeUJrrDFdXieqj3KVZS5HuifudSJyRV7SZcWjc18ZNIJw20KKkLoxWl4H6fQtdB\r
+       y5J3uP1304xFtiLbjYLah+bGbKSMsBfFYOs8OFO1PHk05bywUzQGfVuONkLCzA6+mYvA\r
+       wLXPSHYlZXwkoFar9kuF2cNXSvnLgve/UkUbwme7VHQv+Wqfvs+bkiMCXyX2pMQBkKjB\r
+       olXrGSMhckXI6Ec0M/cPzmrUlQWAyBqVMnMwlaXANmBOLrjXJC+EwxE6GR0mLkZ7lRBE\r
+       VBrg==\r
+X-Gm-Message-State:\r
+ ALoCoQkGRkFjIcsy2l7rdbS3t3TOJbR5q8lAxEaErLGJ5J5+UmyiIA/jidsM65rKOyZFa8/m+lrN\r
+X-Received: by 10.194.185.68 with SMTP id fa4mr43906968wjc.83.1416294199167;\r
+       Mon, 17 Nov 2014 23:03:19 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+       ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+       by mx.google.com with ESMTPSA id\r
+       kn5sm46987420wjb.48.2014.11.17.23.03.18 for <notmuch@notmuchmail.org>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Mon, 17 Nov 2014 23:03:18 -0800 (PST)\r
+Received: from localhost (30000@localhost [local]);\r
+       by localhost (OpenSMTPD) with ESMTPA id 44a161b1;\r
+       for <notmuch@notmuchmail.org>; Tue, 18 Nov 2014 07:03:17 +0000 (UTC)\r
+User-Agent: OpenSMTPD enqueuer (Demoostik)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v1] emacs: `with-current-notmuch-show-message' should not leak\r
+       `coding-system-for-read'\r
+Date: Tue, 18 Nov 2014 07:03:17 +0000\r
+Message-Id: <1416294197-3170-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.1.3\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 18 Nov 2014 07:03:25 -0000\r
+\r
+`with-current-notmuch-show-message' applies a `no-conversion' coding\r
+system when reading a raw message from notmuch. That coding system\r
+should _not_ be applied when the body of the macro is evaluated, as it\r
+can cause file operations used during that evaluation to incorrectly\r
+apply the `no-conversion' coding system.\r
+\r
+This was discovered when a user's .signature file contained non-ASCII\r
+characters. When a message is forwarded, the `no-conversion' coding\r
+system was applied to the reading of the .signature file, resulting in\r
+raw rather than UTF-8 interpretation of the data.\r
+---\r
+\r
+Fix for id:87ioifb55d.fsf@nautilus.nautilus.\r
+\r
+ emacs/notmuch-show.el | 6 +++---\r
+ 1 file changed, 3 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 4035fe8..b8cfbb8 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -241,9 +241,9 @@ every user interaction with notmuch."\r
+        (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))\r
+          (with-current-buffer buf\r
+          (let ((coding-system-for-read 'no-conversion))\r
+-           (call-process notmuch-command nil t nil "show" "--format=raw" id)\r
+-           ,@body)\r
+-         (kill-buffer buf))))))\r
++           (call-process notmuch-command nil t nil "show" "--format=raw" id))\r
++         ,@body)\r
++       (kill-buffer buf)))))\r
\r
+ (defun notmuch-show-turn-on-visual-line-mode ()\r
+   "Enable Visual Line mode."\r
+-- \r
+2.1.3\r
+\r