diff options
author | Werner Koch <[email protected]> | 2023-01-18 09:42:53 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-01-18 09:42:53 +0000 |
commit | f79d9b9310cf9e6c33b42d91aa11ceb51df3135e (patch) | |
tree | 664e95dfdcac228e2f8f88f7820221b0cb6d5585 /tools/gpgtar-create.c | |
parent | sm: Fix compliance checking for ECC signature verification. (diff) | |
download | gnupg-f79d9b9310cf9e6c33b42d91aa11ceb51df3135e.tar.gz gnupg-f79d9b9310cf9e6c33b42d91aa11ceb51df3135e.zip |
gpgtar: Make --status-fd option for fds > 2 work
* tools/gpgtar-create.c (gpgtar_create): Do not close the status_fd in
spawn.
* tools/gpgtar-extract.c (gpgtar_extract): Ditto.
* tools/gpgtar-list.c (gpgtar_list): Ditto.
--
Note that this fix does not handle file descripotors passed via the
--gpg-args options.
GnuPG-bug-id: 6348
Diffstat (limited to 'tools/gpgtar-create.c')
-rw-r--r-- | tools/gpgtar-create.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/gpgtar-create.c b/tools/gpgtar-create.c index 3a7687d9f..f52295b5c 100644 --- a/tools/gpgtar-create.c +++ b/tools/gpgtar-create.c @@ -1141,6 +1141,7 @@ gpgtar_create (char **inpattern, const char *files_from, int null_names, { strlist_t arg; ccparray_t ccp; + int except[2] = { -1, -1 }; const char **argv; /* '--encrypt' may be combined with '--symmetric', but 'encrypt' @@ -1164,6 +1165,7 @@ gpgtar_create (char **inpattern, const char *files_from, int null_names, snprintf (tmpbuf, sizeof tmpbuf, "--status-fd=%d", opt.status_fd); ccparray_put (&ccp, tmpbuf); + except[0] = opt.status_fd; } ccparray_put (&ccp, "--output"); @@ -1195,7 +1197,8 @@ gpgtar_create (char **inpattern, const char *files_from, int null_names, goto leave; } - err = gnupg_spawn_process (opt.gpg_program, argv, NULL, + err = gnupg_spawn_process (opt.gpg_program, argv, + except[0] == -1? NULL : except, (GNUPG_SPAWN_KEEP_STDOUT | GNUPG_SPAWN_KEEP_STDERR), &outstream, NULL, NULL, &pid); |