mirror of
git://git.gnupg.org/gnupg.git
synced 2024-06-03 22:48:03 +02:00
Add option --no-autostart.
* g10/gpg.c: Add option --no-autostart. * sm/gpgsm.c: Ditto. * g10/options.h (opt): Add field autostart. * sm/gpgsm.h (opt): Ditto. * g10/call-agent.c (start_agent): Print note if agent was not autostarted. * sm/call-agent.c (start_agent): Ditto. * g10/call-dirmngr.c (create_context): Likewise. * sm/call-dirmngr.c (start_dirmngr_ext): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
f173cdcdfb
commit
7aee3579be
|
@ -1735,6 +1735,14 @@ fallback when the environment variable @code{DIRMNGR_INFO} is not set or
|
||||||
a running dirmngr cannot be connected.
|
a running dirmngr cannot be connected.
|
||||||
@end ifset
|
@end ifset
|
||||||
|
|
||||||
|
@item --no-autostart
|
||||||
|
@opindex no-autostart
|
||||||
|
Do not start the gpg-agent or the dirmngr if it has not yet been
|
||||||
|
started and its service is required. This option is mostly useful on
|
||||||
|
machines where the connection to gpg-agent has been redirected to
|
||||||
|
another machines. If dirmngr is required on the remote machine, it
|
||||||
|
may be started manually using @command{gpgconf --launch dirmngr}.
|
||||||
|
|
||||||
@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
|
||||||
|
|
|
@ -384,6 +384,14 @@ always used.
|
||||||
@item --disable-dirmngr
|
@item --disable-dirmngr
|
||||||
Entirely disable the use of the Dirmngr.
|
Entirely disable the use of the Dirmngr.
|
||||||
|
|
||||||
|
@item --no-autostart
|
||||||
|
@opindex no-autostart
|
||||||
|
Do not start the gpg-agent or the dirmngr if it has not yet been
|
||||||
|
started and its service is required. This option is mostly useful on
|
||||||
|
machines where the connection to gpg-agent has been redirected to
|
||||||
|
another machines. If dirmngr is required on the remote machine, it
|
||||||
|
may be started manually using @command{gpgconf --launch dirmngr}.
|
||||||
|
|
||||||
@item --no-secmem-warning
|
@item --no-secmem-warning
|
||||||
@opindex no-secmem-warning
|
@opindex no-secmem-warning
|
||||||
Do not print a warning when the so called "secure memory" cannot be used.
|
Do not print a warning when the so called "secure memory" cannot be used.
|
||||||
|
|
|
@ -1241,6 +1241,11 @@ When using @option{-S} or @option{--exec}, @command{gpg-connect-agent}
|
||||||
connects to the assuan server in extended mode to allow descriptor
|
connects to the assuan server in extended mode to allow descriptor
|
||||||
passing. This option makes it use the old mode.
|
passing. This option makes it use the old mode.
|
||||||
|
|
||||||
|
@item --no-autostart
|
||||||
|
@opindex no-autostart
|
||||||
|
Do not start the gpg-agent or the dirmngr if it has not yet been
|
||||||
|
started.
|
||||||
|
|
||||||
@item --run @var{file}
|
@item --run @var{file}
|
||||||
@opindex run
|
@opindex run
|
||||||
Run the commands from @var{file} at startup and then continue with the
|
Run the commands from @var{file} at startup and then continue with the
|
||||||
|
|
|
@ -285,9 +285,19 @@ start_agent (ctrl_t ctrl, int for_card)
|
||||||
opt.agent_program,
|
opt.agent_program,
|
||||||
opt.lc_ctype, opt.lc_messages,
|
opt.lc_ctype, opt.lc_messages,
|
||||||
opt.session_env,
|
opt.session_env,
|
||||||
1, opt.verbose, DBG_ASSUAN,
|
opt.autostart, opt.verbose, DBG_ASSUAN,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (!rc)
|
if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT)
|
||||||
|
{
|
||||||
|
static int shown;
|
||||||
|
|
||||||
|
if (!shown)
|
||||||
|
{
|
||||||
|
shown = 1;
|
||||||
|
log_info (_("no gpg-agent running in this session\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!rc)
|
||||||
{
|
{
|
||||||
/* Tell the agent that we support Pinentry notifications.
|
/* Tell the agent that we support Pinentry notifications.
|
||||||
No error checking so that it will work also with older
|
No error checking so that it will work also with older
|
||||||
|
|
|
@ -130,9 +130,19 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
|
||||||
GPG_ERR_SOURCE_DEFAULT,
|
GPG_ERR_SOURCE_DEFAULT,
|
||||||
opt.homedir,
|
opt.homedir,
|
||||||
opt.dirmngr_program,
|
opt.dirmngr_program,
|
||||||
1, opt.verbose, DBG_ASSUAN,
|
opt.autostart, opt.verbose, DBG_ASSUAN,
|
||||||
NULL /*gpg_status2*/, ctrl);
|
NULL /*gpg_status2*/, ctrl);
|
||||||
if (!err)
|
if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR)
|
||||||
|
{
|
||||||
|
static int shown;
|
||||||
|
|
||||||
|
if (!shown)
|
||||||
|
{
|
||||||
|
shown = 1;
|
||||||
|
log_info (_("no dirmngr running in this session\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!err)
|
||||||
{
|
{
|
||||||
keyserver_spec_t ksi;
|
keyserver_spec_t ksi;
|
||||||
|
|
||||||
|
|
|
@ -379,6 +379,7 @@ enum cmd_and_opt_values
|
||||||
oNoAllowMultipleMessages,
|
oNoAllowMultipleMessages,
|
||||||
oAllowWeakDigestAlgos,
|
oAllowWeakDigestAlgos,
|
||||||
oFakedSystemTime,
|
oFakedSystemTime,
|
||||||
|
oNoAutostart,
|
||||||
|
|
||||||
oNoop
|
oNoop
|
||||||
};
|
};
|
||||||
|
@ -786,6 +787,7 @@ static ARGPARSE_OPTS opts[] = {
|
||||||
/* New options. Fixme: Should go more to the top. */
|
/* New options. Fixme: Should go more to the top. */
|
||||||
ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate", "@"),
|
ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate", "@"),
|
||||||
ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"),
|
ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"),
|
||||||
|
ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"),
|
||||||
|
|
||||||
/* Dummy options with warnings. */
|
/* Dummy options with warnings. */
|
||||||
ARGPARSE_s_n (oUseAgent, "use-agent", "@"),
|
ARGPARSE_s_n (oUseAgent, "use-agent", "@"),
|
||||||
|
@ -2080,6 +2082,7 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
dotlock_create (NULL, 0); /* Register lock file cleanup. */
|
dotlock_create (NULL, 0); /* Register lock file cleanup. */
|
||||||
|
|
||||||
|
opt.autostart = 1;
|
||||||
opt.session_env = session_env_new ();
|
opt.session_env = session_env_new ();
|
||||||
if (!opt.session_env)
|
if (!opt.session_env)
|
||||||
log_fatal ("error allocating session environment block: %s\n",
|
log_fatal ("error allocating session environment block: %s\n",
|
||||||
|
@ -3131,6 +3134,8 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case oNoAutostart: opt.autostart = 0; break;
|
||||||
|
|
||||||
case oNoop: break;
|
case oNoop: break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct
|
||||||
estream_t outfp; /* Hack, sometimes used in place of outfile. */
|
estream_t outfp; /* Hack, sometimes used in place of outfile. */
|
||||||
off_t max_output;
|
off_t max_output;
|
||||||
int dry_run;
|
int dry_run;
|
||||||
|
int autostart;
|
||||||
int list_only;
|
int list_only;
|
||||||
int textmode;
|
int textmode;
|
||||||
int expert;
|
int expert;
|
||||||
|
|
|
@ -95,10 +95,20 @@ start_agent (ctrl_t ctrl)
|
||||||
opt.agent_program,
|
opt.agent_program,
|
||||||
opt.lc_ctype, opt.lc_messages,
|
opt.lc_ctype, opt.lc_messages,
|
||||||
opt.session_env,
|
opt.session_env,
|
||||||
1, opt.verbose, DBG_ASSUAN,
|
opt.autostart, opt.verbose, DBG_ASSUAN,
|
||||||
gpgsm_status2, ctrl);
|
gpgsm_status2, ctrl);
|
||||||
|
|
||||||
if (!rc)
|
if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT)
|
||||||
|
{
|
||||||
|
static int shown;
|
||||||
|
|
||||||
|
if (!shown)
|
||||||
|
{
|
||||||
|
shown = 1;
|
||||||
|
log_info (_("no gpg-agent running in this session\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!rc)
|
||||||
{
|
{
|
||||||
/* Tell the agent that we support Pinentry notifications. No
|
/* Tell the agent that we support Pinentry notifications. No
|
||||||
error checking so that it will work also with older
|
error checking so that it will work also with older
|
||||||
|
|
|
@ -209,8 +209,18 @@ start_dirmngr_ext (ctrl_t ctrl, assuan_context_t *ctx_r)
|
||||||
|
|
||||||
err = start_new_dirmngr (&ctx, GPG_ERR_SOURCE_DEFAULT,
|
err = start_new_dirmngr (&ctx, GPG_ERR_SOURCE_DEFAULT,
|
||||||
opt.homedir, opt.dirmngr_program,
|
opt.homedir, opt.dirmngr_program,
|
||||||
1, opt.verbose, DBG_ASSUAN,
|
opt.autostart, opt.verbose, DBG_ASSUAN,
|
||||||
gpgsm_status2, ctrl);
|
gpgsm_status2, ctrl);
|
||||||
|
if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR)
|
||||||
|
{
|
||||||
|
static int shown;
|
||||||
|
|
||||||
|
if (!shown)
|
||||||
|
{
|
||||||
|
shown = 1;
|
||||||
|
log_info (_("no dirmngr running in this session\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
prepare_dirmngr (ctrl, ctx, err);
|
prepare_dirmngr (ctrl, ctx, err);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -183,7 +183,8 @@ enum cmd_and_opt_values {
|
||||||
oIgnoreTimeConflict,
|
oIgnoreTimeConflict,
|
||||||
oNoRandomSeedFile,
|
oNoRandomSeedFile,
|
||||||
oNoCommonCertsImport,
|
oNoCommonCertsImport,
|
||||||
oIgnoreCertExtension
|
oIgnoreCertExtension,
|
||||||
|
oNoAutostart
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -391,6 +392,7 @@ static ARGPARSE_OPTS opts[] = {
|
||||||
ARGPARSE_s_n (oNoRandomSeedFile, "no-random-seed-file", "@"),
|
ARGPARSE_s_n (oNoRandomSeedFile, "no-random-seed-file", "@"),
|
||||||
ARGPARSE_s_n (oNoCommonCertsImport, "no-common-certs-import", "@"),
|
ARGPARSE_s_n (oNoCommonCertsImport, "no-common-certs-import", "@"),
|
||||||
ARGPARSE_s_s (oIgnoreCertExtension, "ignore-cert-extension", "@"),
|
ARGPARSE_s_s (oIgnoreCertExtension, "ignore-cert-extension", "@"),
|
||||||
|
ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"),
|
||||||
|
|
||||||
/* Command aliases. */
|
/* Command aliases. */
|
||||||
ARGPARSE_c (aListKeys, "list-key", "@"),
|
ARGPARSE_c (aListKeys, "list-key", "@"),
|
||||||
|
@ -940,6 +942,7 @@ main ( int argc, char **argv)
|
||||||
|
|
||||||
dotlock_create (NULL, 0); /* Register lockfile cleanup. */
|
dotlock_create (NULL, 0); /* Register lockfile cleanup. */
|
||||||
|
|
||||||
|
opt.autostart = 1;
|
||||||
opt.session_env = session_env_new ();
|
opt.session_env = session_env_new ();
|
||||||
if (!opt.session_env)
|
if (!opt.session_env)
|
||||||
log_fatal ("error allocating session environment block: %s\n",
|
log_fatal ("error allocating session environment block: %s\n",
|
||||||
|
@ -1417,6 +1420,8 @@ main ( int argc, char **argv)
|
||||||
add_to_strlist (&opt.ignored_cert_extensions, pargs.r.ret_str);
|
add_to_strlist (&opt.ignored_cert_extensions, pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case oNoAutostart: opt.autostart = 0; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
|
pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct
|
||||||
char *lc_ctype;
|
char *lc_ctype;
|
||||||
char *lc_messages;
|
char *lc_messages;
|
||||||
|
|
||||||
|
int autostart;
|
||||||
const char *dirmngr_program;
|
const char *dirmngr_program;
|
||||||
int disable_dirmngr; /* Do not do any dirmngr calls. */
|
int disable_dirmngr; /* Do not do any dirmngr calls. */
|
||||||
const char *protect_tool_program;
|
const char *protect_tool_program;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user