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/posix-util.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/posix-util.c') diff --git a/src/posix-util.c b/src/posix-util.c index 478055ab..fd445070 100644 --- a/src/posix-util.c +++ b/src/posix-util.c @@ -28,6 +28,7 @@ #include #include "util.h" +#include "sys-util.h" const char * _gpgme_get_gpg_path (void) @@ -70,29 +71,6 @@ _gpgme_get_g13_path (void) } -const char * -_gpgme_get_uiserver_socket_path (void) -{ - static char *socket_path; - const char *homedir; - const char name[] = "S.uiserver"; - - if (socket_path) - return socket_path; - - homedir = _gpgme_get_default_homedir (); - if (! homedir) - return NULL; - - socket_path = malloc (strlen (homedir) + 1 + strlen (name) + 1); - if (! socket_path) - return NULL; - - strcpy (stpcpy (stpcpy (socket_path, homedir), "/"), name); - return socket_path; -} - - /* See w32-util.c */ int _gpgme_get_conf_int (const char *key, int *value) -- cgit v1.2.3