(parse_rereadable_options): Use the new

DEFAULT_CACHE_TTL macro.
(main): Updated --gpgconf-list output.
This commit is contained in:
Werner Koch 2004-03-16 10:48:42 +00:00
parent a6768b8eca
commit 3e8221e955
2 changed files with 50 additions and 17 deletions

View File

@ -1,3 +1,9 @@
2004-03-16 Werner Koch <wk@gnupg.org>
* gpg-agent.c (parse_rereadable_options): Use the new
DEFAULT_CACHE_TTL macro.
(main): Updated --gpgconf-list output.
2004-02-21 Werner Koch <wk@gnupg.org> 2004-02-21 Werner Koch <wk@gnupg.org>
* command.c (cmd_passwd): Take acount of a key description. * command.c (cmd_passwd): Take acount of a key description.

View File

@ -99,7 +99,7 @@ static ARGPARSE_OPTS opts[] = {
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") }, { oQuiet, "quiet", 0, N_("be somewhat more quiet") },
{ oSh, "sh", 0, N_("sh-style command output") }, { oSh, "sh", 0, N_("sh-style command output") },
{ oCsh, "csh", 0, N_("csh-style command output") }, { oCsh, "csh", 0, N_("csh-style command output") },
{ oOptions, "options" , 2, N_("read options from file")}, { oOptions, "options" , 2, N_("|FILE|read options from FILE")},
{ oDebug, "debug" ,4|16, "@"}, { oDebug, "debug" ,4|16, "@"},
{ oDebugAll, "debug-all" ,0, "@"}, { oDebugAll, "debug-all" ,0, "@"},
{ oDebugLevel, "debug-level" ,2, "@"}, { oDebugLevel, "debug-level" ,2, "@"},
@ -128,6 +128,8 @@ static ARGPARSE_OPTS opts[] = {
}; };
#define DEFAULT_CACHE_TTL (10*60) /* 10 minutes */
static volatile int caught_fatal_sig = 0; static volatile int caught_fatal_sig = 0;
/* flag to indicate that a shutdown was requested */ /* flag to indicate that a shutdown was requested */
@ -323,7 +325,7 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs)
opt.no_grab = 0; opt.no_grab = 0;
opt.pinentry_program = NULL; opt.pinentry_program = NULL;
opt.scdaemon_program = NULL; opt.scdaemon_program = NULL;
opt.def_cache_ttl = 10*60; /* default to 10 minutes */ opt.def_cache_ttl = DEFAULT_CACHE_TTL;
opt.ignore_cache_for_signing = 0; opt.ignore_cache_for_signing = 0;
return 1; return 1;
} }
@ -587,15 +589,40 @@ main (int argc, char **argv )
if (gpgconf_list) if (gpgconf_list)
{ /* List options and default values in the GPG Conf format. */ { /* List options and default values in the GPG Conf format. */
printf ("gpgconf-gpg-agent.conf:\"%s\n", config_filename); /* The following list is taken from gnupg/tools/gpgconf-comp.c. */
/* Option flags. YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE. */
#define GC_OPT_FLAG_NONE 0UL
/* The RUNTIME flag for an option indicates that the option can be
changed at runtime. */
#define GC_OPT_FLAG_RUNTIME (1UL << 3)
/* The DEFAULT flag for an option indicates that the option has a
default value. */
#define GC_OPT_FLAG_DEFAULT (1UL << 4)
/* The DEF_DESC flag for an option indicates that the option has a
default, which is described by the value of the default field. */
#define GC_OPT_FLAG_DEF_DESC (1UL << 5)
/* The NO_ARG_DESC flag for an option indicates that the argument has
a default, which is described by the value of the ARGDEF field. */
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
printf ("gpgconf-gpg-agent.conf:%lu:\"%s\n",
GC_OPT_FLAG_DEFAULT, config_filename);
printf ("verbose:\n" printf ("verbose:%lu:\n"
"quiet:\n" "quiet:%lu:\n"
"debug-level:none\n" "debug-level:%lu:\"none\":\n"
"log-file:\n" "log-file:%lu:\n",
"force:\n" GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME,
"faked-system-time:\n" GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME,
"no-greeting:\n"); GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME,
GC_OPT_FLAG_NONE );
printf ("default-cache-ttl:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, DEFAULT_CACHE_TTL );
printf ("no-grab:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("ignore-cache-for-signing:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
agent_exit (0); agent_exit (0);
} }
@ -605,13 +632,13 @@ main (int argc, char **argv )
" to run the program in the background\n")); " to run the program in the background\n"));
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
/* gpg-agent usdually does not ooutput any messages becuase it runs /* gpg-agent usually does not output any messages because it runs in
in the background. For log files it is acceptable to have the background. For log files it is acceptable to have messages
messages always encoded in utf-8. We switch here to utf-8, so always encoded in utf-8. We switch here to utf-8, so that
that commands like --help still give native messages. It is far commands like --help still give native messages. It is far
easier to swicthnonly once instead of for every message and it easier to switch only once instead of for every message and it
actually helps when more then one thread is active (avoids actually helps when more then one thread is active (avoids an
required an extra copy step). */ extra copy step). */
bind_textdomain_codeset (PACKAGE, "UTF-8"); bind_textdomain_codeset (PACKAGE, "UTF-8");
#endif #endif