[Pkg-gnupg-commit] [gnupg2] 95/292: agent, dirmngr, scd: Fix init_common_subsystems.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit fc0b392e766af8127094e8b529d25abb84ad1d65
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Oct 7 10:45:22 2016 +0900

    agent, dirmngr, scd: Fix init_common_subsystems.
    
    * common/init.c (_init_common_subsystems): Don't call
    gpgrt_set_syscall_clamp in this function.
    * agent/gpg-agent.c, dirmngr/dirmngr.c, scd/scdaemon.c: Call
    gpgrt_set_syscall_clamp after npth_init.
    
    --
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 agent/gpg-agent.c |  1 +
 common/init.c     | 11 -----------
 dirmngr/dirmngr.c |  1 +
 scd/scdaemon.c    |  2 ++
 4 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index a4025ce..70d9775 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -941,6 +941,7 @@ thread_init_once (void)
       npth_initialized++;
       npth_init ();
     }
+  gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
 }
 
 
diff --git a/common/init.c b/common/init.c
index 8a86266..cb4228a 100644
--- a/common/init.c
+++ b/common/init.c
@@ -29,20 +29,12 @@
 
 #include <config.h>
 
-#ifdef WITHOUT_NPTH /* Give the Makefile a chance to build without Pth.  */
-#undef HAVE_NPTH
-#undef USE_NPTH
-#endif
-
 #ifdef HAVE_W32_SYSTEM
 # ifdef HAVE_WINSOCK2_H
 #  include <winsock2.h>
 # endif
 # include <windows.h>
 #endif
-#ifdef HAVE_NPTH
-# include <npth.h>
-#endif
 #ifdef HAVE_W32CE_SYSTEM
 # include <assuan.h> /* For _assuan_w32ce_finish_pipe. */
 #endif
@@ -197,9 +189,6 @@ _init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp)
   /* Initialize the Estream library. */
   gpgrt_init ();
   gpgrt_set_alloc_func (gcry_realloc);
-#ifdef USE_NPTH
-  gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
-#endif
 
   /* Special hack for Windows CE: We extract some options from arg
      to setup the standard handles.  */
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 621c2bb..271360e 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -651,6 +651,7 @@ static void
 thread_init (void)
 {
   npth_init ();
+  gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
 
   /* Now with NPth running we can set the logging callback.  Our
      windows implementation does not yet feature the NPth TLS
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 3571e66..df1abe8 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -723,6 +723,7 @@ main (int argc, char **argv )
 #endif
 
       npth_init ();
+      gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
 
       /* If --debug-allow-core-dump has been given we also need to
          switch the working directory to a place where we can actually
@@ -862,6 +863,7 @@ main (int argc, char **argv )
       /* This is the child. */
 
       npth_init ();
+      gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
 
       /* Detach from tty and put process into a new session. */
       if (!nodetach )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list