diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-10-27 19:35:40 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-10-27 19:35:40 +0900 |
commit | 905369a8dfeeea30989e526f99346771c827070c (patch) | |
tree | 0554ab14aa5f5eb69adb57a3b8341485a3d3150b | |
parent | 61f69c73f36447cc7685eb38c6bf24d7fa965c8f (diff) | |
download | libassuan-905369a8dfeeea30989e526f99346771c827070c.tar.gz |
testing fdpassing.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r-- | src/assuan-pipe-connect.c | 12 | ||||
-rw-r--r-- | src/assuan-pipe-server.c | 7 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/fdpassing.c | 4 |
4 files changed, 11 insertions, 14 deletions
diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c index 1589d79..a2223cd 100644 --- a/src/assuan-pipe-connect.c +++ b/src/assuan-pipe-connect.c @@ -413,16 +413,12 @@ assuan_pipe_connect (assuan_context_t ctx, TRACE2 (ctx, ASSUAN_LOG_CTX, "assuan_pipe_connect", ctx, "name=%s, flags=0x%x", name ? name : "(null)", flags); +#ifndef HAVE_W32_SYSTEM if (flags & ASSUAN_PIPE_CONNECT_FDPASSING) - { -#ifdef HAVE_W32_SYSTEM - return _assuan_error (ctx, GPG_ERR_NOT_IMPLEMENTED); -#else - return socketpair_connect (ctx, name, argv, fd_child_list, - atfork, atforkvalue); -#endif - } + return socketpair_connect (ctx, name, argv, fd_child_list, + atfork, atforkvalue); else +#endif return pipe_connect (ctx, name, argv, fd_child_list, atfork, atforkvalue, flags); } diff --git a/src/assuan-pipe-server.c b/src/assuan-pipe-server.c index db66978..03b754c 100644 --- a/src/assuan-pipe-server.c +++ b/src/assuan-pipe-server.c @@ -82,8 +82,11 @@ assuan_init_pipe_server (assuan_context_t ctx, assuan_fd_t filedes[2]) return TRACE_ERR (rc); #ifdef HAVE_W32_SYSTEM - infd = filedes[0]; - outfd = filedes[1]; + if (filedes) + { + infd = filedes[0]; + outfd = filedes[1]; + } #else s = getenv ("_assuan_connection_fd"); if (s && *s && is_valid_socket (s)) diff --git a/tests/Makefile.am b/tests/Makefile.am index cc13588..f61cec5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -29,7 +29,7 @@ TESTS = version if HAVE_W32_SYSTEM testtools = -TESTS += fdpassing-socket +TESTS += fdpassing else TESTS += pipeconnect testtools = socks5 diff --git a/tests/fdpassing.c b/tests/fdpassing.c index 0e23ffc..83ae62d 100644 --- a/tests/fdpassing.c +++ b/tests/fdpassing.c @@ -25,10 +25,8 @@ #include <string.h> #include <assert.h> #include <sys/stat.h> -#include <sys/socket.h> #include <unistd.h> #include <errno.h> -#include <sys/wait.h> /* Used by main driver. */ #include "../src/assuan.h" #include "common.h" @@ -292,7 +290,7 @@ main (int argc, char **argv) if (err) log_fatal ("assuan_new failed: %s\n", gpg_strerror (err)); - err = assuan_pipe_connect (ctx, with_exec? "./fdpassing":NULL, + err = assuan_pipe_connect (ctx, with_exec? "./fdpassing.exe":NULL, with_exec ? arglist : &loc, no_close_fds, NULL, NULL, 1); if (err) |