1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: New common option no-autostart.

* common/comopt.c (opts): Add "no-autostart".
(parse_comopt): Set it.
* common/comopt.h (comopt): Add no_autostart.

* g10/gpg.c (main): Take care of the new option.
* sm/gpgsm.c (main): Ditto.
* tools/gpg-connect-agent.c (INCLUDED_BY_MAIN_MODULE): Add.
(main): Parse common options and handle new option.
* tools/gpg-card.c (main): Ditto.
(cmd_yubikey): Fix minor error reporting issue.

* common/util.h (GNUPG_MODULE_NAME_CARD): New const.
* common/homedir.c (gnupg_module_name): Support it.
--

Having a global option makes it easier to use disable autostart on a
server which is required to use a remote gpg-agent reliable.
This commit is contained in:
Werner Koch 2022-08-22 12:01:55 +02:00
parent bca00f1fba
commit 203dcc19eb
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
8 changed files with 39 additions and 2 deletions

View file

@ -29,6 +29,7 @@
#include <unistd.h>
#include <assert.h>
#define INCLUDED_BY_MAIN_MODULE 1
#include "../common/i18n.h"
#include "../common/util.h"
#include "../common/asshelp.h"
@ -39,6 +40,7 @@
# include "../common/exechelp.h"
#endif
#include "../common/init.h"
#include "../common/comopt.h"
#define CONTROL_D ('D' - 'A' + 1)
@ -1255,6 +1257,13 @@ main (int argc, char **argv)
if (log_get_errorcount (0))
exit (2);
/* Process common component options. */
if (parse_comopt (GNUPG_MODULE_NAME_CONNECT_AGENT, opt.verbose > 1))
exit(2);
if (comopt.no_autostart)
opt.autostart = 0;
/* --uiserver is a shortcut for a specific raw socket. This comes
in particular handy on Windows. */
if (opt.use_uiserver)