From a4c80126ae4754c8478c69a8a24a6ffd975485fc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 2 Aug 2013 15:25:23 +0200 Subject: Prefer GnuPG-2 engines over GnuPG-1. * src/util.h: Move some prototypes to ... * src/sys-util.h: New. * src/Makefile.am (main_sources): Add sys-util.h. * configure.ac (AH_VERBATIM): Add DIRSEP_C and DIRSEP_S. * src/dirinfo.c: Include sys-util.h. (WANT_GPG_NAME, WANT_GPGSM_NAME, WANT_G13_NAME) (WANT_UISRV_SOCKET): New. (dirinfo): Add corresponding fields. (parse_output): Add arg COMPONENTS and set new fields. (read_gpgconf_dirs): Add arg components and act upon it. (get_gpgconf_item): Call read_gpgconf_dirs two times. Add debug output. (_gpgme_get_default_gpg_name): New. (_gpgme_get_default_gpgsm_name): New. (_gpgme_get_default_g13_name): New. (_gpgme_get_default_gpgconf_name): New. (_gpgme_get_default_uisrv_socket): New. * src/engine-gpg.c, src/engine-g13.c, src/engine-gpgconf.c * src/engine-gpgsm.c, src/engine-uiserver.c: Change to use _gpgme_get_default_ instead of those from sys-util.h. * src/posix-util.c (_gpgme_get_gpg_path): Include sys-util.h. (_gpgme_get_uiserver_socket_path): Remove. * src/w32-util.c (_gpgme_get_gpg_path): Include sys-util.h. (_gpgme_get_uiserver_socket_path): Remove. -- The default engines names are now taken from the output of gpgconf. If gpgconf is not installed gpg 1 is assumed and locate the same was as gpgconf. --- src/engine-gpgsm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/engine-gpgsm.c') diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index 391b632d..cee20e31 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -120,7 +120,7 @@ static char * gpgsm_get_version (const char *file_name) { return _gpgme_get_program_version (file_name ? file_name - : _gpgme_get_gpgsm_path ()); + : _gpgme_get_default_gpgsm_name ()); } @@ -340,7 +340,8 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) #if USE_DESCRIPTOR_PASSING err = assuan_pipe_connect - (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (), + (gpgsm->assuan_ctx, + file_name ? file_name : _gpgme_get_default_gpgsm_name (), argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING); #else { @@ -352,7 +353,8 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) achild_fds[i] = (assuan_fd_t) child_fds[i]; err = assuan_pipe_connect - (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (), + (gpgsm->assuan_ctx, + file_name ? file_name : _gpgme_get_default_gpgsm_name (), argv, achild_fds, NULL, NULL, 0); /* For now... */ @@ -1945,7 +1947,7 @@ gpgsm_passwd (void *engine, gpgme_key_t key, unsigned int flags) struct engine_ops _gpgme_engine_ops_gpgsm = { /* Static functions. */ - _gpgme_get_gpgsm_path, + _gpgme_get_default_gpgsm_name, NULL, gpgsm_get_version, gpgsm_get_req_version, -- cgit v1.2.3