In ticket #3665, rinni was using the %a pgp format command inside his
pgp_encrypt_only_command (to add an --encrypt-to %a for encrypted
emails).

This seems like a legitimate use, and according to the documentation
should work.  However, the source code shows that for most pgp
commands, PgpSignAs is not being passed in and %a is expanding to
blank.  (Except for pgp_clearsign_command, pgp_encrypt_sign_command, and
pgp_sign_command.)

There are several different ways of dealing with this.  I'm attaching a
patch that just fixes pgp_encrypt_only_command.  Would it be useful to
fix this for the rest of the commands too?

-Kevin
# HG changeset patch
# User Kevin McCarthy <ke...@8t8.us>
# Date 1401153409 25200
#      Mon May 26 18:16:49 2014 -0700
# Node ID a71ffe0d90829df3dcd961141e3b29fac15b9796
# Parent  8f62001989cc9f564236e54b318ecca05f551af2
Enable %a for pgp_encrypt_only_command

diff --git a/pgpinvoke.c b/pgpinvoke.c
--- a/pgpinvoke.c
+++ b/pgpinvoke.c
@@ -235,17 +235,17 @@
                          const char *fname, const char *uids, int sign)
 {
   if (sign)
     return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
                       1, fname, NULL, PgpSignAs, uids, 
                       PgpEncryptSignCommand);
   else
     return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
-                      0, fname, NULL, NULL, uids, 
+                      0, fname, NULL, PgpSignAs, uids,
                       PgpEncryptOnlyCommand);
 }
 
 pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr,
                              int pgpinfd, int pgpoutfd, int pgperrfd,
                              const char *fname, const char *uids, int flags)
 {
   if (flags & ENCRYPT)

Attachment: signature.asc
Description: PGP signature

Reply via email to