From 44a32455c8e41400ea96db4507c8a42bdb65b3b6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 27 May 2016 22:48:04 +0200 Subject: common: Allow a second input stream for gnupg_exec_tool_stream. * common/exechelp-posix.c (do_exec): Add arg 'except' and pass to close_all_fds. (gnupg_spawn_process): Add arg 'except'. Change callers to pass NULL for it. * common/exechelp-w32.c (gnupg_spawn_process): Add dummy arg 'except'. * common/exechelp-w32ce.c (gnupg_spawn_process): Ditto. * common/exectool.c (copy_buffer_do_copy): Allow NULL for SINK. (gnupg_exec_tool_stream): Add arg 'inextra'. Change callers to pass NULL for it. Allow NULL for OUTPUT. -- This hack is a first step to allow calling gpg for verification of signatures. Signed-off-by: Werner Koch --- common/exechelp.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common/exechelp.h') diff --git a/common/exechelp.h b/common/exechelp.h index d6ef5f062..c43cd25f1 100644 --- a/common/exechelp.h +++ b/common/exechelp.h @@ -90,6 +90,10 @@ gpg_error_t gnupg_create_pipe (int filedes[2]); If PREEXEC is not NULL, the given function will be called right before the exec. + IF EXCEPT is not NULL, it is expected to be an ordered list of file + descriptors, terminated by an entry with the value (-1). These + file descriptors won't be closed before spawning a new program. + Returns 0 on success or an error code. Calling gnupg_wait_process and gnupg_release_process is required if the function succeeded. @@ -116,7 +120,7 @@ gpg_error_t gnupg_create_pipe (int filedes[2]); */ gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[], - void (*preexec)(void), unsigned int flags, + int *execpt, void (*preexec)(void), unsigned int flags, estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp, -- cgit v1.2.3