Gnus development mailing list
 help / color / mirror / Atom feed
From: Joseph Barillari <jbarilla@princeton.edu>
Subject: pgg-passphrase-cache-expiry customization patch
Date: Wed, 30 Oct 2002 00:18:18 -0500	[thread overview]
Message-ID: <87znswsdwl.fsf@bigbox.barillari.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

Hi.

I've been off the list for a while (actually, I still am, so I'd
really appreciate it if you'd cc: me with any replies). Perhaps I
missed the debate on the issue (though I didn't see it in the
archives): why is pgg-passphrase-cache-expiry hardcoded to 16
and left with no customization option? One could change it with setq
in .gnus, but I assume that you'd rather have a defcustom.

The patch I attached replaces the boolean pgg-cache-passphrase with a
test for the non-zeroness of pgg-passphrase-cache-expiry, and adds a
corresponding defcustom.

Unfortunately, I haven't tested this: I'm running emacs and w3m-el
from Debian unstable and it seems to have broken my build process.  My
apologies for the untested-ness, but the patch is sufficiently trivial
that it should be evident if it works by visual inspection (I'm not an
elisp wizard, but lots of people on this list are).

If anyone's had the build problem, the log is below:

jdb@bigbox:~/dl/gnus-cvs/gnus$ ./configure 
                               <snip>
jdb@bigbox:~/dl/gnus-cvs/gnus$ make
cd lisp && make EMACS="emacs" lispdir="/usr/share/emacs/site-lisp" all
make[1]: Entering directory `/home/jdb/dl/gnus-cvs/gnus/lisp'
rm -f *.elc gnus-load.el
URLDIR=no W3DIR=no lispdir=/usr/share/emacs/site-lisp srcdir=. emacs -batch -q -no-site-file -l ./dgnushack.el -f dgnushack-make-cus-load .
Loading cus-dep...
Directory .
Generating cus-load.el...
Wrong type argument: stringp, (mm-inline-text-html-with-w3m-keymap custom-variable)
make[1]: *** [gnus-load.el] Error 255
make[1]: Leaving directory `/home/jdb/dl/gnus-cvs/gnus/lisp'
make: *** [lick] Error 2

Patch is attached.

Cheers,

--Joe



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1: pgg-expiry-patch.patch --]
[-- Type: text/x-patch, Size: 2625 bytes --]

diff -ru gnus/lisp/pgg-def.el mygnus/lisp/pgg-def.el
--- gnus/lisp/pgg-def.el	2002-10-30 00:06:05.000000000 -0500
+++ mygnus/lisp/pgg-def.el	2002-10-30 00:05:09.000000000 -0500
@@ -58,10 +58,10 @@
   :group 'pgg
   :type 'boolean)
 
-(defcustom pgg-cache-passphrase t
-  "If t, cache passphrase."
+(defcustom pgg-passphrase-cache-expiry 60
+  "If nonzero, cache passphrase for this many seconds."
   :group 'pgg
-  :type 'boolean)
+  :type 'integer)
 
 (defvar pgg-messages-coding-system nil
   "Coding system used when reading from a PGP external process.")
diff -ru gnus/lisp/pgg-gpg.el mygnus/lisp/pgg-gpg.el
--- gnus/lisp/pgg-gpg.el	2002-10-30 00:06:05.000000000 -0500
+++ mygnus/lisp/pgg-gpg.el	2002-10-30 00:05:09.000000000 -0500
@@ -98,7 +98,7 @@
       (set-default-file-modes orig-mode))))
 
 (defun pgg-gpg-possibly-cache-passphrase (passphrase)
-  (if (and pgg-cache-passphrase
+  (if (and  (not (eq pgg-passphrase-cache-expiry 0))
 	   (progn
 	     (goto-char (point-min))
 	     (re-search-forward "^\\[GNUPG:] GOOD_PASSPHRASE\\>" nil t)))
diff -ru gnus/lisp/pgg-pgp.el mygnus/lisp/pgg-pgp.el
--- gnus/lisp/pgg-pgp.el	2002-10-30 00:06:06.000000000 -0500
+++ mygnus/lisp/pgg-pgp.el	2002-10-30 00:05:09.000000000 -0500
@@ -177,7 +177,7 @@
 			     (progn (beginning-of-line 2)
 				    (point))
 			     (point-max))))))
-	  (if pgg-cache-passphrase
+	  (if  (not (eq pgg-passphrase-cache-expiry 0))
 	      (pgg-add-passphrase-cache
 	       (cdr (assq 'key-identifier packet))
 	       passphrase)))))))
diff -ru gnus/lisp/pgg-pgp5.el mygnus/lisp/pgg-pgp5.el
--- gnus/lisp/pgg-pgp5.el	2002-10-30 00:06:06.000000000 -0500
+++ mygnus/lisp/pgg-pgp5.el	2002-10-30 00:05:09.000000000 -0500
@@ -189,7 +189,7 @@
 			     (progn (beginning-of-line 2)
 				    (point))
 			     (point-max))))))
-	  (if pgg-cache-passphrase
+	  (if (not (eq pgg-passphrase-cache-expiry 0))
 	      (pgg-add-passphrase-cache
 	       (cdr (assq 'key-identifier packet))
 	       passphrase)))))))
diff -ru gnus/lisp/pgg.el mygnus/lisp/pgg.el
--- gnus/lisp/pgg.el	2002-10-30 00:06:06.000000000 -0500
+++ mygnus/lisp/pgg.el	2002-10-30 00:05:09.000000000 -0500
@@ -99,7 +99,7 @@
 	    (setq pgg-read-passphrase 'read-passwd)
 	  (autoload 'ange-ftp-read-passwd "ange-ftp")
 	  (setq pgg-read-passphrase 'ange-ftp-read-passwd))))
-  (or (and pgg-cache-passphrase
+  (or (and (not (eq pgg-passphrase-cache-expiry 0))
 	   key (setq key (pgg-truncate-key-identifier key))
 	   (symbol-value (intern-soft key pgg-passphrase-cache)))
       (funcall pgg-read-passphrase prompt)))

[-- Attachment #2.2: Type: application/pgp-signature, Size: 188 bytes --]

             reply	other threads:[~2002-10-30  5:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-30  5:18 Joseph Barillari [this message]
2002-10-30 18:45 ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87znswsdwl.fsf@bigbox.barillari.org \
    --to=jbarilla@princeton.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).