diff options
author | NIIBE Yutaka <[email protected]> | 2023-05-26 06:28:13 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-05-26 06:28:13 +0000 |
commit | f15a643a2d45c5ac2fbd80568d031808d6058f41 (patch) | |
tree | e72e15060977b6e35d51315400f4b7f3db88a731 /dirmngr/dirmngr.c | |
parent | gpg: Skip keys found via ADSKs. (diff) | |
download | gnupg-f15a643a2d45c5ac2fbd80568d031808d6058f41.tar.gz gnupg-f15a643a2d45c5ac2fbd80568d031808d6058f41.zip |
agent,dirmngr: Shutdown fix for supervised mode.
* agent/gpg-agent.c (handle_connections): Break if supervised.
* dirmngr/dirmngr.c (is_supervised): New.
(handle_connections): Break if supervised.
--
For supervised agent/dirmngr, 'systemctl stop' behaves just like
'gpgconf --kill', ignoring existing connections.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r-- | dirmngr/dirmngr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index bb54f4edd..50338f216 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -382,6 +382,9 @@ static enum } tor_mode; +/* Flag indicating that we are in supervised mode. */ +static int is_supervised; + /* Counter for the active connections. */ static int active_connections; @@ -1303,6 +1306,8 @@ main (int argc, char **argv) if (!opt.quiet) log_info(_("WARNING: \"%s\" is a deprecated option\n"), "--supervised"); + is_supervised = 1; + /* In supervised mode, we expect file descriptor 3 to be an already opened, listening socket. @@ -2362,7 +2367,7 @@ handle_connections (assuan_fd_t listen_fd) /* Shutdown test. */ if (shutdown_pending) { - if (!active_connections) + if (!active_connections || is_supervised) break; /* ready */ /* Do not accept new connections but keep on running the |