GNUPG-1-9-BRANCH gnupg (18 files)
cvs user wk
cvs at cvs.gnupg.org
Sat Dec 18 11:17:33 CET 2004
Date: Saturday, December 18, 2004 @ 11:22:10
Author: wk
Path: /cvs/gnupg/gnupg
Tag: GNUPG-1-9-BRANCH
Modified: agent/ChangeLog agent/agent.h common/ChangeLog common/asshelp.c
common/asshelp.h common/maperror.c common/util.h g10/ChangeLog
g10/Makefile.am g10/call-agent.c g10/gpg.h kbx/ChangeLog
kbx/keybox-defs.h scd/ChangeLog scd/scdaemon.h sm/ChangeLog
sm/call-agent.c sm/gpgsm.h
Avoid the " map_to_assuan_status called with no error source" diagnostic.
-------------------+
agent/ChangeLog | 5 +++++
agent/agent.h | 2 ++
common/ChangeLog | 7 +++++++
common/asshelp.c | 16 +++++++++-------
common/asshelp.h | 1 +
common/maperror.c | 4 ++--
common/util.h | 2 +-
g10/ChangeLog | 9 +++++++++
g10/Makefile.am | 2 +-
g10/call-agent.c | 2 ++
g10/gpg.h | 2 ++
kbx/ChangeLog | 5 +++++
kbx/keybox-defs.h | 4 +++-
scd/ChangeLog | 5 +++++
scd/scdaemon.h | 3 +++
sm/ChangeLog | 7 +++++++
sm/call-agent.c | 2 +-
sm/gpgsm.h | 3 +++
18 files changed, 68 insertions(+), 13 deletions(-)
Index: gnupg/agent/ChangeLog
diff -u gnupg/agent/ChangeLog:1.59.2.46 gnupg/agent/ChangeLog:1.59.2.47
--- gnupg/agent/ChangeLog:1.59.2.46 Fri Dec 17 21:41:50 2004
+++ gnupg/agent/ChangeLog Sat Dec 18 11:22:10 2004
@@ -1,3 +1,8 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * agent.h (map_assuan_err): Define in terms of
+ map_assuan_err_with_source.
+
2004-12-17 Moritz Schulte <moritz at g10code.com>
* query.c: Undo change from 2004-12-05.
Index: gnupg/agent/agent.h
diff -u gnupg/agent/agent.h:1.32.2.8 gnupg/agent/agent.h:1.32.2.9
--- gnupg/agent/agent.h:1.32.2.8 Sun Sep 26 23:48:13 2004
+++ gnupg/agent/agent.h Sat Dec 18 11:22:10 2004
@@ -26,6 +26,8 @@
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPGAGENT
#include <gpg-error.h>
+#define map_assuan_err(a) \
+ map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
#include <errno.h>
#include <gcrypt.h>
Index: gnupg/common/ChangeLog
diff -u gnupg/common/ChangeLog:1.30.2.34 gnupg/common/ChangeLog:1.30.2.35
--- gnupg/common/ChangeLog:1.30.2.34 Wed Dec 15 15:15:09 2004
+++ gnupg/common/ChangeLog Sat Dec 18 11:22:10 2004
@@ -1,3 +1,10 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * maperror.c (map_assuan_err): Renamed to ..
+ (map_assuan_err_with_source): .. this and add arg SOURCE.c
+ * asshelp.c (send_pinentry_environment, send_one_option): Add arg
+ ERRSOURCE.
+
2004-12-15 Werner Koch <wk at g10code.com>
* sysutils.h [W32]: Prototypes for registry functions.
Index: gnupg/common/asshelp.c
diff -u gnupg/common/asshelp.c:1.1.2.3 gnupg/common/asshelp.c:1.1.2.4
--- gnupg/common/asshelp.c:1.1.2.3 Wed Dec 15 15:15:09 2004
+++ gnupg/common/asshelp.c Sat Dec 18 11:22:10 2004
@@ -34,7 +34,8 @@
static gpg_error_t
-send_one_option (assuan_context_t ctx, const char *name, const char *value)
+send_one_option (assuan_context_t ctx, gpg_err_source_t errsource,
+ const char *name, const char *value)
{
gpg_error_t err;
char *optstr;
@@ -48,7 +49,7 @@
assuan_error_t ae;
ae = assuan_transact (ctx, optstr, NULL, NULL, NULL, NULL, NULL, NULL);
- err = ae? map_assuan_err (ae) : 0;
+ err = ae? map_assuan_err_with_source (errsource, ae) : 0;
free (optstr);
}
@@ -61,6 +62,7 @@
defaults taken from the current locale. */
gpg_error_t
send_pinentry_environment (assuan_context_t ctx,
+ gpg_err_source_t errsource,
const char *opt_display,
const char *opt_ttyname,
const char *opt_ttytype,
@@ -78,7 +80,7 @@
dft_display = getenv ("DISPLAY");
if (opt_display || dft_display)
{
- err = send_one_option (ctx, "display",
+ err = send_one_option (ctx, errsource, "display",
opt_display ? opt_display : dft_display);
if (err)
return err;
@@ -93,7 +95,7 @@
}
if (opt_ttyname || dft_ttyname)
{
- err = send_one_option (ctx, "ttyname",
+ err = send_one_option (ctx, errsource, "ttyname",
opt_ttyname ? opt_ttyname : dft_ttyname);
if (err)
return err;
@@ -103,7 +105,7 @@
dft_ttytype = getenv ("TERM");
if (opt_ttytype || (dft_ttyname && dft_ttytype))
{
- err = send_one_option (ctx, "ttytype",
+ err = send_one_option (ctx, errsource, "ttytype",
opt_ttyname ? opt_ttytype : dft_ttytype);
if (err)
return err;
@@ -122,7 +124,7 @@
#endif
if (opt_lc_ctype || (dft_ttyname && dft_lc))
{
- err = send_one_option (ctx, "lc-ctype",
+ err = send_one_option (ctx, errsource, "lc-ctype",
opt_lc_ctype ? opt_lc_ctype : dft_lc);
}
#if defined(HAVE_SETLOCALE) && defined(LC_CTYPE)
@@ -148,7 +150,7 @@
#endif
if (opt_lc_messages || (dft_ttyname && dft_lc))
{
- err = send_one_option (ctx, "display",
+ err = send_one_option (ctx, errsource, "display",
opt_lc_messages ? opt_lc_messages : dft_lc);
}
#if defined(HAVE_SETLOCALE) && defined(LC_MESSAGES)
Index: gnupg/common/asshelp.h
diff -u gnupg/common/asshelp.h:1.1.2.1 gnupg/common/asshelp.h:1.1.2.2
--- gnupg/common/asshelp.h:1.1.2.1 Sat Mar 6 21:11:17 2004
+++ gnupg/common/asshelp.h Sat Dec 18 11:22:10 2004
@@ -26,6 +26,7 @@
gpg_error_t
send_pinentry_environment (assuan_context_t ctx,
+ gpg_err_source_t errsource,
const char *opt_display,
const char *opt_ttyname,
const char *opt_ttytype,
Index: gnupg/common/maperror.c
diff -u gnupg/common/maperror.c:1.18.2.5 gnupg/common/maperror.c:1.18.2.6
--- gnupg/common/maperror.c:1.18.2.5 Tue Jul 20 20:41:49 2004
+++ gnupg/common/maperror.c Sat Dec 18 11:22:10 2004
@@ -38,7 +38,7 @@
simple: All errors with a gpg_err_source of UNKNOWN are genuine
Assuan codes all others are passed verbatim through. */
gpg_error_t
-map_assuan_err (int err)
+map_assuan_err_with_source (int err, int source)
{
gpg_err_code_t ec;
@@ -77,7 +77,7 @@
ec = err < 100? GPG_ERR_ASSUAN_SERVER_FAULT : GPG_ERR_ASSUAN;
break;
}
- return gpg_err_make (GPG_ERR_SOURCE_UNKNOWN, ec);
+ return gpg_err_make (source, ec);
}
/* Map GPG_xERR_xx error codes to Assuan status codes */
Index: gnupg/common/util.h
diff -u gnupg/common/util.h:1.12.2.11 gnupg/common/util.h:1.12.2.12
--- gnupg/common/util.h:1.12.2.11 Wed Dec 15 15:15:09 2004
+++ gnupg/common/util.h Sat Dec 18 11:22:10 2004
@@ -61,7 +61,7 @@
/*-- maperror.c --*/
int map_kbx_err (int err);
-gpg_error_t map_assuan_err (int err);
+gpg_error_t map_assuan_err_with_source (int source, int err);
int map_to_assuan_status (int rc);
/*-- gettime.c --*/
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.372.2.52 gnupg/g10/ChangeLog:1.372.2.53
--- gnupg/g10/ChangeLog:1.372.2.52 Fri Oct 22 18:03:04 2004
+++ gnupg/g10/ChangeLog Sat Dec 18 11:22:09 2004
@@ -1,3 +1,12 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * gpg.h (map_assuan_err): Define in terms of
+ map_assuan_err_with_source.
+
+2004-12-15 Werner Koch <wk at g10code.com>
+
+ * Makefile.am (LDADD): Remove ZLIBS.
+
2004-10-22 Werner Koch <wk at g10code.com>
* g10.c (main): Display a bit fat warning that this gpg should not
Index: gnupg/g10/Makefile.am
diff -u gnupg/g10/Makefile.am:1.75.2.10 gnupg/g10/Makefile.am:1.75.2.11
--- gnupg/g10/Makefile.am:1.75.2.10 Thu Sep 30 16:34:30 2004
+++ gnupg/g10/Makefile.am Sat Dec 18 11:22:09 2004
@@ -108,7 +108,7 @@
# ks-db.h \
# $(common_source)
-LDADD = $(needed_libs) @LIBINTL@ @CAPLIBS@ @ZLIBS@ @W32LIBS@
+LDADD = $(needed_libs) @LIBINTL@ @CAPLIBS@ @W32LIBS@
gpg2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) -lassuan -lgpg-error
gpgv2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) -lassuan -lgpg-error
Index: gnupg/g10/call-agent.c
diff -u gnupg/g10/call-agent.c:1.1.2.16 gnupg/g10/call-agent.c:1.1.2.17
--- gnupg/g10/call-agent.c:1.1.2.16 Wed Dec 15 15:15:08 2004
+++ gnupg/g10/call-agent.c Sat Dec 18 11:22:09 2004
@@ -171,7 +171,9 @@
if (rc)
return map_assuan_err (rc);
+#ifdef __GNUC__
#warning put this code into common/asshelp.c
+#endif
dft_display = getenv ("DISPLAY");
if (opt.display || dft_display)
Index: gnupg/g10/gpg.h
diff -u gnupg/g10/gpg.h:1.1.2.2 gnupg/g10/gpg.h:1.1.2.3
--- gnupg/g10/gpg.h:1.1.2.2 Wed Jun 18 21:55:55 2003
+++ gnupg/g10/gpg.h Sat Dec 18 11:22:09 2004
@@ -29,6 +29,8 @@
#error GPG_ERR_SOURCE_DEFAULT already defined
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPG
+#define map_assuan_err(a) \
+ map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
#include <gpg-error.h>
Index: gnupg/kbx/ChangeLog
diff -u gnupg/kbx/ChangeLog:1.15.2.10 gnupg/kbx/ChangeLog:1.15.2.11
--- gnupg/kbx/ChangeLog:1.15.2.10 Tue Dec 7 19:07:30 2004
+++ gnupg/kbx/ChangeLog Sat Dec 18 11:22:09 2004
@@ -1,3 +1,8 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * keybox-defs.h (map_assuan_err): Define in terms of
+ map_assuan_err_with_source.
+
2004-12-07 Werner Koch <wk at g10code.com>
* keybox-init.c (keybox_release): Close the file pointer.
Index: gnupg/kbx/keybox-defs.h
diff -u gnupg/kbx/keybox-defs.h:1.6.2.8 gnupg/kbx/keybox-defs.h:1.6.2.9
--- gnupg/kbx/keybox-defs.h:1.6.2.8 Thu Dec 2 08:48:08 2004
+++ gnupg/kbx/keybox-defs.h Sat Dec 18 11:22:09 2004
@@ -25,8 +25,10 @@
#error GPG_ERR_SOURCE_DEFAULT already defined
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_KEYBOX
-
#include <gpg-error.h>
+#define map_assuan_err(a) \
+ map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
+
#include <sys/types.h> /* off_t */
/* We include the type defintions from jnlib instead of defining our
Index: gnupg/scd/ChangeLog
diff -u gnupg/scd/ChangeLog:1.25.2.60 gnupg/scd/ChangeLog:1.25.2.61
--- gnupg/scd/ChangeLog:1.25.2.60 Wed Dec 15 15:15:08 2004
+++ gnupg/scd/ChangeLog Sat Dec 18 11:22:09 2004
@@ -1,3 +1,8 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * scdaemon.h (map_assuan_err): Define in terms of
+ map_assuan_err_with_source.
+
2004-12-15 Werner Koch <wk at g10code.com>
* scdaemon.c [W32]: Various hacks to make it run under W32.
Index: gnupg/scd/scdaemon.h
diff -u gnupg/scd/scdaemon.h:1.12.2.9 gnupg/scd/scdaemon.h:1.12.2.10
--- gnupg/scd/scdaemon.h:1.12.2.9 Thu Aug 5 11:24:35 2004
+++ gnupg/scd/scdaemon.h Sat Dec 18 11:22:09 2004
@@ -26,6 +26,9 @@
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_SCD
#include <gpg-error.h>
+#define map_assuan_err(a) \
+ map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
+
#include <errno.h>
#include <time.h>
Index: gnupg/sm/ChangeLog
diff -u gnupg/sm/ChangeLog:1.101.2.82 gnupg/sm/ChangeLog:1.101.2.83
--- gnupg/sm/ChangeLog:1.101.2.82 Fri Dec 17 15:36:16 2004
+++ gnupg/sm/ChangeLog Sat Dec 18 11:22:09 2004
@@ -1,3 +1,10 @@
+2004-12-18 Werner Koch <wk at g10code.com>
+
+ * gpgsm.h (map_assuan_err): Define in terms of
+ map_assuan_err_with_source.
+ * call-agent.c (start_agent): Pass error source to
+ send_pinentry_environment.
+
2004-12-17 Werner Koch <wk at g10code.com>
* call-dirmngr.c (isvalid_status_cb, lookup_status_cb)
Index: gnupg/sm/call-agent.c
diff -u gnupg/sm/call-agent.c:1.35.2.8 gnupg/sm/call-agent.c:1.35.2.9
--- gnupg/sm/call-agent.c:1.35.2.8 Mon Dec 13 16:49:56 2004
+++ gnupg/sm/call-agent.c Sat Dec 18 11:22:09 2004
@@ -168,7 +168,7 @@
if (rc)
return map_assuan_err (rc);
- return send_pinentry_environment (agent_ctx,
+ return send_pinentry_environment (agent_ctx, GPG_ERR_SOURCE_DEFAULT,
opt.display, opt.ttyname, opt.ttytype,
opt.lc_ctype, opt.lc_messages);
}
Index: gnupg/sm/gpgsm.h
diff -u gnupg/sm/gpgsm.h:1.54.2.23 gnupg/sm/gpgsm.h:1.54.2.24
--- gnupg/sm/gpgsm.h:1.54.2.23 Fri Dec 17 15:36:16 2004
+++ gnupg/sm/gpgsm.h Sat Dec 18 11:22:09 2004
@@ -26,6 +26,9 @@
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPGSM
#include <gpg-error.h>
+#define map_assuan_err(a) \
+ map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
+
#include <ksba.h>
#include "../common/util.h"
More information about the Gnupg-commits
mailing list