mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
gpg: Add option --dirmngr-program.
* g10/gpg.c: Add option --dirmngr-program. * g10/options.h (struct opt): Add field dirmngr_program. * g10/call-dirmngr.c (create_context): Use new var. * dirmngr/dirmngr.c: Include gc-opt-flags.h. (main): Remove GC_OPT_FLAG_*. * tools/gpgconf-comp.c (GC_OPT_FLAG_NO_CHANGE): Move macro to ... * common/gc-opt-flags.h: here.
This commit is contained in:
parent
fb56a273b1
commit
6dd5d99a61
@ -36,5 +36,11 @@
|
|||||||
a default, which is described by the value of the ARGDEF field. */
|
a default, which is described by the value of the ARGDEF field. */
|
||||||
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
|
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
|
||||||
|
|
||||||
|
/* The NO_CHANGE flag for an option indicates that the user should not
|
||||||
|
be allowed to change this option using the standard gpgconf method.
|
||||||
|
Frontends using gpgconf should grey out such options, so that only
|
||||||
|
the current value is displayed. */
|
||||||
|
#define GC_OPT_FLAG_NO_CHANGE (1UL <<7)
|
||||||
|
|
||||||
|
|
||||||
#endif /*GNUPG_GC_OPT_FLAGS_H*/
|
#endif /*GNUPG_GC_OPT_FLAGS_H*/
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include "asshelp.h"
|
#include "asshelp.h"
|
||||||
#include "ldap-wrapper.h"
|
#include "ldap-wrapper.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
|
#include "gc-opt-flags.h"
|
||||||
|
|
||||||
/* The plain Windows version uses the windows service system. For
|
/* The plain Windows version uses the windows service system. For
|
||||||
example to start the service you may use "sc start dirmngr".
|
example to start the service you may use "sc start dirmngr".
|
||||||
@ -709,7 +710,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If --daemon has been given on the command line but not --homedir,
|
/* If --daemon has been given on the command line but not --homedir,
|
||||||
we switch to /etc/dirmngr as default home directory. Note, that
|
we switch to /etc/gnupg as default home directory. Note, that
|
||||||
this also overrides the GNUPGHOME environment variable. */
|
this also overrides the GNUPGHOME environment variable. */
|
||||||
if (opt.system_daemon && !homedir_seen)
|
if (opt.system_daemon && !homedir_seen)
|
||||||
{
|
{
|
||||||
@ -910,7 +911,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
if (cmd == aServer)
|
if (cmd == aServer)
|
||||||
{
|
{
|
||||||
/* Note that this server mode is maily useful for debugging. */
|
/* Note that this server mode is mainly useful for debugging. */
|
||||||
if (argc)
|
if (argc)
|
||||||
wrong_args ("--server");
|
wrong_args ("--server");
|
||||||
|
|
||||||
@ -1193,23 +1194,6 @@ main (int argc, char **argv)
|
|||||||
char *filename;
|
char *filename;
|
||||||
char *filename_esc;
|
char *filename_esc;
|
||||||
|
|
||||||
/* List options and default values in the GPG Conf format. */
|
|
||||||
|
|
||||||
/* 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 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)
|
|
||||||
#define GC_OPT_FLAG_NO_CHANGE (1UL <<7)
|
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
/* On Windows systems, dirmngr always runs as system daemon, and
|
/* On Windows systems, dirmngr always runs as system daemon, and
|
||||||
the per-user configuration is never used. So we short-cut
|
the per-user configuration is never used. So we short-cut
|
||||||
|
19
doc/gpg.texi
19
doc/gpg.texi
@ -1696,6 +1696,25 @@ been given. Given that this option is not anymore used by
|
|||||||
@command{gpg2}, it should be avoided if possible.
|
@command{gpg2}, it should be avoided if possible.
|
||||||
@end ifset
|
@end ifset
|
||||||
|
|
||||||
|
|
||||||
|
@ifclear gpgone
|
||||||
|
@item --agent-program @var{file}
|
||||||
|
@opindex agent-program
|
||||||
|
Specify an agent program to be used for secret key operations. The
|
||||||
|
default value is the @file{/usr/bin/gpg-agent}. This is only used
|
||||||
|
as a fallback when the environment variable @code{GPG_AGENT_INFO} is not
|
||||||
|
set or a running agent cannot be connected.
|
||||||
|
@end ifclear
|
||||||
|
|
||||||
|
@ifset gpgtwoone
|
||||||
|
@item --dirmngr-program @var{file}
|
||||||
|
@opindex dirmngr-program
|
||||||
|
Specify a dirmngr program to be used for keyserver access. The
|
||||||
|
default value is @file{/usr/sbin/dirmngr}. This is only used as a
|
||||||
|
fallback when the environment variable @code{DIRMNGR_INFO} is not set or
|
||||||
|
a running dirmngr cannot be connected.
|
||||||
|
@end ifset
|
||||||
|
|
||||||
@item --lock-once
|
@item --lock-once
|
||||||
@opindex lock-once
|
@opindex lock-once
|
||||||
Lock the databases the first time a lock is requested
|
Lock the databases the first time a lock is requested
|
||||||
|
@ -350,7 +350,7 @@ as a fallback when the environment variable @code{GPG_AGENT_INFO} is not
|
|||||||
set or a running agent cannot be connected.
|
set or a running agent cannot be connected.
|
||||||
|
|
||||||
@item --dirmngr-program @var{file}
|
@item --dirmngr-program @var{file}
|
||||||
@opindex dirmnr-program
|
@opindex dirmngr-program
|
||||||
Specify a dirmngr program to be used for @acronym{CRL} checks. The
|
Specify a dirmngr program to be used for @acronym{CRL} checks. The
|
||||||
default value is @file{/usr/sbin/dirmngr}. This is only used as a
|
default value is @file{/usr/sbin/dirmngr}. This is only used as a
|
||||||
fallback when the environment variable @code{DIRMNGR_INFO} is not set or
|
fallback when the environment variable @code{DIRMNGR_INFO} is not set or
|
||||||
|
@ -121,7 +121,7 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
|
|||||||
err = start_new_dirmngr (&ctx,
|
err = start_new_dirmngr (&ctx,
|
||||||
GPG_ERR_SOURCE_DEFAULT,
|
GPG_ERR_SOURCE_DEFAULT,
|
||||||
opt.homedir,
|
opt.homedir,
|
||||||
NULL,
|
opt.dirmngr_program,
|
||||||
opt.verbose, DBG_ASSUAN,
|
opt.verbose, DBG_ASSUAN,
|
||||||
NULL /*gpg_status2*/, ctrl);
|
NULL /*gpg_status2*/, ctrl);
|
||||||
if (!err)
|
if (!err)
|
||||||
|
@ -346,6 +346,7 @@ enum cmd_and_opt_values
|
|||||||
oPersonalDigestPreferences,
|
oPersonalDigestPreferences,
|
||||||
oPersonalCompressPreferences,
|
oPersonalCompressPreferences,
|
||||||
oAgentProgram,
|
oAgentProgram,
|
||||||
|
oDirmngrProgram,
|
||||||
oDisplay,
|
oDisplay,
|
||||||
oTTYname,
|
oTTYname,
|
||||||
oTTYtype,
|
oTTYtype,
|
||||||
@ -739,7 +740,9 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-prefs", "@"),
|
ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-prefs", "@"),
|
||||||
ARGPARSE_s_s (oPersonalDigestPreferences, "personal-digest-prefs", "@"),
|
ARGPARSE_s_s (oPersonalDigestPreferences, "personal-digest-prefs", "@"),
|
||||||
ARGPARSE_s_s (oPersonalCompressPreferences, "personal-compress-prefs", "@"),
|
ARGPARSE_s_s (oPersonalCompressPreferences, "personal-compress-prefs", "@"),
|
||||||
|
|
||||||
ARGPARSE_s_s (oAgentProgram, "agent-program", "@"),
|
ARGPARSE_s_s (oAgentProgram, "agent-program", "@"),
|
||||||
|
ARGPARSE_s_s (oDirmngrProgram, "dirmngr-program", "@"),
|
||||||
ARGPARSE_s_s (oDisplay, "display", "@"),
|
ARGPARSE_s_s (oDisplay, "display", "@"),
|
||||||
ARGPARSE_s_s (oTTYname, "ttyname", "@"),
|
ARGPARSE_s_s (oTTYname, "ttyname", "@"),
|
||||||
ARGPARSE_s_s (oTTYtype, "ttytype", "@"),
|
ARGPARSE_s_s (oTTYtype, "ttytype", "@"),
|
||||||
@ -2974,6 +2977,7 @@ main (int argc, char **argv)
|
|||||||
pers_compress_list=pargs.r.ret_str;
|
pers_compress_list=pargs.r.ret_str;
|
||||||
break;
|
break;
|
||||||
case oAgentProgram: opt.agent_program = pargs.r.ret_str; break;
|
case oAgentProgram: opt.agent_program = pargs.r.ret_str; break;
|
||||||
|
case oDirmngrProgram: opt.dirmngr_program = pargs.r.ret_str; break;
|
||||||
|
|
||||||
case oDisplay:
|
case oDisplay:
|
||||||
set_opt_session_env ("DISPLAY", pargs.r.ret_str);
|
set_opt_session_env ("DISPLAY", pargs.r.ret_str);
|
||||||
|
@ -101,6 +101,7 @@ struct
|
|||||||
int max_cert_depth;
|
int max_cert_depth;
|
||||||
const char *homedir;
|
const char *homedir;
|
||||||
const char *agent_program;
|
const char *agent_program;
|
||||||
|
const char *dirmngr_program;
|
||||||
|
|
||||||
/* Options to be passed to the gpg-agent */
|
/* Options to be passed to the gpg-agent */
|
||||||
session_env_t session_env;
|
session_env_t session_env;
|
||||||
|
@ -357,11 +357,6 @@ static struct
|
|||||||
several times. A comma separated list of arguments is used as the
|
several times. A comma separated list of arguments is used as the
|
||||||
argument value. */
|
argument value. */
|
||||||
#define GC_OPT_FLAG_LIST (1UL << 2)
|
#define GC_OPT_FLAG_LIST (1UL << 2)
|
||||||
/* The NO_CHANGE flag for an option indicates that the user should not
|
|
||||||
be allowed to change this option using the standard gpgconf method.
|
|
||||||
Frontends using gpgconf should grey out such options, so that only
|
|
||||||
the current value is displayed. */
|
|
||||||
#define GC_OPT_FLAG_NO_CHANGE (1UL <<7)
|
|
||||||
|
|
||||||
|
|
||||||
/* A human-readable description for each flag. */
|
/* A human-readable description for each flag. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user