changeset: 6378:daf61444d454
user: Kevin McCarthy <[email protected]>
date: Sat Jun 21 13:51:38 2014 -0700
link: http://dev.mutt.org/hg/mutt/rev/daf61444d454
Enable %a format string for all pgp command configs. (closes #3699)
Currently, the documentation states that, with the exception of
pgp_getkeys_command, all the PGP format commands should be available to
the pgp_*_command configuration variables.
However, the %a format is actually only enabled for
pgp_clearsign_command, pgp_encrypt_sign_command, and pgp_sign_command.
Philip Rinn discovered this problem when he was trying to add a
"--encrypt-to %a" to pgp_encrypt_only_command. Rather than just fix
the one configuration he was having the problem with, this patch
enables %a usage for all of them. (With the exception of the documented
pgp_getkeys_command.)
diffs (74 lines):
diff -r 630bbc147022 -r daf61444d454 pgpinvoke.c
--- a/pgpinvoke.c Wed Dec 18 19:19:30 2013 -0800
+++ b/pgpinvoke.c Sat Jun 21 13:51:38 2014 -0700
@@ -201,7 +201,7 @@
const char *fname, short need_passphrase)
{
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- need_passphrase, fname, NULL, NULL, NULL,
+ need_passphrase, fname, NULL, PgpSignAs, NULL,
PgpDecodeCommand);
}
@@ -210,7 +210,7 @@
const char *fname, const char *sig_fname)
{
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, fname, sig_fname, NULL, NULL, PgpVerifyCommand);
+ 0, fname, sig_fname, PgpSignAs, NULL, PgpVerifyCommand);
}
pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr,
@@ -218,7 +218,7 @@
const char *fname)
{
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 1, fname, NULL, NULL, NULL, PgpDecryptCommand);
+ 1, fname, NULL, PgpSignAs, NULL, PgpDecryptCommand);
}
pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr,
@@ -240,7 +240,7 @@
PgpEncryptSignCommand);
else
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, fname, NULL, NULL, uids,
+ 0, fname, NULL, PgpSignAs, uids,
PgpEncryptOnlyCommand);
}
@@ -269,6 +269,7 @@
mutt_quote_filename (_fname, sizeof (_fname), fname);
cctx.fname = _fname;
+ cctx.signas = PgpSignAs;
mutt_pgp_command (cmd, sizeof (cmd), &cctx, PgpImportCommand);
mutt_system (cmd);
@@ -319,7 +320,7 @@
const char *uids)
{
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, NULL, NULL, NULL, uids,
+ 0, NULL, NULL, PgpSignAs, uids,
PgpExportCommand);
}
@@ -328,7 +329,7 @@
const char *uids)
{
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, NULL, NULL, NULL, uids,
+ 0, NULL, NULL, PgpSignAs, uids,
PgpVerifyKeyCommand);
}
@@ -350,7 +351,7 @@
}
return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, NULL, NULL, NULL, uids,
+ 0, NULL, NULL, PgpSignAs, uids,
keyring == PGP_SECRING ? PgpListSecringCommand :
PgpListPubringCommand);
}