From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Please install this for me (2) Date: Sat, 23 Feb 2019 23:45:02 -0500 Message-ID: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113334"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 05:47:02 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gxlgr-000TOQ-N3 for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2019 05:47:01 +0100 Original-Received: from localhost ([127.0.0.1]:46189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxlgq-0001xY-NW for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2019 23:47:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxlew-0001Fe-RR for emacs-devel@gnu.org; Sat, 23 Feb 2019 23:45:03 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxlew-0001DL-Ca for emacs-devel@gnu.org; Sat, 23 Feb 2019 23:45:02 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gxlew-0005hT-5u; Sat, 23 Feb 2019 23:45:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233559 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Would someone please install this bug fix? 2019-02-23 Richard Stallman * lisp/mail/rmail.el (rmail-epa-decrypt): Don't decrypt an armor that was copied into the message from a message it is a reply to. (rmail-epa-decrypt-1): Catch and ignore errors in epa-decrypt-region. Make armor-start and armor-end markers. diff -u /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el.\~1\~ /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el --- /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el.~1~ 2018-11-17 18:00:19.352983946 -0500 +++ /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el 2018-11-17 18:05:37.168476414 -0500 @@ -4548,6 +4548,9 @@ (unless armor-end (error "Encryption armor beginning has no matching end")) + (setq armor-start (move-marker (make-marker) armor-start)) + (setq armor-end (move-marker (make-marker) armor-end)) + (goto-char armor-start) ;; Because epa--find-coding-system-for-mime-charset not autoloaded. @@ -4580,16 +4583,17 @@ (mail-unquote-printable-region armor-start (- (point-max) after-end)))) - ;; Decrypt it, maybe in place, maybe making new buffer. - (epa-decrypt-region - armor-start (- (point-max) after-end) - ;; Call back this function to prepare the output. - (lambda () - (let ((inhibit-read-only t)) - (delete-region armor-start (- (point-max) after-end)) - (goto-char armor-start) - (current-buffer)))) - + (condition-case nil + (epa-decrypt-region + armor-start (- (point-max) after-end) + ;; Call back this function to prepare the output. + (lambda () + (let ((inhibit-read-only t)) + (delete-region armor-start (- (point-max) after-end)) + (goto-char armor-start) + (current-buffer)))) + (error nil)) + (list armor-start (- (point-max) after-end) mime armor-end-regexp (buffer-substring armor-start (- (point-max) after-end))))) @@ -4624,9 +4628,14 @@ (goto-char (point-min)) (while (re-search-forward "-----BEGIN PGP MESSAGE-----$" nil t) (let ((coding-system-for-read coding-system-for-read) - (case-fold-search t)) - - (push (rmail-epa-decrypt-1 mime) decrypts))) + (case-fold-search t) + (armor-start (match-beginning 0))) + ;; Don't decrypt an armor that was copied into + ;; the message from a message it is a reply to. + (or (equal (buffer-substring (line-beginning-position) + armor-start) + "> ") + (push (rmail-epa-decrypt-1 mime) decrypts)))) (when (and decrypts (eq major-mode 'rmail-mode)) (rmail-add-label "decrypt")) Diff finished. Sat Feb 23 20:23:43 2019 -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)