1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Set assuan system hooks before call of assuan_sock_init.

* agent/gpg-agent.c (initialize_modules): Move assuan_set_system_hooks.
(main): ... here, just before assuan_sock_init.

--

In Assuan, global variable SOCK_CTX is used internally, which is
initialized by assuan_sock_init.  When initialized, system hooks
are copied into SOCK_CTX structure.  Thus, system hooks should
be set, before the call of assuan_sock_init.

GnuPG-bug-id: 3378
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2017-12-06 11:20:51 +09:00
parent 0d0b9eb0d4
commit 1524ba9656

View File

@ -966,7 +966,6 @@ static void
initialize_modules (void) initialize_modules (void)
{ {
thread_init_once (); thread_init_once ();
assuan_set_system_hooks (ASSUAN_SYSTEM_NPTH);
initialize_module_cache (); initialize_module_cache ();
initialize_module_call_pinentry (); initialize_module_call_pinentry ();
initialize_module_call_scd (); initialize_module_call_scd ();
@ -1027,6 +1026,7 @@ main (int argc, char **argv )
malloc_hooks.free = gcry_free; malloc_hooks.free = gcry_free;
assuan_set_malloc_hooks (&malloc_hooks); assuan_set_malloc_hooks (&malloc_hooks);
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT); assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
assuan_set_system_hooks (ASSUAN_SYSTEM_NPTH);
assuan_sock_init (); assuan_sock_init ();
setup_libassuan_logging (&opt.debug, NULL); setup_libassuan_logging (&opt.debug, NULL);