[git] Assuan - branch, master, updated. libassuan-2.5.1-25-g8153608

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Nov 14 01:43:59 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPC library used by GnuPG".

The branch, master has been updated
       via  8153608073b7859eed32b8963b4a052243b4858f (commit)
      from  5e7988d2da3cdc36ebed3b598c0582028f3715ab (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8153608073b7859eed32b8963b4a052243b4858f
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Nov 14 09:12:59 2018 +0900

    server: Don't call _assuan_waitpid on server side.
    
    * src/server.c (_assuan_server_finish): Never call waitpid here.
    * src/assuan-socket-server.c (accept_connection_bottom): Indentation.
    
    --
    
    The waitpid/wait only makes sense by parent catching its child
    process.
    
    Since the commit 93595de1ede96dedfcaa93c7442536a2cde0b6ef (for version
    0.6.5, in 2004-04-21), CTX->PID on server side has client PID.
    
    In the commit cb53f862ff2a864da822d1c16d3df6a02157608b (2009-11-19),
    call of _assuan_waitpid was introduced in assuan_server_finish, but
    this call always fails because the process is not a child process of
    server.
    
    (If we could catch exit of non-child process, it might cause a dead
    lock, since client does call waitpid too.)
    
    The indentation fix is to show the place where PID is assigned.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/src/assuan-socket-server.c b/src/assuan-socket-server.c
index 4e255c2..e1e0c60 100644
--- a/src/assuan-socket-server.c
+++ b/src/assuan-socket-server.c
@@ -108,12 +108,12 @@ accept_connection_bottom (assuan_context_t ctx)
     socklen_t unpl = sizeof unp;
 
     if (getsockopt (fd, 0, LOCAL_PEEREID, &unp, &unpl) != -1)
-        {
-          ctx->peercred_valid = 1;
-          ctx->peercred.pid = unp.unp_pid;
-          ctx->peercred.uid = unp.unp_euid;
-          ctx->peercred.gid = unp.unp_egid;
-        }
+      {
+        ctx->peercred_valid = 1;
+        ctx->peercred.pid = unp.unp_pid;
+        ctx->peercred.uid = unp.unp_euid;
+        ctx->peercred.gid = unp.unp_egid;
+      }
   }
 #elif defined (HAVE_GETPEERUCRED)
   {                             /* Solaris */
diff --git a/src/server.c b/src/server.c
index 7c82f02..5e96798 100644
--- a/src/server.c
+++ b/src/server.c
@@ -46,7 +46,6 @@ _assuan_server_finish (assuan_context_t ctx)
     }
   if (ctx->pid != ASSUAN_INVALID_PID && ctx->pid)
     {
-      _assuan_waitpid (ctx, ctx->pid, ctx->flags.no_waitpid, NULL, 0);
       ctx->pid = ASSUAN_INVALID_PID;
     }
 

-----------------------------------------------------------------------

Summary of changes:
 src/assuan-socket-server.c | 12 ++++++------
 src/server.c               |  1 -
 2 files changed, 6 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list