From 24a75201da6be72edf85b96dbc0c01c747d02c6a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 6 Apr 2015 13:42:17 +0200 Subject: [PATCH] Rename DBG_ASSUAN to DBG_IPC and add separate DBG_EXTPROG. * g10/options.h (DBG_EXTPROG_VALUE): Separate from DBG_IPC_VALUE. --- agent/agent.h | 4 ++-- agent/call-pinentry.c | 4 ++-- agent/call-scd.c | 2 +- agent/gpg-agent.c | 16 ++++++++-------- dirmngr/dirmngr.c | 6 +++--- dirmngr/dirmngr.h | 4 ++-- g10/call-agent.c | 6 +----- g10/call-dirmngr.c | 2 +- g10/gpg.c | 2 +- g10/options.h | 12 +++++------- g13/call-gpg.c | 2 +- g13/g13.c | 8 ++++---- g13/g13.h | 4 ++-- scd/scdaemon.c | 8 ++++---- scd/scdaemon.h | 4 ++-- sm/call-agent.c | 2 +- sm/call-dirmngr.c | 2 +- sm/gpgsm.c | 8 ++++---- sm/gpgsm.h | 4 ++-- 19 files changed, 47 insertions(+), 53 deletions(-) diff --git a/agent/agent.h b/agent/agent.h index d61e6346e..30d0ffb5a 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -146,7 +146,7 @@ struct #define DBG_CACHE_VALUE 64 /* debug the caching */ #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ -#define DBG_ASSUAN_VALUE 1024 /* Enable Assuan debugging. */ +#define DBG_IPC_VALUE 1024 /* Enable Assuan debugging. */ /* Test macros for the debug option. */ #define DBG_COMMAND (opt.debug & DBG_COMMAND_VALUE) @@ -154,7 +154,7 @@ struct #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) /* Forward reference for local definitions in command.c. */ struct server_local_s; diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index ef1bfa428..6db429c47 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -135,7 +135,7 @@ unlock_pinentry (int rc) if (rc) { - if (DBG_ASSUAN) + if (DBG_IPC) log_debug ("error calling pinentry: %s <%s>\n", gpg_strerror (rc), gpg_strsource (rc)); @@ -351,7 +351,7 @@ start_pinentry (ctrl_t ctrl) } entry_ctx = ctx; - if (DBG_ASSUAN) + if (DBG_IPC) log_debug ("connection to PIN entry established\n"); rc = assuan_transact (entry_ctx, diff --git a/agent/call-scd.c b/agent/call-scd.c index ade7ef1b9..6cd582546 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -366,7 +366,7 @@ start_scd (ctrl_t ctrl) { memcpy (socket_name, databuf, datalen); socket_name[datalen] = 0; - if (DBG_ASSUAN) + if (DBG_IPC) log_debug ("additional connections at '%s'\n", socket_name); } } diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 6e1c76e20..740af7551 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -435,11 +435,11 @@ set_debug (void) else if (!strcmp (debug_level, "none") || (numok && numlvl < 1)) opt.debug = 0; else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2)) - opt.debug = DBG_ASSUAN_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE; + opt.debug = DBG_IPC_VALUE|DBG_COMMAND_VALUE; else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE + opt.debug = (DBG_IPC_VALUE|DBG_COMMAND_VALUE |DBG_CACHE_VALUE); else if (!strcmp (debug_level, "guru") || numok) { @@ -478,7 +478,7 @@ set_debug (void) (opt.debug & DBG_CACHE_VALUE )? " cache":"", (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_ASSUAN_VALUE )? " assuan":""); + (opt.debug & DBG_IPC_VALUE )? " ipc":""); } @@ -1952,7 +1952,7 @@ putty_message_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) if (!cds->cbData || mapfile[cds->cbData - 1]) return 0; /* Ignore empty and non-properly terminated strings. */ - if (DBG_ASSUAN) + if (DBG_IPC) { npth_protect (); log_debug ("ssh map file '%s'", mapfile); @@ -1960,7 +1960,7 @@ putty_message_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) } maphd = OpenFileMapping (FILE_MAP_ALL_ACCESS, FALSE, mapfile); - if (DBG_ASSUAN) + if (DBG_IPC) { npth_protect (); log_debug ("ssh map handle %p\n", maphd); @@ -1989,7 +1989,7 @@ putty_message_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) goto leave; } - if (DBG_ASSUAN) + if (DBG_IPC) { char *sidstr; @@ -2010,7 +2010,7 @@ putty_message_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) } data = MapViewOfFile (maphd, FILE_MAP_ALL_ACCESS, 0, 0, 0); - if (DBG_ASSUAN) + if (DBG_IPC) log_debug ("ssh IPC buffer at %p\n", data); if (!data) goto leave; diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 94d66924d..4c17c8c46 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -393,11 +393,11 @@ set_debug (void) else if (!strcmp (debug_level, "none") || (numok && numlvl < 1)) opt.debug = 0; else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2)) - opt.debug = DBG_ASSUAN_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_X509_VALUE|DBG_LOOKUP_VALUE); + opt.debug = (DBG_IPC_VALUE|DBG_X509_VALUE|DBG_LOOKUP_VALUE); else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_X509_VALUE|DBG_LOOKUP_VALUE + opt.debug = (DBG_IPC_VALUE|DBG_X509_VALUE|DBG_LOOKUP_VALUE |DBG_CACHE_VALUE|DBG_CRYPTO_VALUE); else if (!strcmp (debug_level, "guru") || numok) { diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h index 318577827..56abc86d4 100644 --- a/dirmngr/dirmngr.h +++ b/dirmngr/dirmngr.h @@ -138,7 +138,7 @@ struct #define DBG_CACHE_VALUE 64 /* debug the caching */ #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ -#define DBG_ASSUAN_VALUE 1024 /* debug assuan communication */ +#define DBG_IPC_VALUE 1024 /* debug assuan communication */ #define DBG_LOOKUP_VALUE 8192 /* debug lookup details */ #define DBG_X509 (opt.debug & DBG_X509_VALUE) @@ -146,7 +146,7 @@ struct #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) #define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE) /* A simple list of certificate references. */ diff --git a/g10/call-agent.c b/g10/call-agent.c index 2a80f22b8..017e91692 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -43,10 +43,6 @@ #include "../common/shareddefs.h" #include "host2net.h" -#ifndef DBG_ASSUAN -# define DBG_ASSUAN 1 -#endif - #define CONTROL_D ('D' - 'A' + 1) @@ -286,7 +282,7 @@ start_agent (ctrl_t ctrl, int for_card) opt.agent_program, opt.lc_ctype, opt.lc_messages, opt.session_env, - opt.autostart, opt.verbose, DBG_ASSUAN, + opt.autostart, opt.verbose, DBG_IPC, NULL, NULL); if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT) { diff --git a/g10/call-dirmngr.c b/g10/call-dirmngr.c index e2f63fbc5..ef4ca7651 100644 --- a/g10/call-dirmngr.c +++ b/g10/call-dirmngr.c @@ -131,7 +131,7 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx) GPG_ERR_SOURCE_DEFAULT, opt.homedir, opt.dirmngr_program, - opt.autostart, opt.verbose, DBG_ASSUAN, + opt.autostart, opt.verbose, DBG_IPC, NULL /*gpg_status2*/, ctrl); if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR) { diff --git a/g10/gpg.c b/g10/gpg.c index 2d6dabfd0..a52d1d90d 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1136,7 +1136,7 @@ set_debug (const char *level) (opt.debug & DBG_HASHING_VALUE)? " hashing":"", (opt.debug & DBG_EXTPROG_VALUE)? " extprog":"", (opt.debug & DBG_CARD_IO_VALUE)? " cardio":"", - (opt.debug & DBG_ASSUAN_VALUE )? " assuan":"", + (opt.debug & DBG_IPC_VALUE )? " ipc":"", (opt.debug & DBG_CLOCK_VALUE )? " clock":"", (opt.debug & DBG_LOOKUP_VALUE )? " lookup":""); } diff --git a/g10/options.h b/g10/options.h index c86ddc55a..6c96d1874 100644 --- a/g10/options.h +++ b/g10/options.h @@ -277,14 +277,11 @@ struct { #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_TRUST_VALUE 256 /* debug the trustdb */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ -#define DBG_EXTPROG_VALUE 1024 /* debug external program calls */ +#define DBG_IPC_VALUE 1024 /* debug assuan communication */ #define DBG_CARD_IO_VALUE 2048 /* debug smart card I/O. */ #define DBG_CLOCK_VALUE 4096 #define DBG_LOOKUP_VALUE 8192 /* debug the kety lookup */ - -/* Fixme: For now alias this value. */ -#define DBG_ASSUAN_VALUE DBG_EXTPROG_VALUE - +#define DBG_EXTPROG_VALUE 16384 /* debug external program calls */ /* Tests for the debugging flags. */ #define DBG_PACKET (opt.debug & DBG_PACKET_VALUE) @@ -293,11 +290,12 @@ struct { #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_TRUST (opt.debug & DBG_TRUST_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) -#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) #define DBG_CARD_IO (opt.debug & DBG_CARD_IO_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) #define DBG_CLOCK (opt.debug & DBG_CLOCK_VALUE) #define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE) +#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE) /* FIXME: We need to check whey we did not put this into opt. */ #define DBG_MEMORY memory_debug_mode diff --git a/g13/call-gpg.c b/g13/call-gpg.c index 54f6056d5..0bd935c1f 100644 --- a/g13/call-gpg.c +++ b/g13/call-gpg.c @@ -136,7 +136,7 @@ start_gpg (ctrl_t ctrl, int input_fd, int output_fd, assuan_context_t *r_ctx) *r_ctx = ctx; - if (DBG_ASSUAN) + if (DBG_IPC) log_debug ("connection to GPG established\n"); return 0; } diff --git a/g13/g13.c b/g13/g13.c index 157e6465d..2e4e63d99 100644 --- a/g13/g13.c +++ b/g13/g13.c @@ -260,11 +260,11 @@ set_debug (void) else if (!strcmp (debug_level, "none") || (numok && numlvl < 1)) opt.debug = 0; else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2)) - opt.debug = DBG_ASSUAN_VALUE|DBG_MOUNT_VALUE; + opt.debug = DBG_IPC_VALUE|DBG_MOUNT_VALUE; else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_ASSUAN_VALUE|DBG_MOUNT_VALUE; + opt.debug = DBG_IPC_VALUE|DBG_MOUNT_VALUE; else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_MOUNT_VALUE|DBG_CRYPTO_VALUE); + opt.debug = (DBG_IPC_VALUE|DBG_MOUNT_VALUE|DBG_CRYPTO_VALUE); else if (!strcmp (debug_level, "guru") || numok) { opt.debug = ~0; @@ -294,7 +294,7 @@ set_debug (void) (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", (opt.debug & DBG_MEMORY_VALUE )? " memory":"", (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_ASSUAN_VALUE )? " assuan":""); + (opt.debug & DBG_IPC_VALUE )? " ipc":""); } diff --git a/g13/g13.h b/g13/g13.h index bdcc02ae5..371833d84 100644 --- a/g13/g13.h +++ b/g13/g13.h @@ -70,12 +70,12 @@ struct #define DBG_CRYPTO_VALUE 4 /* Debug low level crypto. */ #define DBG_MEMORY_VALUE 32 /* Debug memory allocation stuff. */ #define DBG_MEMSTAT_VALUE 128 /* Show memory statistics. */ -#define DBG_ASSUAN_VALUE 1024 /* Debug assuan communication. */ +#define DBG_IPC_VALUE 1024 /* Debug assuan communication. */ #define DBG_MOUNT (opt.debug & DBG_MOUNT_VALUE) #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) /* Forward declaration for an object defined in server.c. */ struct server_local_s; diff --git a/scd/scdaemon.c b/scd/scdaemon.c index d0777e80f..39925ce99 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -309,11 +309,11 @@ set_debug (const char *level) else if (!strcmp (level, "none") || (numok && numlvl < 1)) opt.debug = 0; else if (!strcmp (level, "basic") || (numok && numlvl <= 2)) - opt.debug = DBG_ASSUAN_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE; + opt.debug = DBG_IPC_VALUE|DBG_COMMAND_VALUE; else if (!strcmp (level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE + opt.debug = (DBG_IPC_VALUE|DBG_COMMAND_VALUE |DBG_CACHE_VALUE|DBG_CARD_IO_VALUE); else if (!strcmp (level, "guru") || numok) { @@ -352,7 +352,7 @@ set_debug (const char *level) (opt.debug & DBG_CACHE_VALUE )? " cache":"", (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_ASSUAN_VALUE )? " assuan":"", + (opt.debug & DBG_IPC_VALUE )? " ipc":"", (opt.debug & DBG_CARD_IO_VALUE)? " cardio":"", (opt.debug & DBG_READER_VALUE )? " reader":""); } diff --git a/scd/scdaemon.h b/scd/scdaemon.h index ab63425d8..35ada43b4 100644 --- a/scd/scdaemon.h +++ b/scd/scdaemon.h @@ -73,7 +73,7 @@ struct #define DBG_CACHE_VALUE 64 /* debug the caching */ #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ -#define DBG_ASSUAN_VALUE 1024 +#define DBG_IPC_VALUE 1024 #define DBG_CARD_IO_VALUE 2048 #define DBG_READER_VALUE 4096 /* Trace reader related functions. */ @@ -82,7 +82,7 @@ struct #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) #define DBG_CARD_IO (opt.debug & DBG_CARD_IO_VALUE) #define DBG_READER (opt.debug & DBG_READER_VALUE) diff --git a/sm/call-agent.c b/sm/call-agent.c index f579200ff..4b2ec3390 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -95,7 +95,7 @@ start_agent (ctrl_t ctrl) opt.agent_program, opt.lc_ctype, opt.lc_messages, opt.session_env, - opt.autostart, opt.verbose, DBG_ASSUAN, + opt.autostart, opt.verbose, DBG_IPC, gpgsm_status2, ctrl); if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT) diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c index f8cfdf8e8..560ea7208 100644 --- a/sm/call-dirmngr.c +++ b/sm/call-dirmngr.c @@ -209,7 +209,7 @@ start_dirmngr_ext (ctrl_t ctrl, assuan_context_t *ctx_r) err = start_new_dirmngr (&ctx, GPG_ERR_SOURCE_DEFAULT, opt.homedir, opt.dirmngr_program, - opt.autostart, opt.verbose, DBG_ASSUAN, + opt.autostart, opt.verbose, DBG_IPC, gpgsm_status2, ctrl); if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR) { diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 773cf9cab..8cd7e84e6 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -670,11 +670,11 @@ set_debug (void) else if (!strcmp (debug_level, "none") || (numok && numlvl < 1)) opt.debug = 0; else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2)) - opt.debug = DBG_ASSUAN_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_ASSUAN_VALUE|DBG_X509_VALUE; + opt.debug = DBG_IPC_VALUE|DBG_X509_VALUE; else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_ASSUAN_VALUE|DBG_X509_VALUE + opt.debug = (DBG_IPC_VALUE|DBG_X509_VALUE |DBG_CACHE_VALUE|DBG_CRYPTO_VALUE); else if (!strcmp (debug_level, "guru") || numok) { @@ -714,7 +714,7 @@ set_debug (void) (opt.debug & DBG_CACHE_VALUE )? " cache":"", (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_ASSUAN_VALUE )? " assuan":"" ); + (opt.debug & DBG_IPC_VALUE )? " ipc":"" ); } diff --git a/sm/gpgsm.h b/sm/gpgsm.h index 63c9d0b27..187ed8368 100644 --- a/sm/gpgsm.h +++ b/sm/gpgsm.h @@ -153,14 +153,14 @@ struct #define DBG_CACHE_VALUE 64 /* debug the caching */ #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ -#define DBG_ASSUAN_VALUE 1024 /* debug assuan communication */ +#define DBG_IPC_VALUE 1024 /* debug assuan communication */ #define DBG_X509 (opt.debug & DBG_X509_VALUE) #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) -#define DBG_ASSUAN (opt.debug & DBG_ASSUAN_VALUE) +#define DBG_IPC (opt.debug & DBG_IPC_VALUE) /* Forward declaration for an object defined in server.c */ struct server_local_s;