mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Use gpgrt_process_spawn API from libgpg-error.
* agent/genkey.c (do_check_passphrase_pattern): Use the gpgrt API. * common/asshelp.c (start_new_service): Ditto. * common/exechelp.h: Remove gnupg_process_spawn API. * common/exechelp-posix.c: Remove gnupg_process_spawn implementation. * common/exechelp-w32.c: Likewise. * common/exectool.c (gnupg_exec_tool_stream): Use the gpgrt API. * common/t-exechelp.c (test_pipe_stream): Remove. * dirmngr/ldap-wrapper.c (destroy_wrapper, ldap_reaper_thread): Use the gpgrt API. (ldap_wrapper_connection_cleanup, ldap_wrapper): Ditto. * dirmngr/ldap.c, g10/call-keyboxd.c: No need to include exechelp.h. * g10/photoid.c (run_with_pipe, show_photo): Use the gpgrt API. * g13/be-encfs.c (run_umount_helper, run_encfs_tool): Ditto. * g13/g13.c, g13/mount.c, g13/runner.c: No need to include exechelp.h. * scd/apdu.c: No need to include exechelp.h. * scd/app.c (report_change): Use the gpgrt API. * sm/export.c, sm/import.c: No need to include exechelp.h. * tests/gpgscm/ffi.c (proc_object_finalize, proc_wrap) (do_process_spawn_io, do_process_spawn_fd, do_process_wait): Use the gpgrt API. * tools/gpg-auth.c: No need to include exechelp.h. * tools/gpg-card.c (cmd_gpg): Use the gpgrt API. * tools/gpg-connect-agent.c: No need to include exechelp.h. * tools/gpg-mail-tube.c (mail_tube_encrypt, prepare_for_appimage) (start_gpg_encrypt): Use the gpgrt API. * tools/gpgconf-comp.c (gpg_agent_runtime_change) (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Ditto. * tools/gpgconf.c (show_versions_via_dirmngr): Ditto. * tools/gpgtar-create.c (gpgtar_create): Ditto. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. -- GnuPG-bug-id: 7192 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
c333e9dad6
commit
953dd67368
29 changed files with 204 additions and 2092 deletions
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "../common/i18n.h"
|
||||
#include <gpg-error.h>
|
||||
#include "../common/exechelp.h"
|
||||
#include "../common/sysutils.h"
|
||||
#include "../common/ccparray.h"
|
||||
#include "gpgtar.h"
|
||||
|
@ -339,7 +338,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
|||
char *dirname = NULL;
|
||||
struct tarinfo_s tarinfo_buffer;
|
||||
tarinfo_t tarinfo = &tarinfo_buffer;
|
||||
gnupg_process_t proc;
|
||||
gpgrt_process_t proc;
|
||||
char *logfilename = NULL;
|
||||
unsigned long long notextracted;
|
||||
|
||||
|
@ -390,7 +389,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
|||
int except[2] = { -1, -1 };
|
||||
#endif
|
||||
const char **argv;
|
||||
gnupg_spawn_actions_t act = NULL;
|
||||
gpgrt_spawn_actions_t act = NULL;
|
||||
|
||||
ccparray_init (&ccp, 0);
|
||||
if (opt.batch)
|
||||
|
@ -436,7 +435,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
err = gnupg_spawn_actions_new (&act);
|
||||
err = gpgrt_spawn_actions_new (&act);
|
||||
if (err)
|
||||
{
|
||||
xfree (argv);
|
||||
|
@ -444,18 +443,18 @@ gpgtar_extract (const char *filename, int decrypt)
|
|||
}
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
gnupg_spawn_actions_set_inherit_handles (act, except);
|
||||
gpgrt_spawn_actions_set_inherit_handles (act, except);
|
||||
#else
|
||||
gnupg_spawn_actions_set_inherit_fds (act, except);
|
||||
gpgrt_spawn_actions_set_inherit_fds (act, except);
|
||||
#endif
|
||||
err = gnupg_process_spawn (opt.gpg_program, argv,
|
||||
((filename ? 0 : GNUPG_PROCESS_STDIN_KEEP)
|
||||
| GNUPG_PROCESS_STDOUT_PIPE), act, &proc);
|
||||
gnupg_spawn_actions_release (act);
|
||||
err = gpgrt_process_spawn (opt.gpg_program, argv,
|
||||
((filename ? 0 : GPGRT_PROCESS_STDIN_KEEP)
|
||||
| GPGRT_PROCESS_STDOUT_PIPE), act, &proc);
|
||||
gpgrt_spawn_actions_release (act);
|
||||
xfree (argv);
|
||||
if (err)
|
||||
goto leave;
|
||||
gnupg_process_get_streams (proc, 0, NULL, &stream, NULL);
|
||||
gpgrt_process_get_streams (proc, 0, NULL, &stream, NULL);
|
||||
es_set_binary (stream);
|
||||
}
|
||||
else if (filename)
|
||||
|
@ -502,17 +501,17 @@ gpgtar_extract (const char *filename, int decrypt)
|
|||
if (err)
|
||||
log_error ("error closing pipe: %s\n", gpg_strerror (err));
|
||||
|
||||
err = gnupg_process_wait (proc, 1);
|
||||
err = gpgrt_process_wait (proc, 1);
|
||||
if (!err)
|
||||
{
|
||||
int exitcode;
|
||||
|
||||
gnupg_process_ctl (proc, GNUPG_PROCESS_GET_EXIT_ID, &exitcode);
|
||||
gpgrt_process_ctl (proc, GPGRT_PROCESS_GET_EXIT_ID, &exitcode);
|
||||
if (exitcode)
|
||||
log_error ("running %s failed (exitcode=%d): %s",
|
||||
opt.gpg_program, exitcode, gpg_strerror (err));
|
||||
}
|
||||
gnupg_process_release (proc);
|
||||
gpgrt_process_release (proc);
|
||||
proc = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue