diff options
author | Werner Koch <[email protected]> | 2021-11-13 13:46:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-11-13 13:56:40 +0000 |
commit | dd708f60d5cf571bd4f0312c1b291ec93c328047 (patch) | |
tree | 4c8effa30247ff0e5bd8289c16b4a56cf03b7aac /dirmngr/dirmngr.c | |
parent | doc: Clarify the "ntds" AKL mechanism. (diff) | |
download | gnupg-dd708f60d5cf571bd4f0312c1b291ec93c328047.tar.gz gnupg-dd708f60d5cf571bd4f0312c1b291ec93c328047.zip |
agent,dirmngr: New option --steal-socket
* agent/gpg-agent.c (oStealSocket): New.
(opts): Add option.
(steal_socket): New file global var.
(main): Set option.
(create_server_socket): Implement option.
* dirmngr/dirmngr.c (oStealSocket): New.
(opts): Add option.
(steal_socket): New file global var.
(main): Set option. Add comment to eventually implement it.
--
Note that --steal-socket has currently no effect on dirmngr because
dirmngr does this anway.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r-- | dirmngr/dirmngr.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 51a586e20..78ca4b215 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -140,6 +140,7 @@ enum cmd_and_opt_values { oForce, oAllowOCSP, oAllowVersionCheck, + oStealSocket, oSocketName, oLDAPWrapperProgram, oHTTPWrapperProgram, @@ -186,6 +187,7 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_n (oNoDetach, "no-detach", N_("do not detach from the console")), ARGPARSE_s_n (oSh, "sh", N_("sh-style command output")), ARGPARSE_s_n (oCsh, "csh", N_("csh-style command output")), + ARGPARSE_s_n (oStealSocket, "steal-socket", "@"), ARGPARSE_s_s (oHomedir, "homedir", "@"), ARGPARSE_conffile (oOptions, "options", N_("|FILE|read options from FILE")), ARGPARSE_noconffile (oNoOptions, "no-options", "@"), @@ -363,6 +365,10 @@ static volatile int shutdown_pending; /* Flags to indicate that we shall not watch our own socket. */ static int disable_check_own_socket; +/* Flag indicating to start the daemon even if one already runs. */ +static int steal_socket; + + /* Flag to control the Tor mode. */ static enum { TOR_MODE_AUTO = 0, /* Switch to NO or YES */ @@ -1095,6 +1101,7 @@ main (int argc, char **argv) case oNoVerbose: opt.verbose = 0; break; case oHomedir: /* Ignore this option here. */; break; case oNoDetach: nodetach = 1; break; + case oStealSocket: steal_socket = 1; break; case oLogFile: logfile = pargs.r.ret_str; break; case oCsh: csh_style = 1; break; case oSh: csh_style = 0; break; @@ -1371,7 +1378,11 @@ main (int argc, char **argv) #endif )) { - /* Fixme: We should test whether a dirmngr is already running. */ + /* Fixme: We should actually test whether a dirmngr is + * already running. For now the steal option is a dummy. */ + /* if (steal_socket) */ + /* log_info (N_("trying to steal socket from running %s\n"), */ + /* "dirmngr"); */ gnupg_remove (redir_socket_name? redir_socket_name : socket_name); rc = assuan_sock_bind (fd, (struct sockaddr*) &serv_addr, len); } |