Home GnuPG

Import spawn functions from GnuPG master.

Description

Import spawn functions from GnuPG master.

* src/gpg-error.h.in (@define:gpgrt_process_t@): Remove.
(@define:struct_spawn_cb_arg@): New.
(enum gpgrt_process_requests): New.
(GPGRT_PROCESS_DETACHED, GPGRT_PROCESS_STDIN_PIPE)
(GPGRT_PROCESS_STDOUT_PIPE, GPGRT_PROCESS_STDERR_PIPE)
(GPGRT_PROCESS_STDINOUT_SOCKETPAIR, GPGRT_PROCESS_STDIN_KEEP)
(GPGRT_PROCESS_STDOUT_KEEP, GPGRT_PROCESS_STDERR_KEEP)
(GPGRT_PROCESS_STDFDS_SETTING, GPGRT_PROCESS_STREAM_NONBLOCK):
New.
* src/gpgrt-int.h (_gpgrt_process_spawn, _gpgrt_process_terminate)
(_gpgrt_process_get_fds, _gpgrt_process_get_streams)
(_gpgrt_process_ctl, _gpgrt_process_wait, _gpgrt_process_release)
(_gpgrt_process_wait_list, _gpgrt_spawn_helper): New.
* src/mkheader.c: Emit definition of struct_spawn_cb_arg.
* src/spawn-posix.c (_gpgrt_process_spawn, _gpgrt_process_terminate)
(_gpgrt_process_get_fds, _gpgrt_process_get_streams)
(_gpgrt_process_ctl, _gpgrt_process_wait, _gpgrt_process_release)
(_gpgrt_process_wait_list, _gpgrt_spawn_helper): New.
* src/spawn-w32.c: Ditto.
  • GnuPG-bug-id: T6249
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Auditors
werner
Provenance
gniibeAuthored on May 28 2024, 3:30 AM
Parents
rEa5f0e0b2f789: argparse: Fix a theoretical memory leak.
Branches
Unknown
Tags
Unknown
Tasks
T6249: gpgrt: spawn functions

Event Timeline

werner added a subscriber: werner.
werner added inline comments.
/src/spawn-posix.c
346

This is gnupg specific but often a good idea. Either we should have a way to disable it or let the caller do the check becore calling a spawn function.

This commit now has outstanding concerns.May 28 2024, 9:00 AM
werner added inline comments.
/src/spawn-posix.c
346

Fixed with the introduction of the GPGRT_PROCESS_NO_EUID_CHECK
rEbdd1060 .

All concerns with this commit have now been addressed.Jun 19 2024, 10:41 AM