[Commits] [SCM] claws branch, master, updated. 3.13.2-164-gb2651d9

mones at claws-mail.org mones at claws-mail.org
Mon Jul 4 11:01:39 CEST 2016


The branch, master has been updated
       via  b2651d9e36557197e9af66f761db72d3475ac9f4 (commit)
      from  fd6e3082a806cf87c6660b98131e3ee3eab58a75 (commit)

Summary of changes:
 src/plugins/pgpcore/prefs_gpg.c |    7 +++++--
 src/plugins/pgpcore/sgpgme.c    |    5 ++++-
 2 files changed, 9 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit b2651d9e36557197e9af66f761db72d3475ac9f4
Author: Ricardo Mones <ricardo at mones.org>
Date:   Mon Jul 4 11:00:35 2016 +0200

    Warn on unsuccessful gpgme_set_engine_info calls

diff --git a/src/plugins/pgpcore/prefs_gpg.c b/src/plugins/pgpcore/prefs_gpg.c
index 2aaebf2..dd74619 100644
--- a/src/plugins/pgpcore/prefs_gpg.c
+++ b/src/plugins/pgpcore/prefs_gpg.c
@@ -259,8 +259,11 @@ static void prefs_gpg_save_func(PrefsPage *_page)
 		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_gpg_warning));
 	g_free(config->gpg_path);
 	config->gpg_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->gpg_path)));
-	if (strcmp(config->gpg_path, "") != 0 && access(config->gpg_path, X_OK) != -1)
-		gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP, config->gpg_path, NULL);
+	if (strcmp(config->gpg_path, "") != 0 && access(config->gpg_path, X_OK) != -1) {
+		gpgme_error_t err = gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP, config->gpg_path, NULL);
+		if (err != GPG_ERR_NO_ERROR)
+			g_warning("failed to set crypto engine configuration: %s", gpgme_strerror(err));
+	}
 
 	prefs_gpg_enable_agent(config->use_gpg_agent);
 
diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 093d262..c0fbe6a 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -660,12 +660,15 @@ void sgpgme_init()
 {
 	gchar *ctype_locale = NULL, *messages_locale = NULL;
 	gchar *ctype_utf8_locale = NULL, *messages_utf8_locale = NULL;
+	gpgme_error_t err = 0;
 
 	gpgme_engine_info_t engineInfo;
 
 	if (strcmp(prefs_gpg_get_config()->gpg_path, "") != 0 &&
 	    access(prefs_gpg_get_config()->gpg_path, X_OK) != -1)
-		gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP,prefs_gpg_get_config()->gpg_path, NULL);
+		err = gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP, prefs_gpg_get_config()->gpg_path, NULL);
+		if (err != GPG_ERR_NO_ERROR)
+			g_warning("failed to set crypto engine configuration: %s", gpgme_strerror(err));
 
 	if (gpgme_check_version("1.0.0")) {
 #ifdef LC_CTYPE

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list