mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Use gpgrt's new option parser to provide a global conf file.
* common/util.h: Remove argparse.h. * common/argparse.c: Undef GPGRT_ENABLE_ARGPARSE_MACROS. * configure.ac (GPGRT_ENABLE_ARGPARSE_MACROS): Define. * agent/gpg-agent.c: Undef GPGRT_ENABLE_ARGPARSE_MACROS and include argparse.h. Do this also for all main modules which use our option parser except for gpg. Replace calls to strusage by calls to gpgrt_strusage everywhere. * g10/gpg.c (opts): Change type to gpgrt_opt_t. Flag oOptions and oNoOptions with ARGPARSE_conffile and ARGPARSE_no_conffile. (main): Change type of pargs to gpgrt_argparse_t. Rework the option parser to make use of the new gpgrt_argparser. -- This is not yet finished but a make check works. gpg has the most complex and oldest option handling and thus this is the first migration target. SE-Linux checks and version-ed config files are missing and will be added later. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
ccdf988b40
commit
0e8f6e2aa9
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -52,6 +55,7 @@
|
|||||||
#define GNUPG_COMMON_NEED_AFLOCAL
|
#define GNUPG_COMMON_NEED_AFLOCAL
|
||||||
#include "agent.h"
|
#include "agent.h"
|
||||||
#include <assuan.h> /* Malloc hooks and socket wrappers. */
|
#include <assuan.h> /* Malloc hooks and socket wrappers. */
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -49,6 +52,7 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -43,6 +46,7 @@
|
|||||||
#include "../common/get-passphrase.h"
|
#include "../common/get-passphrase.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -62,7 +62,6 @@
|
|||||||
|
|
||||||
/* Get all the stuff from jnlib. */
|
/* Get all the stuff from jnlib. */
|
||||||
#include "../common/logging.h"
|
#include "../common/logging.h"
|
||||||
#include "../common/argparse.h"
|
|
||||||
#include "../common/stringhelp.h"
|
#include "../common/stringhelp.h"
|
||||||
#include "../common/mischelp.h"
|
#include "../common/mischelp.h"
|
||||||
#include "../common/strlist.h"
|
#include "../common/strlist.h"
|
||||||
|
@ -522,7 +522,7 @@ AH_BOTTOM([
|
|||||||
#define GNUPG_CACHE_DIR "cache.d"
|
#define GNUPG_CACHE_DIR "cache.d"
|
||||||
|
|
||||||
#define GNUPG_DEF_COPYRIGHT_LINE \
|
#define GNUPG_DEF_COPYRIGHT_LINE \
|
||||||
"Copyright (C) 2018 Free Software Foundation, Inc."
|
"Copyright (C) 2020 Free Software Foundation, Inc."
|
||||||
|
|
||||||
/* For some systems (DOS currently), we hardcode the path here. For
|
/* For some systems (DOS currently), we hardcode the path here. For
|
||||||
POSIX systems the values are constructed by the Makefiles, so that
|
POSIX systems the values are constructed by the Makefiles, so that
|
||||||
@ -580,6 +580,9 @@ AH_BOTTOM([
|
|||||||
/* Enable the log_ macros from gpgrt. */
|
/* Enable the log_ macros from gpgrt. */
|
||||||
#define GPGRT_ENABLE_LOG_MACROS 1
|
#define GPGRT_ENABLE_LOG_MACROS 1
|
||||||
|
|
||||||
|
/* We want the argparse macros from gpgrt. */
|
||||||
|
#define GPGRT_ENABLE_ARGPARSE_MACROS 1
|
||||||
|
|
||||||
/* Tell libgcrypt not to use its own libgpg-error implementation. */
|
/* Tell libgcrypt not to use its own libgpg-error implementation. */
|
||||||
#define USE_LIBGPG_ERROR 1
|
#define USE_LIBGPG_ERROR 1
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -41,6 +44,7 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
/* Constants for the options. */
|
/* Constants for the options. */
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -76,6 +79,7 @@
|
|||||||
#include "../common/gc-opt-flags.h"
|
#include "../common/gc-opt-flags.h"
|
||||||
#include "dns-stuff.h"
|
#include "dns-stuff.h"
|
||||||
#include "http-common.h"
|
#include "http-common.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#ifndef ENAMETOOLONG
|
#ifndef ENAMETOOLONG
|
||||||
# define ENAMETOOLONG EINVAL
|
# define ENAMETOOLONG EINVAL
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -55,6 +58,7 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
/* There is no need for the npth_unprotect and leave functions here;
|
/* There is no need for the npth_unprotect and leave functions here;
|
||||||
* thus we redefine them to nops. We keep them in the code just for
|
* thus we redefine them to nops. We keep them in the code just for
|
||||||
|
@ -222,7 +222,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, mode, &serverversion);
|
err = get_assuan_server_version (ctx, mode, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -146,7 +146,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, 0, &serverversion);
|
err = get_assuan_server_version (ctx, 0, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -144,7 +144,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, 0, &serverversion);
|
err = get_assuan_server_version (ctx, 0, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
321
g10/gpg.c
321
g10/gpg.c
@ -1,7 +1,7 @@
|
|||||||
/* gpg.c - The GnuPG utility (main for gpg)
|
/* gpg.c - The GnuPG OpenPGP tool
|
||||||
* Copyright (C) 1998-2011 Free Software Foundation, Inc.
|
* Copyright (C) 1998-2020 Free Software Foundation, Inc.
|
||||||
* Copyright (C) 1997-2017 Werner Koch
|
* Copyright (C) 1997-2019 Werner Koch
|
||||||
* Copyright (C) 2015-2017 g10 Code GmbH
|
* Copyright (C) 2015-2020 g10 Code GmbH
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -17,6 +17,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -437,7 +438,7 @@ enum cmd_and_opt_values
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
|
|
||||||
ARGPARSE_group (300, N_("@Commands:\n ")),
|
ARGPARSE_group (300, N_("@Commands:\n ")),
|
||||||
|
|
||||||
@ -638,7 +639,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
|
|
||||||
ARGPARSE_s_s (oDisplayCharset, "display-charset", "@"),
|
ARGPARSE_s_s (oDisplayCharset, "display-charset", "@"),
|
||||||
ARGPARSE_s_s (oDisplayCharset, "charset", "@"),
|
ARGPARSE_s_s (oDisplayCharset, "charset", "@"),
|
||||||
ARGPARSE_s_s (oOptions, "options", "@"),
|
ARGPARSE_conffile (oOptions, "options", "@"),
|
||||||
|
|
||||||
ARGPARSE_s_s (oDebug, "debug", "@"),
|
ARGPARSE_s_s (oDebug, "debug", "@"),
|
||||||
ARGPARSE_s_s (oDebugLevel, "debug-level", "@"),
|
ARGPARSE_s_s (oDebugLevel, "debug-level", "@"),
|
||||||
@ -744,7 +745,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
ARGPARSE_s_n (oNoDefKeyring, "no-default-keyring", "@"),
|
ARGPARSE_s_n (oNoDefKeyring, "no-default-keyring", "@"),
|
||||||
ARGPARSE_s_n (oNoKeyring, "no-keyring", "@"),
|
ARGPARSE_s_n (oNoKeyring, "no-keyring", "@"),
|
||||||
ARGPARSE_s_n (oNoGreeting, "no-greeting", "@"),
|
ARGPARSE_s_n (oNoGreeting, "no-greeting", "@"),
|
||||||
ARGPARSE_s_n (oNoOptions, "no-options", "@"),
|
ARGPARSE_noconffile (oNoOptions, "no-options", "@"),
|
||||||
ARGPARSE_s_s (oHomedir, "homedir", "@"),
|
ARGPARSE_s_s (oHomedir, "homedir", "@"),
|
||||||
ARGPARSE_s_n (oNoBatch, "no-batch", "@"),
|
ARGPARSE_s_n (oNoBatch, "no-batch", "@"),
|
||||||
ARGPARSE_s_n (oWithColons, "with-colons", "@"),
|
ARGPARSE_s_n (oWithColons, "with-colons", "@"),
|
||||||
@ -1082,10 +1083,13 @@ my_strusage( int level )
|
|||||||
static char *digests, *pubkeys, *ciphers, *zips, *aeads, *ver_gcry;
|
static char *digests, *pubkeys, *ciphers, *zips, *aeads, *ver_gcry;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
switch( level ) {
|
switch( level ) {
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "@GPG@ (@GNUPG@)";
|
case 11: p = "@GPG@ (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
|
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -2325,10 +2329,11 @@ get_default_configname (void)
|
|||||||
return configname;
|
return configname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
IOBUF a;
|
IOBUF a;
|
||||||
int rc=0;
|
int rc=0;
|
||||||
int orig_argc;
|
int orig_argc;
|
||||||
@ -2342,13 +2347,11 @@ main (int argc, char **argv)
|
|||||||
strlist_t nrings = NULL;
|
strlist_t nrings = NULL;
|
||||||
armor_filter_context_t *afx = NULL;
|
armor_filter_context_t *afx = NULL;
|
||||||
int detached_sig = 0;
|
int detached_sig = 0;
|
||||||
FILE *configfp = NULL;
|
char *last_configname = NULL;
|
||||||
char *configname = NULL;
|
const char *configname = NULL; /* NULL or points to last_configname.
|
||||||
char *save_configname = NULL;
|
* NULL also indicates that we are
|
||||||
char *default_configname = NULL;
|
* processing options from the cmdline. */
|
||||||
unsigned configlineno;
|
int debug_argparser = 0;
|
||||||
int parse_debug = 0;
|
|
||||||
int default_config = 1;
|
|
||||||
int default_keyring = 1;
|
int default_keyring = 1;
|
||||||
int greeting = 0;
|
int greeting = 0;
|
||||||
int nogreeting = 0;
|
int nogreeting = 0;
|
||||||
@ -2398,7 +2401,7 @@ main (int argc, char **argv)
|
|||||||
gnupg_reopen_std (GPG_NAME);
|
gnupg_reopen_std (GPG_NAME);
|
||||||
trap_unaligned ();
|
trap_unaligned ();
|
||||||
gnupg_rl_initialize ();
|
gnupg_rl_initialize ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||||
log_set_prefix (GPG_NAME, GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix (GPG_NAME, GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
@ -2477,43 +2480,47 @@ main (int argc, char **argv)
|
|||||||
opt.compliance = CO_GNUPG;
|
opt.compliance = CO_GNUPG;
|
||||||
opt.flags.rfc4880bis = 1;
|
opt.flags.rfc4880bis = 1;
|
||||||
|
|
||||||
/* Check whether we have a config file on the command line. */
|
/* Check special options given on the command line. */
|
||||||
orig_argc = argc;
|
orig_argc = argc;
|
||||||
orig_argv = argv;
|
orig_argv = argv;
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= (ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION);
|
pargs.flags= (ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION);
|
||||||
while( arg_parse( &pargs, opts) ) {
|
while (gpgrt_argparse (NULL, &pargs, opts))
|
||||||
if( pargs.r_opt == oDebug || pargs.r_opt == oDebugAll )
|
{
|
||||||
parse_debug++;
|
switch (pargs.r_opt)
|
||||||
else if (pargs.r_opt == oDebugIOLBF)
|
|
||||||
es_setvbuf (es_stdout, NULL, _IOLBF, 0);
|
|
||||||
else if( pargs.r_opt == oOptions ) {
|
|
||||||
/* yes there is one, so we do not try the default one, but
|
|
||||||
* read the option file when it is encountered at the commandline
|
|
||||||
*/
|
|
||||||
default_config = 0;
|
|
||||||
}
|
|
||||||
else if( pargs.r_opt == oNoOptions )
|
|
||||||
{
|
{
|
||||||
default_config = 0; /* --no-options */
|
case oDebug:
|
||||||
|
case oDebugAll:
|
||||||
|
debug_argparser++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case oDebugIOLBF:
|
||||||
|
es_setvbuf (es_stdout, NULL, _IOLBF, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case oNoOptions:
|
||||||
|
/* Set here here because the homedir would otherwise be
|
||||||
|
* created before main option parsing starts. */
|
||||||
opt.no_homedir_creation = 1;
|
opt.no_homedir_creation = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case oHomedir:
|
||||||
|
gnupg_set_homedir (pargs.r.ret_str);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case oNoPermissionWarn:
|
||||||
|
opt.no_perm_warn = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if( pargs.r_opt == oHomedir )
|
}
|
||||||
gnupg_set_homedir (pargs.r.ret_str);
|
/* Reset the flags. */
|
||||||
else if( pargs.r_opt == oNoPermissionWarn )
|
pargs.flags &= ~(ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION);
|
||||||
opt.no_perm_warn=1;
|
|
||||||
else if (pargs.r_opt == oStrict )
|
|
||||||
{
|
|
||||||
/* Not used */
|
|
||||||
}
|
|
||||||
else if (pargs.r_opt == oNoStrict )
|
|
||||||
{
|
|
||||||
/* Not used */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_DOSISH_SYSTEM
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
|
/* FIXME: Do we still need this? No: gnupg_homedir calls
|
||||||
|
* make_filename which changes the slashed anyway. IsDBCSLeadByte still
|
||||||
|
* needed? See bug #561. */
|
||||||
if ( strchr (gnupg_homedir (), '\\') ) {
|
if ( strchr (gnupg_homedir (), '\\') ) {
|
||||||
char *d, *buf = xmalloc (strlen (gnupg_homedir ())+1);
|
char *d, *buf = xmalloc (strlen (gnupg_homedir ())+1);
|
||||||
const char *s;
|
const char *s;
|
||||||
@ -2555,64 +2562,89 @@ main (int argc, char **argv)
|
|||||||
additional_weak_digest ("MD5");
|
additional_weak_digest ("MD5");
|
||||||
parse_auto_key_locate (DEFAULT_AKL_LIST);
|
parse_auto_key_locate (DEFAULT_AKL_LIST);
|
||||||
|
|
||||||
/* Try for a version specific config file first */
|
|
||||||
default_configname = get_default_configname ();
|
|
||||||
if (default_config)
|
|
||||||
configname = xstrdup (default_configname);
|
|
||||||
|
|
||||||
argc = orig_argc;
|
argc = orig_argc;
|
||||||
argv = orig_argv;
|
argv = orig_argv;
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= ARGPARSE_FLAG_KEEP;
|
/* We are re-using the struct, thus the reset flag. We OR the
|
||||||
|
* flags so that the internal intialized flag won't be cleared. */
|
||||||
|
pargs.flags |= (ARGPARSE_FLAG_RESET
|
||||||
|
| ARGPARSE_FLAG_KEEP
|
||||||
|
| ARGPARSE_FLAG_SYS
|
||||||
|
| ARGPARSE_FLAG_USER);
|
||||||
|
/* FIXME: Add an option to allow for version specific config files. */
|
||||||
|
|
||||||
/* By this point we have a homedir, and cannot change it. */
|
/* By this point we have a homedir, and cannot change it. */
|
||||||
check_permissions (gnupg_homedir (), 0);
|
check_permissions (gnupg_homedir (), 0);
|
||||||
|
|
||||||
next_pass:
|
/* The configuraton directories for use by gpgrt_argparser. */
|
||||||
if( configname ) {
|
gpgrt_set_confdir (GPGRT_CONFDIR_SYS, gnupg_sysconfdir ());
|
||||||
if(check_permissions(configname,1))
|
gpgrt_set_confdir (GPGRT_CONFDIR_USER, gnupg_homedir ());
|
||||||
{
|
|
||||||
/* If any options file is unsafe, then disable any external
|
|
||||||
programs for keyserver calls or photo IDs. Since the
|
|
||||||
external program to call is set in the options file, a
|
|
||||||
unsafe options file can lead to an arbitrary program
|
|
||||||
being run. */
|
|
||||||
|
|
||||||
opt.exec_disable=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
configlineno = 0;
|
/* if( configname ) { */
|
||||||
configfp = fopen( configname, "r" );
|
/* FIXME: Add callback to check config file permissions. */
|
||||||
if (configfp && is_secured_file (fileno (configfp)))
|
/* if(check_permissions(configname,1)) */
|
||||||
{
|
/* { */
|
||||||
fclose (configfp);
|
/* /\* If any options file is unsafe, then disable any external */
|
||||||
configfp = NULL;
|
/* programs for keyserver calls or photo IDs. Since the */
|
||||||
gpg_err_set_errno (EPERM);
|
/* external program to call is set in the options file, a */
|
||||||
}
|
/* unsafe options file can lead to an arbitrary program */
|
||||||
if( !configfp ) {
|
/* being run. *\/ */
|
||||||
if( default_config ) {
|
|
||||||
if( parse_debug )
|
|
||||||
log_info(_("Note: no default option file '%s'\n"),
|
|
||||||
configname );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
log_error(_("option file '%s': %s\n"),
|
|
||||||
configname, strerror(errno) );
|
|
||||||
g10_exit(2);
|
|
||||||
}
|
|
||||||
xfree(configname); configname = NULL;
|
|
||||||
}
|
|
||||||
if( parse_debug && configname )
|
|
||||||
log_info(_("reading options from '%s'\n"), configname );
|
|
||||||
default_config = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while( optfile_parse( configfp, configname, &configlineno,
|
/* opt.exec_disable=1; */
|
||||||
&pargs, opts) )
|
/* } */
|
||||||
|
|
||||||
|
/* configlineno = 0; */
|
||||||
|
/* configfp = fopen( configname, "r" ); */
|
||||||
|
/* if (configfp && is_secured_file (fileno (configfp))) */
|
||||||
|
/* { */
|
||||||
|
/* fclose (configfp); */
|
||||||
|
/* configfp = NULL; */
|
||||||
|
/* gpg_err_set_errno (EPERM); */
|
||||||
|
/* } */
|
||||||
|
/* if( !configfp ) { */
|
||||||
|
/* if( default_config ) { */
|
||||||
|
/* if( parse_debug ) */
|
||||||
|
/* log_info(_("Note: no default option file '%s'\n"), */
|
||||||
|
/* configname ); */
|
||||||
|
/* } */
|
||||||
|
/* else { */
|
||||||
|
/* log_error(_("option file '%s': %s\n"), */
|
||||||
|
/* configname, strerror(errno) ); */
|
||||||
|
/* g10_exit(2); */
|
||||||
|
/* } */
|
||||||
|
/* xfree(configname); configname = NULL; */
|
||||||
|
/* } */
|
||||||
|
/* if( parse_debug && configname ) */
|
||||||
|
/* log_info(_("reading options from '%s'\n"), configname ); */
|
||||||
|
/* default_config = 0; */
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
while (gpgrt_argparser (&pargs, opts, GPG_NAME EXTSEP_S "conf" ))
|
||||||
{
|
{
|
||||||
switch( pargs.r_opt )
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
|
case ARGPARSE_CONFFILE:
|
||||||
|
if (debug_argparser)
|
||||||
|
log_info (_("reading options from '%s'\n"),
|
||||||
|
pargs.r_type? pargs.r.ret_str: "[cmdline]");
|
||||||
|
if (pargs.r_type)
|
||||||
|
{
|
||||||
|
xfree (last_configname);
|
||||||
|
last_configname = xstrdup (pargs.r.ret_str);
|
||||||
|
configname = last_configname;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
configname = NULL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* case oOptions: */
|
||||||
|
/* case oNoOptions: */
|
||||||
|
/* We will never see these options here because
|
||||||
|
* gpgrt_argparse handles them for us. */
|
||||||
|
/* break */
|
||||||
|
|
||||||
case aListConfig:
|
case aListConfig:
|
||||||
case aListGcryptConfig:
|
case aListGcryptConfig:
|
||||||
case aGPGConfList:
|
case aGPGConfList:
|
||||||
@ -2752,10 +2784,10 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case oNoUseAgent:
|
case oNoUseAgent:
|
||||||
obsolete_option (configname, configlineno, "no-use-agent");
|
obsolete_option (configname, pargs.lineno, "no-use-agent");
|
||||||
break;
|
break;
|
||||||
case oGpgAgentInfo:
|
case oGpgAgentInfo:
|
||||||
obsolete_option (configname, configlineno, "gpg-agent-info");
|
obsolete_option (configname, pargs.lineno, "gpg-agent-info");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oUseKeyboxd:
|
case oUseKeyboxd:
|
||||||
@ -2763,19 +2795,19 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case oReaderPort:
|
case oReaderPort:
|
||||||
obsolete_scdaemon_option (configname, configlineno, "reader-port");
|
obsolete_scdaemon_option (configname, pargs.lineno, "reader-port");
|
||||||
break;
|
break;
|
||||||
case octapiDriver:
|
case octapiDriver:
|
||||||
obsolete_scdaemon_option (configname, configlineno, "ctapi-driver");
|
obsolete_scdaemon_option (configname, pargs.lineno, "ctapi-driver");
|
||||||
break;
|
break;
|
||||||
case opcscDriver:
|
case opcscDriver:
|
||||||
obsolete_scdaemon_option (configname, configlineno, "pcsc-driver");
|
obsolete_scdaemon_option (configname, pargs.lineno, "pcsc-driver");
|
||||||
break;
|
break;
|
||||||
case oDisableCCID:
|
case oDisableCCID:
|
||||||
obsolete_scdaemon_option (configname, configlineno, "disable-ccid");
|
obsolete_scdaemon_option (configname, pargs.lineno, "disable-ccid");
|
||||||
break;
|
break;
|
||||||
case oHonorHttpProxy:
|
case oHonorHttpProxy:
|
||||||
obsolete_option (configname, configlineno, "honor-http-proxy");
|
obsolete_option (configname, pargs.lineno, "honor-http-proxy");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oAnswerYes: opt.answer_yes = 1; break;
|
case oAnswerYes: opt.answer_yes = 1; break;
|
||||||
@ -2786,7 +2818,7 @@ main (int argc, char **argv)
|
|||||||
sl->flags = KEYDB_RESOURCE_FLAG_PRIMARY;
|
sl->flags = KEYDB_RESOURCE_FLAG_PRIMARY;
|
||||||
break;
|
break;
|
||||||
case oShowKeyring:
|
case oShowKeyring:
|
||||||
deprecated_warning(configname,configlineno,"--show-keyring",
|
deprecated_warning(configname,pargs.lineno,"--show-keyring",
|
||||||
"--list-options ","show-keyring");
|
"--list-options ","show-keyring");
|
||||||
opt.list_options|=LIST_SHOW_KEYRING;
|
opt.list_options|=LIST_SHOW_KEYRING;
|
||||||
break;
|
break;
|
||||||
@ -2871,14 +2903,6 @@ main (int argc, char **argv)
|
|||||||
/* Ignore this old option. */
|
/* Ignore this old option. */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oOptions:
|
|
||||||
/* config files may not be nested (silently ignore them) */
|
|
||||||
if( !configfp ) {
|
|
||||||
xfree(configname);
|
|
||||||
configname = xstrdup(pargs.r.ret_str);
|
|
||||||
goto next_pass;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case oNoArmor: opt.no_armor=1; opt.armor=0; break;
|
case oNoArmor: opt.no_armor=1; opt.armor=0; break;
|
||||||
|
|
||||||
case oNoDefKeyring:
|
case oNoDefKeyring:
|
||||||
@ -2911,7 +2935,7 @@ main (int argc, char **argv)
|
|||||||
case oDefaultKey:
|
case oDefaultKey:
|
||||||
sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
|
sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
|
||||||
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
||||||
if (configfp)
|
if (configname)
|
||||||
sl->flags |= PK_LIST_CONFIG;
|
sl->flags |= PK_LIST_CONFIG;
|
||||||
break;
|
break;
|
||||||
case oDefRecipient:
|
case oDefRecipient:
|
||||||
@ -2929,7 +2953,6 @@ main (int argc, char **argv)
|
|||||||
xfree(opt.def_recipient); opt.def_recipient = NULL;
|
xfree(opt.def_recipient); opt.def_recipient = NULL;
|
||||||
opt.def_recipient_self = 0;
|
opt.def_recipient_self = 0;
|
||||||
break;
|
break;
|
||||||
case oNoOptions: opt.no_homedir_creation = 1; break; /* no-options */
|
|
||||||
case oHomedir: break;
|
case oHomedir: break;
|
||||||
case oNoBatch: opt.batch = 0; break;
|
case oNoBatch: opt.batch = 0; break;
|
||||||
|
|
||||||
@ -2961,7 +2984,7 @@ main (int argc, char **argv)
|
|||||||
opt.tofu_default_policy = parse_tofu_policy (pargs.r.ret_str);
|
opt.tofu_default_policy = parse_tofu_policy (pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
case oTOFUDBFormat:
|
case oTOFUDBFormat:
|
||||||
obsolete_option (configname, configlineno, "tofu-db-format");
|
obsolete_option (configname, pargs.lineno, "tofu-db-format");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oForceOwnertrust:
|
case oForceOwnertrust:
|
||||||
@ -3018,17 +3041,17 @@ main (int argc, char **argv)
|
|||||||
case oSigPolicyURL: add_policy_url(pargs.r.ret_str,0); break;
|
case oSigPolicyURL: add_policy_url(pargs.r.ret_str,0); break;
|
||||||
case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break;
|
case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break;
|
||||||
case oShowPolicyURL:
|
case oShowPolicyURL:
|
||||||
deprecated_warning(configname,configlineno,"--show-policy-url",
|
deprecated_warning(configname,pargs.lineno,"--show-policy-url",
|
||||||
"--list-options ","show-policy-urls");
|
"--list-options ","show-policy-urls");
|
||||||
deprecated_warning(configname,configlineno,"--show-policy-url",
|
deprecated_warning(configname,pargs.lineno,"--show-policy-url",
|
||||||
"--verify-options ","show-policy-urls");
|
"--verify-options ","show-policy-urls");
|
||||||
opt.list_options|=LIST_SHOW_POLICY_URLS;
|
opt.list_options|=LIST_SHOW_POLICY_URLS;
|
||||||
opt.verify_options|=VERIFY_SHOW_POLICY_URLS;
|
opt.verify_options|=VERIFY_SHOW_POLICY_URLS;
|
||||||
break;
|
break;
|
||||||
case oNoShowPolicyURL:
|
case oNoShowPolicyURL:
|
||||||
deprecated_warning(configname,configlineno,"--no-show-policy-url",
|
deprecated_warning(configname,pargs.lineno,"--no-show-policy-url",
|
||||||
"--list-options ","no-show-policy-urls");
|
"--list-options ","no-show-policy-urls");
|
||||||
deprecated_warning(configname,configlineno,"--no-show-policy-url",
|
deprecated_warning(configname,pargs.lineno,"--no-show-policy-url",
|
||||||
"--verify-options ","no-show-policy-urls");
|
"--verify-options ","no-show-policy-urls");
|
||||||
opt.list_options&=~LIST_SHOW_POLICY_URLS;
|
opt.list_options&=~LIST_SHOW_POLICY_URLS;
|
||||||
opt.verify_options&=~VERIFY_SHOW_POLICY_URLS;
|
opt.verify_options&=~VERIFY_SHOW_POLICY_URLS;
|
||||||
@ -3045,7 +3068,7 @@ main (int argc, char **argv)
|
|||||||
append_to_strlist(&opt.comments,pargs.r.ret_str);
|
append_to_strlist(&opt.comments,pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
case oDefaultComment:
|
case oDefaultComment:
|
||||||
deprecated_warning(configname,configlineno,
|
deprecated_warning(configname,pargs.lineno,
|
||||||
"--default-comment","--no-comments","");
|
"--default-comment","--no-comments","");
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case oNoComments:
|
case oNoComments:
|
||||||
@ -3055,17 +3078,17 @@ main (int argc, char **argv)
|
|||||||
case oThrowKeyids: opt.throw_keyids = 1; break;
|
case oThrowKeyids: opt.throw_keyids = 1; break;
|
||||||
case oNoThrowKeyids: opt.throw_keyids = 0; break;
|
case oNoThrowKeyids: opt.throw_keyids = 0; break;
|
||||||
case oShowPhotos:
|
case oShowPhotos:
|
||||||
deprecated_warning(configname,configlineno,"--show-photos",
|
deprecated_warning(configname,pargs.lineno,"--show-photos",
|
||||||
"--list-options ","show-photos");
|
"--list-options ","show-photos");
|
||||||
deprecated_warning(configname,configlineno,"--show-photos",
|
deprecated_warning(configname,pargs.lineno,"--show-photos",
|
||||||
"--verify-options ","show-photos");
|
"--verify-options ","show-photos");
|
||||||
opt.list_options|=LIST_SHOW_PHOTOS;
|
opt.list_options|=LIST_SHOW_PHOTOS;
|
||||||
opt.verify_options|=VERIFY_SHOW_PHOTOS;
|
opt.verify_options|=VERIFY_SHOW_PHOTOS;
|
||||||
break;
|
break;
|
||||||
case oNoShowPhotos:
|
case oNoShowPhotos:
|
||||||
deprecated_warning(configname,configlineno,"--no-show-photos",
|
deprecated_warning(configname,pargs.lineno,"--no-show-photos",
|
||||||
"--list-options ","no-show-photos");
|
"--list-options ","no-show-photos");
|
||||||
deprecated_warning(configname,configlineno,"--no-show-photos",
|
deprecated_warning(configname,pargs.lineno,"--no-show-photos",
|
||||||
"--verify-options ","no-show-photos");
|
"--verify-options ","no-show-photos");
|
||||||
opt.list_options&=~LIST_SHOW_PHOTOS;
|
opt.list_options&=~LIST_SHOW_PHOTOS;
|
||||||
opt.verify_options&=~VERIFY_SHOW_PHOTOS;
|
opt.verify_options&=~VERIFY_SHOW_PHOTOS;
|
||||||
@ -3096,7 +3119,7 @@ main (int argc, char **argv)
|
|||||||
* enough space for the flags. */
|
* enough space for the flags. */
|
||||||
sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
|
sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
|
||||||
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
||||||
if (configfp)
|
if (configname)
|
||||||
sl->flags |= PK_LIST_CONFIG;
|
sl->flags |= PK_LIST_CONFIG;
|
||||||
if (pargs.r_opt == oHiddenRecipient
|
if (pargs.r_opt == oHiddenRecipient
|
||||||
|| pargs.r_opt == oHiddenRecipientFile)
|
|| pargs.r_opt == oHiddenRecipientFile)
|
||||||
@ -3112,7 +3135,7 @@ main (int argc, char **argv)
|
|||||||
/* Store an additional recipient. */
|
/* Store an additional recipient. */
|
||||||
sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
|
sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
|
||||||
sl->flags = ((pargs.r_opt << PK_LIST_SHIFT) | PK_LIST_ENCRYPT_TO);
|
sl->flags = ((pargs.r_opt << PK_LIST_SHIFT) | PK_LIST_ENCRYPT_TO);
|
||||||
if (configfp)
|
if (configname)
|
||||||
sl->flags |= PK_LIST_CONFIG;
|
sl->flags |= PK_LIST_CONFIG;
|
||||||
if (pargs.r_opt == oHiddenEncryptTo)
|
if (pargs.r_opt == oHiddenEncryptTo)
|
||||||
sl->flags |= PK_LIST_HIDDEN;
|
sl->flags |= PK_LIST_HIDDEN;
|
||||||
@ -3122,7 +3145,7 @@ main (int argc, char **argv)
|
|||||||
opt.no_encrypt_to = 1;
|
opt.no_encrypt_to = 1;
|
||||||
break;
|
break;
|
||||||
case oEncryptToDefaultKey:
|
case oEncryptToDefaultKey:
|
||||||
opt.encrypt_to_default_key = configfp ? 2 : 1;
|
opt.encrypt_to_default_key = configname ? 2 : 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oTrySecretKey:
|
case oTrySecretKey:
|
||||||
@ -3168,7 +3191,7 @@ main (int argc, char **argv)
|
|||||||
case oLocalUser: /* store the local users */
|
case oLocalUser: /* store the local users */
|
||||||
sl = add_to_strlist2( &locusr, pargs.r.ret_str, utf8_strings );
|
sl = add_to_strlist2( &locusr, pargs.r.ret_str, utf8_strings );
|
||||||
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
|
||||||
if (configfp)
|
if (configname)
|
||||||
sl->flags |= PK_LIST_CONFIG;
|
sl->flags |= PK_LIST_CONFIG;
|
||||||
break;
|
break;
|
||||||
case oSender:
|
case oSender:
|
||||||
@ -3311,7 +3334,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid keyserver options\n"),
|
log_error(_("%s:%d: invalid keyserver options\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid keyserver options\n"));
|
log_error(_("invalid keyserver options\n"));
|
||||||
}
|
}
|
||||||
@ -3321,7 +3344,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid import options\n"),
|
log_error(_("%s:%d: invalid import options\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid import options\n"));
|
log_error(_("invalid import options\n"));
|
||||||
}
|
}
|
||||||
@ -3336,7 +3359,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid export options\n"),
|
log_error(_("%s:%d: invalid export options\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid export options\n"));
|
log_error(_("invalid export options\n"));
|
||||||
}
|
}
|
||||||
@ -3351,7 +3374,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid list options\n"),
|
log_error(_("%s:%d: invalid list options\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid list options\n"));
|
log_error(_("invalid list options\n"));
|
||||||
}
|
}
|
||||||
@ -3391,7 +3414,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid verify options\n"),
|
log_error(_("%s:%d: invalid verify options\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid verify options\n"));
|
log_error(_("invalid verify options\n"));
|
||||||
}
|
}
|
||||||
@ -3412,17 +3435,17 @@ main (int argc, char **argv)
|
|||||||
case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break;
|
case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break;
|
||||||
case oKnownNotation: register_known_notation (pargs.r.ret_str); break;
|
case oKnownNotation: register_known_notation (pargs.r.ret_str); break;
|
||||||
case oShowNotation:
|
case oShowNotation:
|
||||||
deprecated_warning(configname,configlineno,"--show-notation",
|
deprecated_warning(configname,pargs.lineno,"--show-notation",
|
||||||
"--list-options ","show-notations");
|
"--list-options ","show-notations");
|
||||||
deprecated_warning(configname,configlineno,"--show-notation",
|
deprecated_warning(configname,pargs.lineno,"--show-notation",
|
||||||
"--verify-options ","show-notations");
|
"--verify-options ","show-notations");
|
||||||
opt.list_options|=LIST_SHOW_NOTATIONS;
|
opt.list_options|=LIST_SHOW_NOTATIONS;
|
||||||
opt.verify_options|=VERIFY_SHOW_NOTATIONS;
|
opt.verify_options|=VERIFY_SHOW_NOTATIONS;
|
||||||
break;
|
break;
|
||||||
case oNoShowNotation:
|
case oNoShowNotation:
|
||||||
deprecated_warning(configname,configlineno,"--no-show-notation",
|
deprecated_warning(configname,pargs.lineno,"--no-show-notation",
|
||||||
"--list-options ","no-show-notations");
|
"--list-options ","no-show-notations");
|
||||||
deprecated_warning(configname,configlineno,"--no-show-notation",
|
deprecated_warning(configname,pargs.lineno,"--no-show-notation",
|
||||||
"--verify-options ","no-show-notations");
|
"--verify-options ","no-show-notations");
|
||||||
opt.list_options&=~LIST_SHOW_NOTATIONS;
|
opt.list_options&=~LIST_SHOW_NOTATIONS;
|
||||||
opt.verify_options&=~VERIFY_SHOW_NOTATIONS;
|
opt.verify_options&=~VERIFY_SHOW_NOTATIONS;
|
||||||
@ -3475,7 +3498,7 @@ main (int argc, char **argv)
|
|||||||
ovrseskeyfd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);
|
ovrseskeyfd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);
|
||||||
break;
|
break;
|
||||||
case oMergeOnly:
|
case oMergeOnly:
|
||||||
deprecated_warning(configname,configlineno,"--merge-only",
|
deprecated_warning(configname,pargs.lineno,"--merge-only",
|
||||||
"--import-options ","merge-only");
|
"--import-options ","merge-only");
|
||||||
opt.import_options|=IMPORT_MERGE_ONLY;
|
opt.import_options|=IMPORT_MERGE_ONLY;
|
||||||
break;
|
break;
|
||||||
@ -3607,7 +3630,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if(configname)
|
if(configname)
|
||||||
log_error(_("%s:%d: invalid auto-key-locate list\n"),
|
log_error(_("%s:%d: invalid auto-key-locate list\n"),
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_error(_("invalid auto-key-locate list\n"));
|
log_error(_("invalid auto-key-locate list\n"));
|
||||||
}
|
}
|
||||||
@ -3629,7 +3652,7 @@ main (int argc, char **argv)
|
|||||||
if (configname)
|
if (configname)
|
||||||
log_info("%s:%d: WARNING: gpg not built with large secure "
|
log_info("%s:%d: WARNING: gpg not built with large secure "
|
||||||
"memory buffer. Ignoring enable-large-rsa\n",
|
"memory buffer. Ignoring enable-large-rsa\n",
|
||||||
configname,configlineno);
|
configname,pargs.lineno);
|
||||||
else
|
else
|
||||||
log_info("WARNING: gpg not built with large secure "
|
log_info("WARNING: gpg not built with large secure "
|
||||||
"memory buffer. Ignoring --enable-large-rsa\n");
|
"memory buffer. Ignoring --enable-large-rsa\n");
|
||||||
@ -3686,7 +3709,7 @@ main (int argc, char **argv)
|
|||||||
case oNoop: break;
|
case oNoop: break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (configfp)
|
if (configname)
|
||||||
pargs.err = ARGPARSE_PRINT_WARNING;
|
pargs.err = ARGPARSE_PRINT_WARNING;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3700,19 +3723,8 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configfp)
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
{
|
|
||||||
fclose( configfp );
|
|
||||||
configfp = NULL;
|
|
||||||
/* Remember the first config file name. */
|
|
||||||
if (!save_configname)
|
|
||||||
save_configname = configname;
|
|
||||||
else
|
|
||||||
xfree(configname);
|
|
||||||
configname = NULL;
|
|
||||||
goto next_pass;
|
|
||||||
}
|
|
||||||
xfree(configname); configname = NULL;
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
{
|
{
|
||||||
write_status_failure ("option-parser", gpg_error(GPG_ERR_GENERAL));
|
write_status_failure ("option-parser", gpg_error(GPG_ERR_GENERAL));
|
||||||
@ -3723,11 +3735,10 @@ main (int argc, char **argv)
|
|||||||
directly after the option parsing. */
|
directly after the option parsing. */
|
||||||
if (cmd == aGPGConfList)
|
if (cmd == aGPGConfList)
|
||||||
{
|
{
|
||||||
gpgconf_list (save_configname ? save_configname : default_configname);
|
gpgconf_list (last_configname ? last_configname : "UNKNOWN");
|
||||||
g10_exit (0);
|
g10_exit (0);
|
||||||
}
|
}
|
||||||
xfree (save_configname);
|
xfree (last_configname);
|
||||||
xfree (default_configname);
|
|
||||||
|
|
||||||
if (print_dane_records)
|
if (print_dane_records)
|
||||||
log_error ("invalid option \"%s\"; use \"%s\" instead\n",
|
log_error ("invalid option \"%s\"; use \"%s\" instead\n",
|
||||||
@ -3750,19 +3761,19 @@ main (int argc, char **argv)
|
|||||||
if( greeting )
|
if( greeting )
|
||||||
{
|
{
|
||||||
es_fprintf (es_stderr, "%s %s; %s\n",
|
es_fprintf (es_stderr, "%s %s; %s\n",
|
||||||
strusage(11), strusage(13), strusage(14) );
|
gpgrt_strusage(11), gpgrt_strusage(13), gpgrt_strusage(14));
|
||||||
es_fprintf (es_stderr, "%s\n", strusage(15) );
|
es_fprintf (es_stderr, "%s\n", gpgrt_strusage(15) );
|
||||||
}
|
}
|
||||||
#ifdef IS_DEVELOPMENT_VERSION
|
#ifdef IS_DEVELOPMENT_VERSION
|
||||||
if (!opt.batch)
|
if (!opt.batch)
|
||||||
{
|
{
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
if((s=strusage(25)))
|
if((s=gpgrt_strusage(25)))
|
||||||
log_info("%s\n",s);
|
log_info("%s\n",s);
|
||||||
if((s=strusage(26)))
|
if((s=gpgrt_strusage(26)))
|
||||||
log_info("%s\n",s);
|
log_info("%s\n",s);
|
||||||
if((s=strusage(27)))
|
if((s=gpgrt_strusage(27)))
|
||||||
log_info("%s\n",s);
|
log_info("%s\n",s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -36,6 +39,7 @@
|
|||||||
#define INCLUDED_BY_MAIN_MODULE 1
|
#define INCLUDED_BY_MAIN_MODULE 1
|
||||||
#include "gpg.h"
|
#include "gpg.h"
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include "../common/iobuf.h"
|
#include "../common/iobuf.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
@ -176,7 +180,7 @@ main( int argc, char **argv )
|
|||||||
ctrl_t ctrl;
|
ctrl_t ctrl;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix ("gpgv", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpgv", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -42,6 +45,7 @@
|
|||||||
#include "../common/asshelp.h"
|
#include "../common/asshelp.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "keyblob.h"
|
#include "keyblob.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values {
|
enum cmd_and_opt_values {
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -47,6 +50,7 @@
|
|||||||
#include "mountinfo.h"
|
#include "mountinfo.h"
|
||||||
#include "backend.h"
|
#include "backend.h"
|
||||||
#include "call-syshelp.h"
|
#include "call-syshelp.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values {
|
enum cmd_and_opt_values {
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -37,6 +40,7 @@
|
|||||||
#include "keybox-defs.h"
|
#include "keybox-defs.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values {
|
enum cmd_and_opt_values {
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -45,6 +48,7 @@
|
|||||||
|
|
||||||
#include <assuan.h> /* malloc hooks */
|
#include <assuan.h> /* malloc hooks */
|
||||||
|
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "iso7816.h"
|
#include "iso7816.h"
|
||||||
|
@ -91,7 +91,7 @@ warn_version_mismatch (ctrl_t ctrl, assuan_context_t ctx,
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, mode, &serverversion);
|
err = get_assuan_server_version (ctx, mode, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -158,7 +158,7 @@ warn_version_mismatch (ctrl_t ctrl, assuan_context_t ctx,
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, mode, &serverversion);
|
err = get_assuan_server_version (ctx, mode, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -33,6 +36,7 @@
|
|||||||
#include "gpgsm.h"
|
#include "gpgsm.h"
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
#include <assuan.h> /* malloc hooks */
|
#include <assuan.h> /* malloc hooks */
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#include "passphrase.h"
|
#include "passphrase.h"
|
||||||
#include "../common/shareddefs.h"
|
#include "../common/shareddefs.h"
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -48,6 +51,7 @@
|
|||||||
#include "../../common/strlist.h"
|
#include "../../common/strlist.h"
|
||||||
#include "../../common/sysutils.h"
|
#include "../../common/sysutils.h"
|
||||||
#include "../../common/util.h"
|
#include "../../common/util.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
/* The TinyScheme banner. Unfortunately, it isn't in the header
|
/* The TinyScheme banner. Unfortunately, it isn't in the header
|
||||||
file. */
|
file. */
|
||||||
|
@ -269,7 +269,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
char *serverversion;
|
char *serverversion;
|
||||||
const char *myversion = strusage (13);
|
const char *myversion = gpgrt_strusage (13);
|
||||||
|
|
||||||
err = get_assuan_server_version (ctx, mode, &serverversion);
|
err = get_assuan_server_version (ctx, mode, &serverversion);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -41,6 +44,7 @@
|
|||||||
#include "../common/ttyio.h"
|
#include "../common/ttyio.h"
|
||||||
#include "../common/server-help.h"
|
#include "../common/server-help.h"
|
||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#include "gpg-card.h"
|
#include "gpg-card.h"
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -44,6 +47,7 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
@ -491,4 +495,3 @@ process (FILE *fp, pattern_t *patarray)
|
|||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info ("no input line matches the pattern - accepted\n");
|
log_info ("no input line matches the pattern - accepted\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -31,6 +34,7 @@
|
|||||||
|
|
||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
#include "../common/asshelp.h"
|
#include "../common/asshelp.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/membuf.h"
|
#include "../common/membuf.h"
|
||||||
|
@ -119,8 +119,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -136,6 +138,7 @@
|
|||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/name-value.h"
|
#include "../common/name-value.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -41,6 +44,7 @@
|
|||||||
#include "mime-maker.h"
|
#include "mime-maker.h"
|
||||||
#include "send-mail.h"
|
#include "send-mail.h"
|
||||||
#include "gpg-wks.h"
|
#include "gpg-wks.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -45,6 +48,7 @@
|
|||||||
#include "mime-maker.h"
|
#include "mime-maker.h"
|
||||||
#include "send-mail.h"
|
#include "send-mail.h"
|
||||||
#include "gpg-wks.h"
|
#include "gpg-wks.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
/* The time we wait for a confirmation response. */
|
/* The time we wait for a confirmation response. */
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -31,6 +34,7 @@
|
|||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/status.h"
|
#include "../common/status.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -39,6 +42,7 @@
|
|||||||
#define INCLUDED_BY_MAIN_MODULE 1
|
#define INCLUDED_BY_MAIN_MODULE 1
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#ifdef HAVE_BZIP2
|
#ifdef HAVE_BZIP2
|
||||||
# include <bzlib.h>
|
# include <bzlib.h>
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
gpg. So here we go. */
|
gpg. So here we go. */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
/* We don't want to have the macros from gpgrt here until we have
|
||||||
|
* completely replaced this module by the one from gpgrt. */
|
||||||
|
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -41,6 +44,7 @@
|
|||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/strlist.h"
|
#include "../common/strlist.h"
|
||||||
|
#include "../common/argparse.h" /* temporary hack. */
|
||||||
|
|
||||||
#include "gpgtar.h"
|
#include "gpgtar.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user