Home GnuPG
Diffusion GnuPG f5656ff363a0

kbx: Fix datastream_thread and use the data pipe.

Description

kbx: Fix datastream_thread and use the data pipe.

* g10/call-keyboxd.c (gpg_keyboxd_deinit_session_data): Release
the assuan connection before kbx_client_data_release.
(open_context): Enable use of the data pipe.
* sm/keydb.c (gpgsm_keydb_deinit_session_data): Release the
assuan connection before kbx_client_data_release.
(open_context): Enable use of the data pipe.
* kbx/kbx-client-util.c (struct kbx_client_data_s): Add THD field.
(prepare_data_pipe): Close the pipe output end as it's been sent
already.  Remember the KCD->THD, so that it can be joined later.
(datastream_thread): Finish when reading no data from the pipe.
(kbx_client_data_release): Join the thread.  Then, we can safely
call es_fclose on the FP.
  • GnuPG-bug-id: T6512
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Jun 7 2023, 8:26 AM
Parents
rG9433dfa5dd4b: common: Add test case for IPC with spawned process.
Branches
Unknown
Tags
Unknown
Tasks
T6512: keyboxd with data pipe