mirror of
git://git.gnupg.org/gnupg.git
synced 2024-06-20 01:02:44 +02:00
common: Rename sh-exectool to exectool.
* common/sh-exectool.c: Rename to exectool.c. * common/sh-exectool.h: Rename to exectool.h. * common/Makefile.am (common_sources): Adjust for rename. * common/exectool.c (sh_exec_tool_stream): Rename to gnupg_exec-tool-stream. (sh_exec_tool): Rename to gnupg_exec_tool. * tools/gpgtar-create.c (gpgtar_create): Adjust for changes. * tools/gpgtar-extract.c: Adjust for changes. * tools/gpgtar-list.c: Adjust for changes. -- The "sh-" presifx is used by g13 for system helpers which are used by processes created via userv. A generic function in common/ should also have a generic name. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
f5aa51aaac
commit
d80e1bc430
|
@ -88,7 +88,7 @@ common_sources = \
|
||||||
mkdir_p.c mkdir_p.h \
|
mkdir_p.c mkdir_p.h \
|
||||||
strlist.c strlist.h \
|
strlist.c strlist.h \
|
||||||
call-gpg.c call-gpg.h \
|
call-gpg.c call-gpg.h \
|
||||||
sh-exectool.c sh-exectool.h
|
exectool.c exectool.h
|
||||||
|
|
||||||
if HAVE_W32_SYSTEM
|
if HAVE_W32_SYSTEM
|
||||||
common_sources += w32-reg.c w32-afunix.c w32-afunix.h
|
common_sources += w32-reg.c w32-afunix.c w32-afunix.h
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* sh-exectool.c - Utility functions to execute a helper tool
|
/* exectool.c - Utility functions to execute a helper tool
|
||||||
* Copyright (C) 2015 Werner Koch
|
* Copyright (C) 2015 Werner Koch
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
|
@ -216,7 +216,7 @@ copy_buffer_flush (struct copy_buffer *c, estream_t sink)
|
||||||
the process' stdout is written to OUTPUT. On error a diagnostic is
|
the process' stdout is written to OUTPUT. On error a diagnostic is
|
||||||
printed, and an error code returned. */
|
printed, and an error code returned. */
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
sh_exec_tool_stream (const char *pgmname, const char *argv[],
|
gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
|
||||||
estream_t input,
|
estream_t input,
|
||||||
estream_t output)
|
estream_t output)
|
||||||
{
|
{
|
||||||
|
@ -256,7 +256,7 @@ sh_exec_tool_stream (const char *pgmname, const char *argv[],
|
||||||
fds[2].want_read = 1;
|
fds[2].want_read = 1;
|
||||||
/* Now read as long as we have something to poll. We continue
|
/* Now read as long as we have something to poll. We continue
|
||||||
reading even after EOF or error on stdout so that we get the
|
reading even after EOF or error on stdout so that we get the
|
||||||
other error messages or remaining outout. */
|
other error messages or remaining outut. */
|
||||||
while (!fds[1].ignore && !fds[2].ignore)
|
while (!fds[1].ignore && !fds[2].ignore)
|
||||||
{
|
{
|
||||||
count = es_poll (fds, DIM(fds), -1);
|
count = es_poll (fds, DIM(fds), -1);
|
||||||
|
@ -361,7 +361,7 @@ nop_free (void *ptr)
|
||||||
stored at RESULT, a diagnostic is printed, and an error code
|
stored at RESULT, a diagnostic is printed, and an error code
|
||||||
returned. */
|
returned. */
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
sh_exec_tool (const char *pgmname, const char *argv[],
|
gnupg_exec_tool (const char *pgmname, const char *argv[],
|
||||||
const char *input_string,
|
const char *input_string,
|
||||||
char **result, size_t *resultlen)
|
char **result, size_t *resultlen)
|
||||||
{
|
{
|
||||||
|
@ -391,7 +391,7 @@ sh_exec_tool (const char *pgmname, const char *argv[],
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = sh_exec_tool_stream (pgmname, argv, input, output);
|
err = gnupg_exec_tool_stream (pgmname, argv, input, output);
|
||||||
if (err)
|
if (err)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GNUPG_COMMON_SH_EXECTOOL_H
|
#ifndef GNUPG_COMMON_EXECTOOL_H
|
||||||
#define GNUPG_COMMON_SH_EXECTOOL_H
|
#define GNUPG_COMMON_EXECTOOL_H
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
NULL. A hidden Nul is appended to the output. On error NULL is
|
NULL. A hidden Nul is appended to the output. On error NULL is
|
||||||
stored at RESULT, a diagnostic is printed, and an error code
|
stored at RESULT, a diagnostic is printed, and an error code
|
||||||
returned. */
|
returned. */
|
||||||
gpg_error_t sh_exec_tool (const char *pgmname, const char *argv[],
|
gpg_error_t gnupg_exec_tool (const char *pgmname, const char *argv[],
|
||||||
const char *input_string,
|
const char *input_string,
|
||||||
char **result, size_t *resultlen);
|
char **result, size_t *resultlen);
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ gpg_error_t sh_exec_tool (const char *pgmname, const char *argv[],
|
||||||
fed to stdin of the process. stderr is logged using log_info and
|
fed to stdin of the process. stderr is logged using log_info and
|
||||||
the process' stdout is written to OUTPUT. On error a diagnostic is
|
the process' stdout is written to OUTPUT. On error a diagnostic is
|
||||||
printed, and an error code returned. */
|
printed, and an error code returned. */
|
||||||
gpg_error_t sh_exec_tool_stream (const char *pgmname, const char *argv[],
|
gpg_error_t gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
|
||||||
estream_t input,
|
estream_t input,
|
||||||
estream_t output);
|
estream_t output);
|
||||||
|
|
||||||
#endif /* GNUPG_COMMON_SH_EXECTOOL_H */
|
#endif /* GNUPG_COMMON_EXECTOOL_H */
|
|
@ -36,7 +36,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "../common/sh-exectool.h"
|
#include "../common/exectool.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "gpgtar.h"
|
#include "gpgtar.h"
|
||||||
|
|
||||||
|
@ -937,7 +937,7 @@ gpgtar_create (char **inpattern, int encrypt, int sign)
|
||||||
+ 1 + !!encrypt + !!sign + 2 * !!opt.user
|
+ 1 + !!encrypt + !!sign + 2 * !!opt.user
|
||||||
+ !!opt.symmetric);
|
+ !!opt.symmetric);
|
||||||
|
|
||||||
err = sh_exec_tool_stream (opt.gpg_program, argv,
|
err = gnupg_exec_tool_stream (opt.gpg_program, argv,
|
||||||
outstream, cipher_stream);
|
outstream, cipher_stream);
|
||||||
xfree (argv);
|
xfree (argv);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "../common/sh-exectool.h"
|
#include "../common/exectool.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "gpgtar.h"
|
#include "gpgtar.h"
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
||||||
argv[i++] = NULL;
|
argv[i++] = NULL;
|
||||||
assert (i == strlist_length (opt.gpg_arguments) + 2);
|
assert (i == strlist_length (opt.gpg_arguments) + 2);
|
||||||
|
|
||||||
err = sh_exec_tool_stream (opt.gpg_program, argv,
|
err = gnupg_exec_tool_stream (opt.gpg_program, argv,
|
||||||
cipher_stream, stream);
|
cipher_stream, stream);
|
||||||
xfree (argv);
|
xfree (argv);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "gpgtar.h"
|
#include "gpgtar.h"
|
||||||
#include "../common/sh-exectool.h"
|
#include "../common/exectool.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ gpgtar_list (const char *filename, int decrypt)
|
||||||
argv[i++] = NULL;
|
argv[i++] = NULL;
|
||||||
assert (i == strlist_length (opt.gpg_arguments) + 2);
|
assert (i == strlist_length (opt.gpg_arguments) + 2);
|
||||||
|
|
||||||
err = sh_exec_tool_stream (opt.gpg_program, argv,
|
err = gnupg_exec_tool_stream (opt.gpg_program, argv,
|
||||||
cipher_stream, stream);
|
cipher_stream, stream);
|
||||||
xfree (argv);
|
xfree (argv);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user