1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

common: On Windows, we care about how PIPE handles are inherited.

* agent/gpg-agent.c (handle_connections): It's for POSIX.
* kbx/keyboxd.c (handle_connections): Ditto.
* scd/app.c (handle_connections): Ditto.
* scd/scdaemon.c (handle_connections): Ditto.
tpm2d/tpm2daemon.c (handle_connections): Ditto.
* tests/gpgscm/ffi.c (do_pipe): Use GNUPG_PIPE_BOTH.
(do_inbound_pipe): Use GNUPG_PIPE_INBOUND.
(do_outbound_pipe): Use GNUPG_PIPE_OUTBOUND.
* common/call-gpg.c (_gpg_encrypt): Specify outbound and inbound.
(_gpg_decrypt): Likewise.
* common/exechelp-posix.c (gnupg_create_pipe): Add an argument.
* common/exechelp-w32.c (create_pipe_and_estream): Care about
how PIPE handles are inherited to child process.
(gnupg_create_pipe): Add an argument.
* common/exechelp.h: Add enum values.

--

Fixes-commit: af6c47b291
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-07-09 15:15:13 +09:00
parent 1d5cfa9b7f
commit 2b19474aab
No known key found for this signature in database
GPG key ID: 640114AF89DE6054
10 changed files with 54 additions and 27 deletions

View file

@ -65,11 +65,17 @@ gpg_error_t gnupg_create_inbound_pipe (gnupg_fd_t *r_fd,
gpg_error_t gnupg_create_outbound_pipe (gnupg_fd_t *r_fd,
estream_t *r_fp, int nonblock);
/* Portable function to create a pipe. Under Windows both ends are
inheritable. */
gpg_error_t gnupg_create_pipe (int filedes[2]);
enum {
GNUPG_PIPE_DONTCARE=0,
GNUPG_PIPE_INBOUND=1,
GNUPG_PIPE_OUTBOUND=2,
GNUPG_PIPE_BOTH=3
};
/* Close the end of a pipe. */
void gnupg_close_pipe (int fd);
/* Portable function to create a pipe. FLAGS=GNUPG_PIPE_INBOUND for
ihneritable write-end for Windows, GNUPG_PIPE_OUTBOUND for
inheritable read-end for Windows, GNUPG_PIPE_BOTH to specify
both ends may be inheritable. */
gpg_error_t gnupg_create_pipe (int filedes[2], int flags);
#endif /*GNUPG_COMMON_EXECHELP_H*/