From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/63664 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.gnus.general Subject: pgg merge 5.10 ->trunk ? Date: Tue, 05 Sep 2006 05:07:54 -0400 Message-ID: <61wt8iadg5.fsf@fencepost.gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157448422 4701 80.91.229.2 (5 Sep 2006 09:27:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2006 09:27:02 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+m12191@lists.math.uh.edu Tue Sep 05 11:26:56 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKXCd-0002bO-M2 for ding-account@gmane.org; Tue, 05 Sep 2006 11:26:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1GKXCX-0002Ln-00; Tue, 05 Sep 2006 04:26:37 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1GKX9C-0002Lh-00 for ding@lists.math.uh.edu; Tue, 05 Sep 2006 04:23:10 -0500 Original-Received: from quimby.gnus.org ([80.91.227.211]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1GKX97-0003H8-9U for ding@lists.math.uh.edu; Tue, 05 Sep 2006 04:23:09 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1GKWuR-0003pX-00 for ; Tue, 05 Sep 2006 11:07:55 +0200 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.34) id 1GKWuQ-0000fv-MH; Tue, 05 Sep 2006 05:07:54 -0400 Original-To: Daiki Ueno System-Type: i686-pc-linux-gnu Blat: Foop X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:63664 Archived-At: Hi, Does the following patch need to be merged from Gnus 5.10 into the Gnus trunk? [It does not apply, and it's not clear to me whether the changes are necessary on the trunk or not, as the sources are fairly different in many areas.] Thanks, -Miles M lisp/ChangeLog M lisp/pgg.el M lisp/pgg-gpg.el --- orig/lisp/ChangeLog +++ mod/lisp/ChangeLog @@ -1,3 +1,17 @@ +2006-09-05 Daiki Ueno + + * pgg.el (pgg-clear-string): Alias to clear-string for backward + compatibility. + + * pgg-gpg.el (pgg-gpg-process-region): Avoid display blinking with + inhibit-redisplay; encode passphrase with locale-coding-system. + +2006-09-04 Daiki Ueno + + * pgg-gpg.el (pgg-gpg-process-region): Revert two patches from Satyaki + Das. http://article.gmane.org/gmane.emacs.gnus.general/49947 + http://article.gmane.org/gmane.emacs.gnus.general/50457 + 2006-09-01 Katsumi Yamaoka * rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings): --- orig/lisp/pgg.el +++ mod/lisp/pgg.el @@ -119,5 +119,10 @@ (pgg-truncate-key-identifier key)) passphrase))) +(if (fboundp 'clear-string) + (defalias 'pgg-clear-string 'clear-string) + (defun pgg-clear-string (string) + (fillarray string ?_))) + (defun pgg-remove-passphrase-from-cache (key &optional notruncate) "Omit passphrase associated with KEY in time-limited passphrase cache. @@ -137,7 +142,7 @@ (interned-timer-key (intern-soft key pgg-pending-timers)) (old-timer (symbol-value interned-timer-key))) (when passphrase - (fillarray passphrase ?_) + (pgg-clear-string passphrase) (unintern key pgg-passphrase-cache)) (when old-timer (pgg-cancel-timer old-timer) --- orig/lisp/pgg-gpg.el +++ mod/lisp/pgg-gpg.el @@ -74,23 +74,39 @@ (errors-buffer pgg-errors-buffer) (orig-mode (default-file-modes)) (process-connection-type nil) - exit-status) + (inhibit-redisplay t) + process status exit-status + passphrase-with-newline + encoded-passphrase-with-new-line) (with-current-buffer (get-buffer-create errors-buffer) (buffer-disable-undo) (erase-buffer)) (unwind-protect (progn (set-default-file-modes 448) - (let ((coding-system-for-write 'binary) - (input (buffer-substring-no-properties start end)) - (default-enable-multibyte-characters nil)) - (with-temp-buffer - (when passphrase - (insert passphrase "\n")) - (insert input) - (setq exit-status - (apply #'call-process-region (point-min) (point-max) program - nil errors-buffer nil args)))) + (let ((coding-system-for-write 'binary)) + (setq process + (apply #'start-process "*GnuPG*" errors-buffer + program args))) + (set-process-sentinel process #'ignore) + (when passphrase + (setq passphrase-with-newline (concat passphrase "\n")) + (if (boundp 'locale-coding-system) + (progn + (setq encoded-passphrase-with-new-line + (encode-coding-string passphrase-with-newline + locale-coding-system)) + (pgg-clear-string passphrase-with-newline)) + (setq encoded-passphrase-with-new-line passphrase-with-newline + passphrase-with-newline nil)) + (process-send-string process encoded-passphrase-with-new-line)) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) (with-current-buffer (get-buffer-create output-buffer) (buffer-disable-undo) (erase-buffer) @@ -100,9 +116,16 @@ 'binary))) (insert-file-contents output-file-name))) (set-buffer errors-buffer) - (if (not (equal exit-status 0)) - (insert (format "\n%s exited abnormally: '%s'\n" - program exit-status))))) + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)))) + (if passphrase-with-newline + (pgg-clear-string passphrase-with-newline)) + (if encoded-passphrase-with-new-line + (pgg-clear-string encoded-passphrase-with-new-line)) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) (if (file-exists-p output-file-name) (delete-file output-file-name)) (set-default-file-modes orig-mode))))