Matthieu MOY <[EMAIL PROTECTED]> writes:

> To solve the problem in xtla, the best solution is probably to run
> those write operations with (ansi-term), so that tla actually runs in
> a tty.

I use the following snippet of common lisp to pop up a password box to
get my GPG passphrase.  It's a bit of a hack, but works well enough for
my use.


#!/usr/bin/clisp

;; gpg-wrapper.lisp -- A wrapper around gpg that uses ssh-askpass to get
;; passwords
;;
;; Author: Mark Triggs <[EMAIL PROTECTED]>


(let* ((pipe (nth-value 1 (unix:pipe)))
       (write (ext:make-stream (aref pipe 1) :direction :output))
       (ret nil))
  (loop until (and ret (zerop ret)) do
       (let ((switches (remove-if-not #'(lambda (opt) (char= (char opt 0) #\-))
                                      ext:*args*))
             (rest (remove-if #'(lambda (opt) (char= (char opt 0) #\-))
                              ext:*args*)))
         (write-line (read-line (run-program "ssh-askpass" :output :stream))
                     write)
         (setq ret (run-program "gpg"
                                :arguments
                                (append (list "--batch" "--no-tty"
                                              "--passphrase-fd"
                                              (princ-to-string (aref pipe 0)))
                                        switches rest))))))


Then my ~/.arch-params/signing/=default just contains: "gpg-wrapper
--clearsign"

Cheers,

Mark

-- 
Mark Triggs
<[EMAIL PROTECTED]>

Reply via email to