mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
Use a custom log handler for libassuan.
This commit is contained in:
parent
02566c5856
commit
37870234a1
@ -1,3 +1,12 @@
|
|||||||
|
2010-03-11 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg-agent.c: Include "asshelp.h".
|
||||||
|
(main): Remove assuan_set_assuan_log_prefix. Add
|
||||||
|
assuan_set_log_cb.
|
||||||
|
(handle_signal): Disable pth ctrl dumping.
|
||||||
|
(parse_rereadable_options, main): Remove assuan_set_assuan_log_stream.
|
||||||
|
* call-scd.c (start_scd): Remove assuan_set_log_stream.
|
||||||
|
|
||||||
2010-03-10 Werner Koch <wk@g10code.com>
|
2010-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am (common_libs): Remove libjnlib.a.
|
* Makefile.am (common_libs): Remove libjnlib.a.
|
||||||
|
@ -354,8 +354,6 @@ start_scd (ctrl_t ctrl)
|
|||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_debug ("first connection to SCdaemon established\n");
|
log_debug ("first connection to SCdaemon established\n");
|
||||||
|
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_log_stream (ctx, log_get_stream ());
|
|
||||||
|
|
||||||
/* Get the name of the additional socket opened by scdaemon. */
|
/* Get the name of the additional socket opened by scdaemon. */
|
||||||
{
|
{
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "setenv.h"
|
#include "setenv.h"
|
||||||
#include "gc-opt-flags.h"
|
#include "gc-opt-flags.h"
|
||||||
#include "exechelp.h"
|
#include "exechelp.h"
|
||||||
|
#include "asshelp.h"
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
{ aNull = 0,
|
{ aNull = 0,
|
||||||
@ -494,8 +495,6 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
|
|||||||
|| strcmp (current_logfile, pargs->r.ret_str))
|
|| strcmp (current_logfile, pargs->r.ret_str))
|
||||||
{
|
{
|
||||||
log_set_file (pargs->r.ret_str);
|
log_set_file (pargs->r.ret_str);
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_assuan_log_stream (log_get_stream ());
|
|
||||||
xfree (current_logfile);
|
xfree (current_logfile);
|
||||||
current_logfile = xtrystrdup (pargs->r.ret_str);
|
current_logfile = xtrystrdup (pargs->r.ret_str);
|
||||||
}
|
}
|
||||||
@ -616,10 +615,10 @@ main (int argc, char **argv )
|
|||||||
malloc_hooks.realloc = gcry_realloc;
|
malloc_hooks.realloc = gcry_realloc;
|
||||||
malloc_hooks.free = gcry_free;
|
malloc_hooks.free = gcry_free;
|
||||||
assuan_set_malloc_hooks (&malloc_hooks);
|
assuan_set_malloc_hooks (&malloc_hooks);
|
||||||
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
|
|
||||||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||||
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
||||||
assuan_sock_init ();
|
assuan_sock_init ();
|
||||||
|
setup_libassuan_logging (&opt.debug);
|
||||||
|
|
||||||
setup_libgcrypt_logging ();
|
setup_libgcrypt_logging ();
|
||||||
gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
|
gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
|
||||||
@ -946,8 +945,6 @@ main (int argc, char **argv )
|
|||||||
|JNLIB_LOG_WITH_PID));
|
|JNLIB_LOG_WITH_PID));
|
||||||
current_logfile = xstrdup (logfile);
|
current_logfile = xstrdup (logfile);
|
||||||
}
|
}
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_assuan_log_stream (log_get_stream ());
|
|
||||||
|
|
||||||
/* Make sure that we have a default ttyname. */
|
/* Make sure that we have a default ttyname. */
|
||||||
if (!default_ttyname && ttyname (1))
|
if (!default_ttyname && ttyname (1))
|
||||||
@ -1711,7 +1708,9 @@ handle_signal (int signo)
|
|||||||
|
|
||||||
case SIGUSR1:
|
case SIGUSR1:
|
||||||
log_info ("SIGUSR1 received - printing internal information:\n");
|
log_info ("SIGUSR1 received - printing internal information:\n");
|
||||||
pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
|
/* Fixme: We need to see how to integrate pth dumping into our
|
||||||
|
logging system. */
|
||||||
|
/* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
|
||||||
agent_query_dump_state ();
|
agent_query_dump_state ();
|
||||||
agent_scd_dump_state ();
|
agent_scd_dump_state ();
|
||||||
break;
|
break;
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2010-03-11 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* estream.c (es_setvbuf): Fix parameter check.
|
||||||
|
(es_set_buffering): Allow a SIZE of 0.
|
||||||
|
* asshelp.c (setup_libassuan_logging, my_libassuan_log_handler): New.
|
||||||
|
* logging.c (do_logv): Add arg IGNORE_ARG_PTR. Change all callers.
|
||||||
|
(log_string): New.
|
||||||
|
|
||||||
2010-03-10 Werner Koch <wk@g10code.com>
|
2010-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* estream.c (es_func_fp_read, es_func_fp_write, es_func_fp_seek)
|
* estream.c (es_func_fp_read, es_func_fp_write, es_func_fp_seek)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define JNLIB_NEED_LOG_LOGV
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "exechelp.h"
|
#include "exechelp.h"
|
||||||
@ -34,6 +35,36 @@
|
|||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "asshelp.h"
|
#include "asshelp.h"
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
my_libassuan_log_handler (assuan_context_t ctx, void *hook,
|
||||||
|
unsigned int cat, const char *msg)
|
||||||
|
{
|
||||||
|
unsigned int dbgval;
|
||||||
|
|
||||||
|
if (cat != ASSUAN_LOG_CONTROL)
|
||||||
|
return 0; /* We only want the control channel messages. */
|
||||||
|
dbgval = hook? *(unsigned int*)hook : 0;
|
||||||
|
if (!(dbgval & 1024))
|
||||||
|
return 0; /* Assuan debugging is not enabled. */
|
||||||
|
|
||||||
|
if (msg)
|
||||||
|
log_string (JNLIB_LOG_DEBUG, msg);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Setup libassuan to use our own logging functions. Should be used
|
||||||
|
early at startup. */
|
||||||
|
void
|
||||||
|
setup_libassuan_logging (unsigned int *debug_var_address)
|
||||||
|
{
|
||||||
|
assuan_set_log_cb (my_libassuan_log_handler, debug_var_address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
send_one_option (assuan_context_t ctx, gpg_err_source_t errsource,
|
send_one_option (assuan_context_t ctx, gpg_err_source_t errsource,
|
||||||
const char *name, const char *value, int use_putenv)
|
const char *name, const char *value, int use_putenv)
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
|
|
||||||
#include "session-env.h"
|
#include "session-env.h"
|
||||||
|
|
||||||
|
void setup_libassuan_logging (unsigned int *debug_var_address);
|
||||||
|
|
||||||
|
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
send_pinentry_environment (assuan_context_t ctx,
|
send_pinentry_environment (assuan_context_t ctx,
|
||||||
gpg_err_source_t errsource,
|
gpg_err_source_t errsource,
|
||||||
|
@ -2028,6 +2028,8 @@ es_set_buffering (estream_t ES__RESTRICT stream,
|
|||||||
buffer_new = buffer;
|
buffer_new = buffer;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!size)
|
||||||
|
size = BUFSIZ;
|
||||||
buffer_new = mem_alloc (size);
|
buffer_new = mem_alloc (size);
|
||||||
if (! buffer_new)
|
if (! buffer_new)
|
||||||
{
|
{
|
||||||
@ -3207,8 +3209,8 @@ es_setvbuf (estream_t ES__RESTRICT stream,
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (((type == _IOFBF) || (type == _IOLBF) || (type == _IONBF))
|
if ((type == _IOFBF || type == _IOLBF || type == _IONBF)
|
||||||
&& (! ((! size) && (type != _IONBF))))
|
&& (!buf || size || type == _IONBF))
|
||||||
{
|
{
|
||||||
ESTREAM_LOCK (stream);
|
ESTREAM_LOCK (stream);
|
||||||
err = es_set_buffering (stream, buf, type, size);
|
err = es_set_buffering (stream, buf, type, size);
|
||||||
|
@ -415,7 +415,7 @@ log_get_stream ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_logv (int level, const char *fmt, va_list arg_ptr)
|
do_logv (int level, int ignore_arg_ptr, const char *fmt, va_list arg_ptr)
|
||||||
{
|
{
|
||||||
if (!logstream)
|
if (!logstream)
|
||||||
{
|
{
|
||||||
@ -478,6 +478,9 @@ do_logv (int level, const char *fmt, va_list arg_ptr)
|
|||||||
|
|
||||||
if (fmt)
|
if (fmt)
|
||||||
{
|
{
|
||||||
|
if (ignore_arg_ptr)
|
||||||
|
es_fputs_unlocked (fmt, logstream);
|
||||||
|
else
|
||||||
es_vfprintf_unlocked (logstream, fmt, arg_ptr);
|
es_vfprintf_unlocked (logstream, fmt, arg_ptr);
|
||||||
if (*fmt && fmt[strlen(fmt)-1] != '\n')
|
if (*fmt && fmt[strlen(fmt)-1] != '\n')
|
||||||
missing_lf = 1;
|
missing_lf = 1;
|
||||||
@ -508,7 +511,7 @@ do_log( int level, const char *fmt, ... )
|
|||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt) ;
|
va_start (arg_ptr, fmt) ;
|
||||||
do_logv( level, fmt, arg_ptr );
|
do_logv (level, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,28 +519,41 @@ do_log( int level, const char *fmt, ... )
|
|||||||
void
|
void
|
||||||
log_logv (int level, const char *fmt, va_list arg_ptr)
|
log_logv (int level, const char *fmt, va_list arg_ptr)
|
||||||
{
|
{
|
||||||
do_logv (level, fmt, arg_ptr);
|
do_logv (level, 0, fmt, arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
log_string (int level, const char *string)
|
||||||
|
{
|
||||||
|
/* We need to provide a dummy arg_ptr. volatile is needed to
|
||||||
|
suppress compiler warnings. */
|
||||||
|
volatile va_list dummy_arg_ptr;
|
||||||
|
|
||||||
|
do_logv (level, 1, string, dummy_arg_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_info (const char *fmt, ...)
|
log_info (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv( JNLIB_LOG_INFO, fmt, arg_ptr );
|
do_logv (JNLIB_LOG_INFO, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_error (const char *fmt, ...)
|
log_error (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv( JNLIB_LOG_ERROR, fmt, arg_ptr );
|
do_logv (JNLIB_LOG_ERROR, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
/* protect against counter overflow */
|
/* Protect against counter overflow. */
|
||||||
if (errorcount < 30000)
|
if (errorcount < 30000)
|
||||||
errorcount++;
|
errorcount++;
|
||||||
}
|
}
|
||||||
@ -549,29 +565,31 @@ log_fatal( const char *fmt, ... )
|
|||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv( JNLIB_LOG_FATAL, fmt, arg_ptr );
|
do_logv (JNLIB_LOG_FATAL, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
abort(); /* never called, but it makes the compiler happy */
|
abort (); /* Never called; just to make the compiler happy. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_bug (const char *fmt, ...)
|
log_bug (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv( JNLIB_LOG_BUG, fmt, arg_ptr );
|
do_logv (JNLIB_LOG_BUG, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
abort(); /* never called, but it makes the compiler happy */
|
abort (); /* Never called; just to make the compiler happy. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_debug (const char *fmt, ...)
|
log_debug (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list arg_ptr ;
|
va_list arg_ptr ;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv( JNLIB_LOG_DEBUG, fmt, arg_ptr );
|
do_logv (JNLIB_LOG_DEBUG, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,10 +600,11 @@ log_printf (const char *fmt, ...)
|
|||||||
va_list arg_ptr;
|
va_list arg_ptr;
|
||||||
|
|
||||||
va_start (arg_ptr, fmt);
|
va_start (arg_ptr, fmt);
|
||||||
do_logv (fmt ? JNLIB_LOG_CONT : JNLIB_LOG_BEGIN, fmt, arg_ptr);
|
do_logv (fmt ? JNLIB_LOG_CONT : JNLIB_LOG_BEGIN, 0, fmt, arg_ptr);
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Print a hexdump of BUFFER. With TEXT of NULL print just the raw
|
/* Print a hexdump of BUFFER. With TEXT of NULL print just the raw
|
||||||
dump, with TEXT just an empty string, print a trailing linefeed,
|
dump, with TEXT just an empty string, print a trailing linefeed,
|
||||||
otherwise print an entire debug line. */
|
otherwise print an entire debug line. */
|
||||||
@ -610,17 +629,15 @@ log_printhex (const char *text, const void *buffer, size_t length)
|
|||||||
void
|
void
|
||||||
bug_at( const char *file, int line, const char *func )
|
bug_at( const char *file, int line, const char *func )
|
||||||
{
|
{
|
||||||
do_log( JNLIB_LOG_BUG,
|
do_log (JNLIB_LOG_BUG, ("... this is a bug (%s:%d:%s)\n"), file, line, func);
|
||||||
("... this is a bug (%s:%d:%s)\n"), file, line, func );
|
abort (); /* Never called; just to make the compiler happy. */
|
||||||
abort(); /* never called, but it makes the compiler happy */
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void
|
void
|
||||||
bug_at( const char *file, int line )
|
bug_at( const char *file, int line )
|
||||||
{
|
{
|
||||||
do_log( JNLIB_LOG_BUG,
|
do_log (JNLIB_LOG_BUG, _("you found a bug ... (%s:%d)\n"), file, line);
|
||||||
_("you found a bug ... (%s:%d)\n"), file, line);
|
abort (); /* Never called; just to make the compiler happy. */
|
||||||
abort(); /* never called, but it makes the compiler happy */
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ enum jnlib_log_levels {
|
|||||||
JNLIB_LOG_DEBUG
|
JNLIB_LOG_DEBUG
|
||||||
};
|
};
|
||||||
void log_logv (int level, const char *fmt, va_list arg_ptr);
|
void log_logv (int level, const char *fmt, va_list arg_ptr);
|
||||||
|
void log_string (int level, const char *string);
|
||||||
#endif /*JNLIB_NEED_LOG_LOGV*/
|
#endif /*JNLIB_NEED_LOG_LOGV*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "iobuf.h"
|
#include "iobuf.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
||||||
/* Used by libgcrypt for logging. */
|
/* Used by libgcrypt for logging. */
|
||||||
static void
|
static void
|
||||||
my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
|
my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
|
||||||
@ -97,7 +96,6 @@ setup_libgcrypt_logging (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Decide whether the filename is stdout or a real filename and return
|
/* Decide whether the filename is stdout or a real filename and return
|
||||||
* an appropriate string. */
|
* an appropriate string. */
|
||||||
const char *
|
const char *
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2010-03-11 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg.c: Include "asshelp.h".
|
||||||
|
(main): Remove assuan_set_assuan_log_prefix. Add
|
||||||
|
assuan_set_log_cb.
|
||||||
|
* server.c (gpg_server): Remove assuan_set_log_stream.
|
||||||
|
|
||||||
2010-03-10 Werner Koch <wk@g10code.com>
|
2010-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am (needed_libs): Remove libjnlib.a.
|
* Makefile.am (needed_libs): Remove libjnlib.a.
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include "keyserver-internal.h"
|
#include "keyserver-internal.h"
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
#include "gc-opt-flags.h"
|
#include "gc-opt-flags.h"
|
||||||
|
#include "asshelp.h"
|
||||||
|
|
||||||
#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
|
#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
|
||||||
#define MY_O_BINARY O_BINARY
|
#define MY_O_BINARY O_BINARY
|
||||||
@ -2070,8 +2071,8 @@ main (int argc, char **argv)
|
|||||||
malloc_hooks.realloc = gcry_realloc;
|
malloc_hooks.realloc = gcry_realloc;
|
||||||
malloc_hooks.free = gcry_free;
|
malloc_hooks.free = gcry_free;
|
||||||
assuan_set_malloc_hooks (&malloc_hooks);
|
assuan_set_malloc_hooks (&malloc_hooks);
|
||||||
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
|
|
||||||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||||
|
setup_libassuan_logging (&opt.debug);
|
||||||
|
|
||||||
/* Try for a version specific config file first */
|
/* Try for a version specific config file first */
|
||||||
default_configname = get_default_configname ();
|
default_configname = get_default_configname ();
|
||||||
|
@ -735,9 +735,6 @@ gpg_server (ctrl_t ctrl)
|
|||||||
ctrl->server_local->assuan_ctx = ctx;
|
ctrl->server_local->assuan_ctx = ctx;
|
||||||
ctrl->server_local->message_fd = GNUPG_INVALID_FD;
|
ctrl->server_local->message_fd = GNUPG_INVALID_FD;
|
||||||
|
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_log_stream (ctx, log_get_stream ());
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
rc = assuan_accept (ctx);
|
rc = assuan_accept (ctx);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
009-11-04 Werner Koch <wk@g10code.com>
|
2009-11-04 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
Under initial development - no need for a ChangeLog.
|
Under initial development - no need for a ChangeLog.
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "sysutils.h"
|
#include "sysutils.h"
|
||||||
#include "gc-opt-flags.h"
|
#include "gc-opt-flags.h"
|
||||||
|
#include "asshelp.h"
|
||||||
#include "keyblob.h"
|
#include "keyblob.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "runner.h"
|
#include "runner.h"
|
||||||
@ -432,10 +433,9 @@ main ( int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare libassuan. */
|
/* Prepare libassuan. */
|
||||||
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
|
|
||||||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||||
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
||||||
|
setup_libassuan_logging (&opt.debug);
|
||||||
|
|
||||||
/* Setup a default control structure for command line mode. */
|
/* Setup a default control structure for command line mode. */
|
||||||
memset (&ctrl, 0, sizeof ctrl);
|
memset (&ctrl, 0, sizeof ctrl);
|
||||||
@ -799,7 +799,9 @@ handle_signal (int signo)
|
|||||||
|
|
||||||
case SIGUSR1:
|
case SIGUSR1:
|
||||||
log_info ("SIGUSR1 received - printing internal information:\n");
|
log_info ("SIGUSR1 received - printing internal information:\n");
|
||||||
pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
|
/* Fixme: We need to see how to integrate pth dumping into our
|
||||||
|
logging system. */
|
||||||
|
/* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
|
||||||
mountinfo_dump_all ();
|
mountinfo_dump_all ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -642,9 +642,6 @@ g13_server (ctrl_t ctrl)
|
|||||||
}
|
}
|
||||||
ctrl->server_local->assuan_ctx = ctx;
|
ctrl->server_local->assuan_ctx = ctx;
|
||||||
|
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_log_stream (ctx, log_get_stream ());
|
|
||||||
|
|
||||||
while ( !(err = assuan_accept (ctx)) )
|
while ( !(err = assuan_accept (ctx)) )
|
||||||
{
|
{
|
||||||
err = assuan_process (ctx);
|
err = assuan_process (ctx);
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2010-03-11 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* scdaemon.c: Include "asshelp.h".
|
||||||
|
(main): Remove assuan_set_assuan_log_prefix. Add
|
||||||
|
assuan_set_log_cb.
|
||||||
|
(handle_signal): Disable pth ctrl dumping.
|
||||||
|
* command.c (scd_command_handler): Remove assuan_set_log_stream.
|
||||||
|
|
||||||
2010-03-10 Werner Koch <wk@g10code.com>
|
2010-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am (scdaemon_LDADD): Remove libjnlib.a.
|
* Makefile.am (scdaemon_LDADD): Remove libjnlib.a.
|
||||||
|
@ -1947,9 +1947,6 @@ scd_command_handler (ctrl_t ctrl, int fd)
|
|||||||
ctrl->server_local->ctrl_backlink = ctrl;
|
ctrl->server_local->ctrl_backlink = ctrl;
|
||||||
ctrl->server_local->assuan_ctx = ctx;
|
ctrl->server_local->assuan_ctx = ctx;
|
||||||
|
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_log_stream (ctx, log_get_stream ());
|
|
||||||
|
|
||||||
/* We open the reader right at startup so that the ticker is able to
|
/* We open the reader right at startup so that the ticker is able to
|
||||||
update the status file. */
|
update the status file. */
|
||||||
if (ctrl->reader_slot == -1)
|
if (ctrl->reader_slot == -1)
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "ccid-driver.h"
|
#include "ccid-driver.h"
|
||||||
#include "mkdtemp.h"
|
#include "mkdtemp.h"
|
||||||
#include "gc-opt-flags.h"
|
#include "gc-opt-flags.h"
|
||||||
|
#include "asshelp.h"
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
{ aNull = 0,
|
{ aNull = 0,
|
||||||
@ -432,10 +433,10 @@ main (int argc, char **argv )
|
|||||||
malloc_hooks.realloc = gcry_realloc;
|
malloc_hooks.realloc = gcry_realloc;
|
||||||
malloc_hooks.free = gcry_free;
|
malloc_hooks.free = gcry_free;
|
||||||
assuan_set_malloc_hooks (&malloc_hooks);
|
assuan_set_malloc_hooks (&malloc_hooks);
|
||||||
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
|
|
||||||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||||
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
|
||||||
assuan_sock_init ();
|
assuan_sock_init ();
|
||||||
|
setup_libassuan_logging (&opt.debug);
|
||||||
|
|
||||||
setup_libgcrypt_logging ();
|
setup_libgcrypt_logging ();
|
||||||
gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
|
gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
|
||||||
@ -951,7 +952,9 @@ handle_signal (int signo)
|
|||||||
|
|
||||||
case SIGUSR1:
|
case SIGUSR1:
|
||||||
log_info ("SIGUSR1 received - printing internal information:\n");
|
log_info ("SIGUSR1 received - printing internal information:\n");
|
||||||
pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
|
/* Fixme: We need to see how to integrate pth dumping into our
|
||||||
|
logging system. */
|
||||||
|
/* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
|
||||||
app_dump_state ();
|
app_dump_state ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2010-03-11 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpgsm.c: Include "asshelp.h".
|
||||||
|
(main): Remove assuan_set_assuan_log_prefix. Add
|
||||||
|
assuan_set_log_cb.
|
||||||
|
* server.c (gpgsm_server): Remove assuan_set_log_stream.
|
||||||
|
|
||||||
2010-03-10 Werner Koch <wk@g10code.com>
|
2010-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am (common_libs): Remove libjnlib.a. Change order.
|
* Makefile.am (common_libs): Remove libjnlib.a. Change order.
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "keydb.h"
|
#include "keydb.h"
|
||||||
#include "sysutils.h"
|
#include "sysutils.h"
|
||||||
#include "gc-opt-flags.h"
|
#include "gc-opt-flags.h"
|
||||||
|
#include "asshelp.h"
|
||||||
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
@ -982,8 +982,8 @@ main ( int argc, char **argv)
|
|||||||
malloc_hooks.realloc = gcry_realloc;
|
malloc_hooks.realloc = gcry_realloc;
|
||||||
malloc_hooks.free = gcry_free;
|
malloc_hooks.free = gcry_free;
|
||||||
assuan_set_malloc_hooks (&malloc_hooks);
|
assuan_set_malloc_hooks (&malloc_hooks);
|
||||||
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
|
|
||||||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||||
|
setup_libassuan_logging (&opt.debug);
|
||||||
|
|
||||||
keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
||||||
|
|
||||||
|
@ -1311,9 +1311,6 @@ gpgsm_server (certlist_t default_recplist)
|
|||||||
ctrl.server_local->list_external = 0;
|
ctrl.server_local->list_external = 0;
|
||||||
ctrl.server_local->default_recplist = default_recplist;
|
ctrl.server_local->default_recplist = default_recplist;
|
||||||
|
|
||||||
if (DBG_ASSUAN)
|
|
||||||
assuan_set_log_stream (ctx, log_get_stream ());
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
rc = assuan_accept (ctx);
|
rc = assuan_accept (ctx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user