[git] GnuPG - branch, master, updated. gnupg-2.1.18-143-g8a67dc4
by Werner Koch
cvs at cvs.gnupg.org
Tue Feb 28 09:44:23 CET 2017
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 "The GNU Privacy Guard".
The branch, master has been updated
via 8a67dc4c4324b617b5a3fea51c59c674488544d6 (commit)
via 1192449207f41b26be8950b04df84a52c8a2a886 (commit)
from f5782e11a560fd590221042391254c810a42e45f (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 8a67dc4c4324b617b5a3fea51c59c674488544d6
Author: Werner Koch <wk at gnupg.org>
Date: Tue Feb 28 09:35:41 2017 +0100
gpgv,w32: Fix --status-fd.
* g10/gpgv.c (main): Use translate_sys2libc_fd_int for --status-fd.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/g10/gpgv.c b/g10/gpgv.c
index ab6f530..ef8d9e0 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -225,7 +225,9 @@ main( int argc, char **argv )
break;
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
case oOutput: opt.outfile = pargs.r.ret_str; break;
- case oStatusFD: set_status_fd( pargs.r.ret_int ); break;
+ case oStatusFD:
+ set_status_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
+ break;
case oLoggerFD:
log_set_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
break;
commit 1192449207f41b26be8950b04df84a52c8a2a886
Author: Werner Koch <wk at gnupg.org>
Date: Tue Feb 28 09:34:29 2017 +0100
w32: Make pipes really pollable.
* common/exectool.c (gnupg_exec_tool_stream) [W32]: Use _get_osfhandle
to print the fd for the command line.
* common/exechelp-w32.c (create_pipe_and_estream): Use es_sysopen so
that the streams are actually pollable.
--
This addresses two bugs:
- Using the "-&@INEXTRA@" kludges requires that we pass the value of
the handle on the command line and not the libc fd.
- gpgrt_poll requires the use of the ReadFile/WriteFile backend which
is currently only used when the stream has been created with
gpgrt_sysopen.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index e79ee5b..2c44e2c 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -309,6 +309,7 @@ create_pipe_and_estream (int filedes[2], int flags,
{
gpg_error_t err = 0;
HANDLE fds[2];
+ es_syshd_t syshd;
filedes[0] = filedes[1] = -1;
err = my_error (GPG_ERR_GENERAL);
@@ -337,10 +338,17 @@ create_pipe_and_estream (int filedes[2], int flags,
if (! err && r_fp)
{
+ syshd.type = ES_SYSHD_HANDLE;
if (!outbound)
- *r_fp = es_fdopen (filedes[0], nonblock? "r,nonblock" : "r");
+ {
+ syshd.u.handle = fds[0];
+ *r_fp = es_sysopen (&syshd, nonblock? "r,nonblock" : "r");
+ }
else
- *r_fp = es_fdopen (filedes[1], nonblock? "w,nonblock" : "w");
+ {
+ syshd.u.handle = fds[1];
+ *r_fp = es_sysopen (&syshd, nonblock? "w,nonblock" : "w");
+ }
if (!*r_fp)
{
err = my_error_from_syserror ();
diff --git a/common/exectool.c b/common/exectool.c
index ed8225a..c9e0020 100644
--- a/common/exectool.c
+++ b/common/exectool.c
@@ -384,7 +384,12 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
/* Now find the argument marker and replace by the pipe's fd.
Yeah, that is an ugly non-thread safe hack but it safes us to
create a copy of the array. */
+#ifdef HAVE_W32_SYSTEM
+ snprintf (extrafdbuf, sizeof extrafdbuf, "-&%lu",
+ (unsigned long)(void*)_get_osfhandle (extrapipe[0]));
+#else
snprintf (extrafdbuf, sizeof extrafdbuf, "-&%d", extrapipe[0]);
+#endif
for (argsaveidx=0; argv[argsaveidx]; argsaveidx++)
if (!strcmp (argv[argsaveidx], "-&@INEXTRA@"))
{
-----------------------------------------------------------------------
Summary of changes:
common/exechelp-w32.c | 12 ++++++++++--
common/exectool.c | 5 +++++
g10/gpgv.c | 4 +++-
3 files changed, 18 insertions(+), 3 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list