summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-06-14 19:05:07 +0200
committerWerner Koch <wk@gnupg.org>2007-06-14 19:05:07 +0200
commit0cfbfd6186c7b28a355069ebb89b9739908318c6 (patch)
treea1e2990f266ca151fc47f06d41f40bca743eea76 /tools
parentSyntax fix - should build now - however not tested. (diff)
downloadgnupg2-0cfbfd6186c7b28a355069ebb89b9739908318c6.tar.xz
gnupg2-0cfbfd6186c7b28a355069ebb89b9739908318c6.zip
A whole bunch of changes to allow building for Windows.
See the ChangeLogs for details.
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog22
-rw-r--r--tools/Makefile.am11
-rw-r--r--tools/gpg-connect-agent.c4
-rw-r--r--tools/gpgconf-comp.c8
-rw-r--r--tools/gpgconf.c3
-rw-r--r--tools/symcryptrun.c18
6 files changed, 58 insertions, 8 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index a75a2b963..680a96c79 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,25 @@
+2007-06-14 Werner Koch <wk@g10code.com>
+
+ * symcryptrun.c (main): Setup default socket name for
+ simple-pwquery.
+ (MAP_SPWQ_ERROR_IMPL): New. Use it for all spwq error returns.
+
+2007-06-12 Werner Koch <wk@g10code.com>
+
+ * gpgconf-comp.c (gc_process_gpgconf_conf): Replace
+ GNUPG_SYSCONFDIR by a function call.
+
+ * gpg-connect-agent.c (main): Replace some calls by
+ init_common_subsystems.
+ * gpgconf.c (main): Ditto.
+ * symcryptrun.c (main): Ditto.
+
+2007-06-11 Werner Koch <wk@g10code.com>
+
+ * symcryptrun.c (main) [W32]: Call pth_init.
+ * gpgconf.c (main) [W32]: Call pth_init
+ * gpg-connect-agent.c (main) [W32]: Call pth_init.
+
2007-06-06 Werner Koch <wk@g10code.com>
* Makefile.am (bin_PROGRAMS) [W32]: Do not build gpgparsemail.
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5728c4ff9..ed967ecb8 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -50,17 +50,19 @@ endif
noinst_PROGRAMS = clean-sat mk-tdata make-dns-cert gpgsplit
-common_libs = ../jnlib/libjnlib.a ../common/libcommon.a ../gl/libgnu.a
+common_libs = ../jnlib/libjnlib.a $(libcommon) ../gl/libgnu.a
pwquery_libs = ../common/libsimple-pwquery.a
-gpgsplit_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
+gpgsplit_LDADD = $(common_libs) \
+ $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
$(ZLIBS) $(LIBINTL) $(LIBICONV)
gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c
# jnlib/common sucks in gpg-error, will they, nil they (some compilers
# do not eliminate the supposed-to-be-unused-inline-functions).
-gpgconf_LDADD = $(common_libs) $(LIBINTL) $(GPG_ERROR_LIBS) $(LIBICONV)
+gpgconf_LDADD = $(common_libs) \
+ $(LIBINTL) $(GPG_ERROR_LIBS) $(LIBICONV)
gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h
gpgparsemail_LDADD =
@@ -73,7 +75,8 @@ watchgnupg_SOURCES = watchgnupg.c
watchgnupg_LDADD = $(NETLIBS)
gpg_connect_agent_SOURCES = gpg-connect-agent.c no-libgcrypt.c
-gpg_connect_agent_LDADD = $(common_libs) $(LIBASSUAN_LIBS) \
+# FIXME: remove PTH_LIBS (why do we need them at all?)
+gpg_connect_agent_LDADD = $(common_libs) $(LIBASSUAN_LIBS) $(PTH_LIBS) \
$(GPG_ERROR_LIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
gpgkey2ssh_SOURCES = gpgkey2ssh.c
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 219d7d01f..7522ea916 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -274,6 +274,10 @@ main (int argc, char **argv)
set_strusage (my_strusage);
log_set_prefix ("gpg-connect-agent", 1);
+
+ /* Make sure that our subsystems are ready. */
+ init_common_subsystems ();
+
assuan_set_assuan_err_source (0);
i18n_init();
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 16fa3ad1a..c09078165 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -2676,9 +2676,13 @@ gc_process_gpgconf_conf (const char *fname, int update, int defaults)
int runtime[GC_BACKEND_NR];
int used_components[GC_COMPONENT_NR];
int backend_id, component_id;
+ char *fname_buffer = NULL;
if (!fname)
- fname = GNUPG_SYSCONFDIR "/gpgconf.conf";
+ {
+ fname_buffer = make_filename (gnupg_sysconfdir (), "gpgconf.conf", NULL);
+ fname = fname_buffer;
+ }
for (backend_id = 0; backend_id < GC_BACKEND_NR; backend_id++)
runtime[backend_id] = 0;
@@ -2695,6 +2699,7 @@ gc_process_gpgconf_conf (const char *fname, int update, int defaults)
gc_error (0, errno, "can not open global config file `%s'", fname);
result = -1;
}
+ xfree (fname_buffer);
return result;
}
@@ -2931,5 +2936,6 @@ gc_process_gpgconf_conf (const char *fname, int update, int defaults)
}
}
+ xfree (fname_buffer);
return result;
}
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index c06db5225..fdf97932f 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -116,6 +116,9 @@ main (int argc, char **argv)
set_strusage (my_strusage);
log_set_prefix ("gpgconf", 1);
+ /* Make sure that our subsystems are ready. */
+ init_common_subsystems ();
+
i18n_init();
/* Parse the command line. */
diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c
index f8de30fd9..bca96e58d 100644
--- a/tools/symcryptrun.c
+++ b/tools/symcryptrun.c
@@ -238,6 +238,8 @@ my_strusage (int level)
__result; }))
#endif
+/* Include the implementation of map_spwq_error. */
+MAP_SPWQ_ERROR_IMPL
/* Unlink a file, and shred it if SHRED is true. */
int
@@ -455,6 +457,7 @@ confucius_get_pass (const char *cacheid, int again, int *canceled)
pw = simple_pwquery (cacheid,
again ? _("does not match - try again"):NULL,
_("Passphrase:"), NULL, 0, &err);
+ err = map_spwq_error (err);
#ifdef ENABLE_NLS
if (orig_codeset)
@@ -911,8 +914,8 @@ main (int argc, char **argv)
set_strusage (my_strusage);
log_set_prefix ("symcryptrun", 1);
- /* Try to auto set the character set. */
- set_native_charset (NULL);
+ /* Make sure that our subsystems are ready. */
+ init_common_subsystems ();
i18n_init();
@@ -1028,13 +1031,22 @@ main (int argc, char **argv)
setup_libgcrypt_logging ();
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
+ /* Tell simple-pwquery about the the standard socket name. */
+ {
+ char *tmp = make_filename (opt.homedir, "S.gpg-agent", NULL);
+ simple_pw_set_socket (tmp);
+ xfree (tmp);
+ }
+
if (!opt.class)
{
log_error (_("no class provided\n"));
res = 1;
}
else if (!strcmp (opt.class, "confucius"))
- res = confucius_main (mode, argc, argv);
+ {
+ res = confucius_main (mode, argc, argv);
+ }
else
{
log_error (_("class %s is not supported\n"), opt.class);