crypto: prefer gpg2

Can't say I fully understand what's going on, but it seems gpg-before-2
has some trouble with its agent, at least when using
gnome-session (which stopped using gnome-keyring as a gpg-agent since
Fedora 23 at least).

Sanity seems to be restored when preferring gpg2 instead. "gpg" is used
when gpg2 isn't there; and there's the MU_GPG_PATH env variable to
override all of that.
This commit is contained in:
djcb 2016-07-24 16:00:04 +03:00
parent 538b7e5292
commit c9f8ac5beb
2 changed files with 17 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2012-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2012-2016 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -116,8 +116,8 @@ get_gpg (GError **err)
return g_strdup (envpath);
}
if (!(path = g_find_program_in_path ("gpg")) &&
!(path = g_find_program_in_path ("gpg2"))) {
if (!(path = g_find_program_in_path ("gpg2")) &&
!(path = g_find_program_in_path ("gpg"))) {
mu_util_g_set_error (err, MU_ERROR, "gpg/gpg2 not found");
return NULL;
} else

View File

@ -1,6 +1,6 @@
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
/*
** Copyright (C) 2010-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2010-2016 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -81,9 +81,13 @@ static gchar *
get_attach_str (MuMsg *msg, MuConfig *opts)
{
gchar *attach;
MuMsgOptions msgopts;
msgopts = mu_config_get_msg_options(opts) |
MU_MSG_OPTION_CONSOLE_PASSWORD;
attach = NULL;
mu_msg_part_foreach (msg, mu_config_get_msg_options(opts),
mu_msg_part_foreach (msg, msgopts,
(MuMsgPartForeachFunc)each_part, &attach);
return attach;
}
@ -494,7 +498,9 @@ mu_cmd_verify (MuConfig *opts, GError **err)
if (!msg)
return MU_ERROR;
msgopts = mu_config_get_msg_options (opts) | MU_MSG_OPTION_VERIFY;
msgopts = mu_config_get_msg_options (opts)
| MU_MSG_OPTION_VERIFY
| MU_MSG_OPTION_CONSOLE_PASSWORD;
vdata.report = NULL;
vdata.combined_status = MU_MSG_PART_SIG_STATUS_UNSIGNED;