Gnus development mailing list
 help / color / mirror / Atom feed
* pgg merge 5.10 ->trunk ?
@ 2006-09-05  9:07 Miles Bader
  2006-09-05 10:39 ` Daiki Ueno
  0 siblings, 1 reply; 3+ messages in thread
From: Miles Bader @ 2006-09-05  9:07 UTC (permalink / raw)
  Cc: ding

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  <ueno@unixuser.org>
+
+	* 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  <ueno@unixuser.org>
+
+	* 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  <yamaoka@jpl.org>
 
 	* 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))))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pgg merge 5.10 ->trunk ?
  2006-09-05  9:07 pgg merge 5.10 ->trunk ? Miles Bader
@ 2006-09-05 10:39 ` Daiki Ueno
  2006-09-05 10:39   ` Miles Bader
  0 siblings, 1 reply; 3+ messages in thread
From: Daiki Ueno @ 2006-09-05 10:39 UTC (permalink / raw)
  Cc: ding

Hi,

>>>>> In <61wt8iadg5.fsf@fencepost.gnu.org> 
>>>>>	Miles Bader <miles@gnu.org> wrote:
> 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.]

I personally think that PGG in the trunk should be an exact copy of one
in the v5-10 branch, because PGG won't be actively developped anymore.

Regards,
-- 
Daiki Ueno



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pgg merge 5.10 ->trunk ?
  2006-09-05 10:39 ` Daiki Ueno
@ 2006-09-05 10:39   ` Miles Bader
  0 siblings, 0 replies; 3+ messages in thread
From: Miles Bader @ 2006-09-05 10:39 UTC (permalink / raw)
  Cc: ding

Daiki Ueno <ueno@unixuser.org> writes:
> I personally think that PGG in the trunk should be an exact copy of one
> in the v5-10 branch, because PGG won't be actively developped anymore.

I'd love it... at least I could merge bugfixes easily...
But it's up to the gnus maintainers I guess.

-Miles
-- 
If you can't beat them, arrange to have them beaten.  [George Carlin]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-05 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-05  9:07 pgg merge 5.10 ->trunk ? Miles Bader
2006-09-05 10:39 ` Daiki Ueno
2006-09-05 10:39   ` Miles Bader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).