From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/63172 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: pgg-gpg-process-region (was: pgg-output-buffer gets created as a unibyte buffer) Date: Sat, 06 May 2006 14:37:48 +0200 Message-ID: References: <9c79059a-61a9-4fa4-8376-638753320a14@well-done.deisui.org> <4aaf7080-0e3d-4a75-aff5-f9d5bcd0437f@well-done.deisui.org> <87fyjz2gaj.fsf@pacem.orebokech.com> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146921330 30843 80.91.229.2 (6 May 2006 13:15:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 May 2006 13:15:30 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+m11698@lists.math.uh.edu Sat May 06 15:15:29 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 1FcMd6-0007lf-OG for ding-account@gmane.org; Sat, 06 May 2006 15:15:29 +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 1FcMd0-0002dQ-00; Sat, 06 May 2006 08:15:22 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FcMah-0002dF-00 for ding@lists.math.uh.edu; Sat, 06 May 2006 08:12:59 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1FcMab-0003r5-Aq for ding@lists.math.uh.edu; Sat, 06 May 2006 08:12:58 -0500 Original-Received: from mail.uni-ulm.de ([134.60.1.1]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FcMaW-00085R-00 for ; Sat, 06 May 2006 15:12:48 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.6/8.13.6) with ESMTP id k46DCkcu027009; Sat, 6 May 2006 15:12:46 +0200 (MEST) Original-Received: from viandante.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 2417F118C0; Sat, 6 May 2006 15:12:44 +0200 (CEST) Original-Received: (nullmailer pid 14622 invoked by uid 170); Sat, 06 May 2006 12:37:48 -0000 Original-To: Daiki Ueno X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML;)7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+;CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf,d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Followup-To: Daiki Ueno , ding@gnus.org User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) X-DCC-INFN-TO-Metrics: gemini 1233; Body=2 Fuz1=2 Fuz2=2 X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:63172 Archived-At: On Thu, Apr 27 2006, Romain Francoise wrote: > Daiki Ueno writes: > >> For example, the original PGG does not use `call-process-region' for >> security reason -- this function writes data to a temporary file. Did you check which versions of Emacs or XEmacs do this? (I don't have the C sources here ATM, so I can't check myself.) >> About three years ago, Gnus decided to use `call-process-region' in >> PGG to avoid display blinking. > > The current version of PGG in the trunk doesn't do that anymore. > That sounds like a good enough reason to sync that version in v5-10! Maybe we should rather revert the change introducing `call-process-region' [1]? Have all the problems that led us to revert pgg-gpg.el before the 5.10.8 release been fixed in the trunk version (or in Daiki's version)? Bye, Reiner. [1] ,----[ ChangeLog.2 ] | 2003-02-08 Simon Josefsson | | * gnus-sum.el (gnus-summary-select-article): Remove blink removal | code that only worked under Emacs. | | * pgg-gpg.el (pgg-gpg-process-region): Don't blink. From Satyaki | Das . `---- --8<---------------cut here---------------start------------->8--- --- pgg-gpg.el 2 Nov 2002 04:27:00 -0000 6.8 +++ pgg-gpg.el 8 Feb 2003 18:58:23 -0000 6.9 @@ -59,27 +59,22 @@ (errors-buffer pgg-errors-buffer) (orig-mode (default-file-modes)) (process-connection-type nil) - process status exit-status) + exit-status) (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)) - (setq process - (apply #'start-process "*GnuPG*" errors-buffer - program args))) - (set-process-sentinel process #'ignore) - (when passphrase - (process-send-string process (concat passphrase "\n"))) - (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) + (let* ((coding-system-for-write 'binary) + (input (buffer-substring-no-properties start end))) + (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)))) (with-current-buffer (get-buffer-create output-buffer) (buffer-disable-undo) (erase-buffer) @@ -87,12 +82,8 @@ (let ((coding-system-for-read 'raw-text-dos)) (insert-file-contents output-file-name))) (set-buffer errors-buffer) - (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 (and process (eq 'run (process-status process))) - (interrupt-process process)) + (if (not (equal exit-status 0)) + (error "%s exited abnormally: '%s'" program exit-status)))) (if (file-exists-p output-file-name) (delete-file output-file-name)) (set-default-file-modes orig-mode)))) --8<---------------cut here---------------end--------------->8--- -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/